-
Notifications
You must be signed in to change notification settings - Fork 474
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
Length mismatch in array init causes buffer overflow #693
Labels
Comments
I think the issue is in |
Thanks! I filed #694 to fix this. |
Beat me to it by a few seconds! I also filed #695. |
Sorry, I didn't notice you were writing a patch to fix this... |
No worries, I like your patch better than mine anyways :). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When initializing an array, the value put in the length field is equal to the total number of allocated bytes, not the number of elements the array can hold.
Example:
This should print
10
, but prints88
. In particular, it has only allocated space for 10 elements of data, so creation ofarr
in the example is UB.The text was updated successfully, but these errors were encountered: