mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 1376643 - Use 'nullptr' where applicable in security/sandbox/. r=gcp
This commit is contained in:
parent
6f4056bbdb
commit
df076300b1
@ -76,7 +76,7 @@ SandboxBrokerClient::DoCall(const Request* aReq, const char* aPath,
|
||||
ios[2].iov_base = const_cast<char*>(aPath2);
|
||||
ios[2].iov_len = strlen(aPath2) + 1;
|
||||
} else {
|
||||
ios[2].iov_base = 0;
|
||||
ios[2].iov_base = nullptr;
|
||||
ios[2].iov_len = 0;
|
||||
}
|
||||
if (ios[1].iov_len > kMaxPathLen) {
|
||||
|
@ -34,7 +34,7 @@ static int HandleSigset(int (*aRealFunc)(int, const sigset_t*, sigset_t*),
|
||||
}
|
||||
|
||||
// Avoid unnecessary work
|
||||
if (aSet == NULL || aHow == SIG_UNBLOCK) {
|
||||
if (aSet == nullptr || aHow == SIG_UNBLOCK) {
|
||||
return aRealFunc(aHow, aSet, aOldSet);
|
||||
}
|
||||
|
||||
|
@ -425,9 +425,9 @@ DoLink(const char* aPath, const char* aPath2,
|
||||
size_t
|
||||
SandboxBroker::ConvertToRealPath(char* aPath, size_t aBufSize, size_t aPathLen)
|
||||
{
|
||||
if (strstr(aPath, "..") != NULL) {
|
||||
char* result = realpath(aPath, NULL);
|
||||
if (result != NULL) {
|
||||
if (strstr(aPath, "..") != nullptr) {
|
||||
char* result = realpath(aPath, nullptr);
|
||||
if (result != nullptr) {
|
||||
strncpy(aPath, result, aBufSize);
|
||||
aPath[aBufSize - 1] = '\0';
|
||||
free(result);
|
||||
|
Loading…
Reference in New Issue
Block a user