-
Notifications
You must be signed in to change notification settings - Fork 19
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
libs3: Build fails with format-overflow
warning on almalinux:9
#185
Comments
This may warrant an issue in the libs3 repo, but figured I'd start here. |
It appears that gcc is detecting potential overflow, so I think you're correct that an issue should be created. At least so we're aware of it. |
Okay, I created irods/libs3#26 to track the issue in the libs3 repo. We can determine here whether we can ignore this warning for our purposes and use the other issue to address the problem. |
I took another look at this... char sizebuf[16];
if (content->size < 100000) {
sprintf(sizebuf, "%5llu", (unsigned long long) content->size);
}
else if (content->size < (1024 * 1024)) {
sprintf(sizebuf, "%4lluK",
((unsigned long long) content->size) / 1024ULL);
} In order to execute this code path,
According to GNU's documentation on the formatted output functions...
However...
Seeing as the string will never exceed 5 characters (even in the event of an underflow), we know that the buffer will never overflow in this case. Does this assessment seem correct? I think this is safe to ignore. |
Maybe. Does the warning appear if you use This has likely existed for several years now. And given there hasn't been any updates to the upstream repo, it is likely safe to say we own it now. Meaning we can fix the warning. The question then becomes, how do we test it? |
Sorry, I don't understand. Is
I would think not. That would be my suggested solution to irods/libs3#26.
|
I don't think it is being used incorrectly, but perhaps increasing the size of
Good. |
Fair enough. Can try that as well. |
irods/libs3#26 is now resolved. This can be resolved by bumping the sha. |
Let's go ahead and take care of that. |
This warning was added in gcc 7 at the latest and yet I have not seen it trip on any platforms until now.
I'm using
gcc-toolset-12
becausegcc-toolset-11
is not available in repos currently configured.From the log...
The text was updated successfully, but these errors were encountered: