-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release build for MinGW CI; Fix GCC 12/13 warnings #1536
Conversation
85082d4
to
29f1362
Compare
for (size_t i = 0; i < len; i++) { | ||
// GCC 12/13 report `stringop-overflow` on the following line | ||
// without additional condition: `i < sizeof(int64_t)` | ||
for (size_t i = 0; i < len && i < sizeof(int64_t); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, that can already be deduced from (len > sizeof(int64_t)
....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe so. But gcc-13
seems to think otherwise:
/Users/justsmth/repos/aws-lc/crypto/bytestring/cbs.c: In function 'CBS_get_asn1_int64':
/Users/justsmth/repos/aws-lc/crypto/bytestring/cbs.c:534:20: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
534 | sign_extend[i] = data[len - i - 1];
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/Users/justsmth/repos/aws-lc/crypto/bytestring/cbs.c:521:11: note: at offset 8 into destination object 'sign_extend' of size 8
521 | uint8_t sign_extend[sizeof(int64_t)];
| ^~~~~~~~~~~
¯\_(ツ)_/¯
@@ -442,7 +442,7 @@ ECDSA_SIG *ecdsa_digestsign_no_self_test(const EVP_MD *md, const uint8_t *input, | |||
const uint8_t *nonce, | |||
size_t nonce_len) { | |||
uint8_t digest[EVP_MAX_MD_SIZE]; | |||
unsigned int digest_len; | |||
unsigned int digest_len = EVP_MAX_MD_SIZE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be zero, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe EVP_MAX_MD_SIZE
is correct. This value gets dereferenced as the len
parameter in the call to EVP_DigestFinalXOF
.
Issues:
Resolves:
x86_64-pc-windows-gnu
Target due to Uninitialized Variables inaws-lc
aws-lc-rs#397Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.