c_koans icon indicating copy to clipboard operation
c_koans copied to clipboard

No actual reallocation and UB in about_arrays.c

Open 3JlOy-PYCCKUi opened this issue 2 years ago • 0 comments

In the file about_arrays.c on line 81 the array int is allocated with 5 elements (defined on line 80), then in line 96 this array is reallocated again with 5 elements (with the same size variable), and then access to the 6th (on index 5) element of the array (of 5 elements) is undefined behavior

3JlOy-PYCCKUi avatar Apr 26 '22 12:04 3JlOy-PYCCKUi