Bug 1376643 - Use 'nullptr' where applicable in security/sandbox/. r=gcp

This commit is contained in:
Jan Keromnes 2017-06-27 17:56:00 +02:00
parent 6f4056bbdb
commit df076300b1
3 changed files with 5 additions and 5 deletions

View File

@ -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) {

View File

@ -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);
}

View File

@ -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);