| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
|
This is what was reported by Coverity 1 new defect(s) introduced to Node.js found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)
** CID 249964: Integer handling issues (NEGATIVE_RETURNS)
________________________________________________________________________________________________________
*** CID 249964: Integer handling issues (NEGATIVE_RETURNS)
/src/crypto/crypto_common.cc: 772 in node::crypto::PrintGeneralName(const std::unique_ptr<bio_st, node::FunctionDeleter<bio_st, (&BIO_free_all)>> &, const GENERAL_NAME_st *)()
766 kX509NameFlagsRFC2253WithinUtf8JSON) < 0) {
767 return false;
768 }
769 char* oline = nullptr;
770 size_t n_bytes = BIO_get_mem_data(tmp.get(), &oline);
771 CHECK_IMPLIES(n_bytes != 0, oline != nullptr);
>>> CID 249964: Integer handling issues (NEGATIVE_RETURNS)
>>> "n_bytes" is passed to a parameter that cannot be negative.
772 PrintAltName(out, oline, n_bytes, true, nullptr);
773 } else if (gen->type == GEN_IPADD) {
774 BIO_printf(out.get(), "IP Address:");
775 const ASN1_OCTET_STRING* ip = gen->d.ip;
776 const unsigned char* b = ip->data;
777 if (ip->length == 4) {
|
Sorry, something went wrong.
|
I don't know whey I don't get the linter errors when I run locally :( |
Sorry, something went wrong.
Coverity correctly reported that the value returned by BIO_get_mem_data could be negative and the type provided for the return value was unsigned. Fix up the type and check. Signed-off-by: Michael Dawson <mdawson@devrus.com>
|
Fixed lint issues and force pushed. |
Sorry, something went wrong.
There was a problem hiding this comment.
FWIW, BIO_get_mem_data internally casts a size_t to long, so the result is guaranteed to be valid when cast to size_t.
Sorry, something went wrong.
Co-authored-by: Tobias Nießen <tniessen@tnie.de>
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
The update to the checks on the issue seems to be stale. This CI run - https://ci.nodejs.org/job/node-test-pull-request/42821/ shows all green. Going to land. |
Sorry, something went wrong.
Coverity correctly reported that the value returned by BIO_get_mem_data could be negative and the type provided for the return value was unsigned. Fix up the type and check. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #42135 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
|
This doesn't land on 17.x, and it looks like it's because it's modifying code added in a semver-major, so I'm adding the dont-land-on-17 label. |
Sorry, something went wrong.
Coverity correctly reported that the value returned by BIO_get_mem_data could be negative and the type provided for the return value was unsigned. Fix up the type and check. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: nodejs#42135 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
|
This depends on #42002 which is another semver major; so this can not be landed in V16.x |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Coverity correctly reported that the value returned
by BIO_get_mem_data could be negative and the type
provided for the return value was unsigned.
Fix up the type and check.
Signed-off-by: Michael Dawson mdawson@devrus.com