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
because strndup() is accessing the 8th byte of s, which is obviously an out-of-bounds error. However, ASAN is using its own implementation of this and other functions to detect errors. And in this case the function must not access the nth byte but it does. It is not explicitly stated in strndup() definition but glibc uses strnlen() function to get the size of s, which states that the nth byte will not be accessed. In any case, it is a more-than-reasonable assumption, strndup() does not need to access it so why should it.
The text was updated successfully, but these errors were encountered:
char *s = calloc(7, 1);
memcpy(s, "1.1.1.1", 7);
char *s2 = strndup(s, 7);
because strndup() is accessing the 8th byte of s, which is obviously an out-of-bounds error. However, ASAN is using its own implementation of this and other functions to detect errors. And in this case the function must not access the nth byte but it does. It is not explicitly stated in strndup() definition but glibc uses strnlen() function to get the size of s, which states that the nth byte will not be accessed. In any case, it is a more-than-reasonable assumption, strndup() does not need to access it so why should it.
The text was updated successfully, but these errors were encountered: