You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have found a few functions in the source for gotcha that can exhibit undefined behavior (UB) and wanted to bring them to your attention.
gnu_hash_func in elf_ops.c : UB is observed if the char pointer (const char *str) points to a non-null terminated sequence of characters
gotcha_strnlen in libc_wrappers.c : UB is observed if const char *s points to a non-null terminated sequence of characters and size_t max_length is greater than the number of total bytes that const char *s points to.
Additionally, both of these functions exhibit UB if the char pointer parameter is null.
I would like to know if these observations are considered as bugs that should be fixed. Please let me know if you have questions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I have found a few functions in the source for gotcha that can exhibit undefined behavior (UB) and wanted to bring them to your attention.
const char *str
) points to a non-null terminated sequence of charactersconst char *s
points to a non-null terminated sequence of characters andsize_t max_length
is greater than the number of total bytes thatconst char *s
points to.Additionally, both of these functions exhibit UB if the char pointer parameter is null.
I would like to know if these observations are considered as bugs that should be fixed. Please let me know if you have questions.
Sincerely,
Arpan Srivastava
Beta Was this translation helpful? Give feedback.
All reactions