Closed Bug 1305219 Opened 8 years ago Closed 8 years ago

[Coverity 1373336+1373337] Fix some issues reported by Coverity

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ttaubert, Assigned: ttaubert)

References

(Blocks 1 open bug)

Details

*** CID 1373337:  Null pointer dereferences  (REVERSE_INULL)
/cmd/signtool/javascript.c: 1711 in make_dirs()
1705             return 0;
1706         }
1707     
1708         Path = PL_strdup(path);
1709         start = strpbrk(Path, "/\\");
1710         if (!start) {
>>>     CID 1373337:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "Path" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1711             if (Path) {
1712                 PR_Free(Path);
1713             }
1714             return 0;
1715         }
1716         start++; /* start right after first slash */

** CID 1373336:  Error handling issues  (CHECKED_RETURN)
/external_tests/ssl_gtest/ssl_extension_unittest.cc: 629 in nss_test::TlsPreSharedKeyReplacer::FilterExtension(unsigned short, const nss_test::DataBuffer &, nss_test::DataBuffer *)()



*** CID 1373336:  Error handling issues  (CHECKED_RETURN)
/external_tests/ssl_gtest/ssl_extension_unittest.cc: 629 in nss_test::TlsPreSharedKeyReplacer::FilterExtension(unsigned short, const nss_test::DataBuffer &, nss_test::DataBuffer *)()
623         if (extension_type != ssl_tls13_pre_shared_key_xtn) {
624           return KEEP;
625         }
626     
627         TlsParser parser(input);
628         uint32_t len;          // Length of the overall vector.
>>>     CID 1373336:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "Read" without checking return value (as is done elsewhere 13 out of 14 times).
629         parser.Read(&len, 2);  // We only allow one entry.
630         EXPECT_EQ(parser.remaining(), len);
631         if (len != parser.remaining()) {
632           return DROP;
633         }
634         DataBuffer buf;
https://nss-dev.phacility.com/D23
Flags: needinfo?(franziskuskiefer)
https://hg.mozilla.org/projects/nss/rev/c67c91b6c9ac
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(franziskuskiefer)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.