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
size=1count=1clear= false
label="char[]"if (!adjust_size(&size, 1)) ; // branch not takenret=/*return*/tal_alloc_(ctx, 1, false, "char[]");
if (ret&&NULL) ; // branch not taken// memcpy(ret, p, nbytes);returnret;
So at the end of this call chain, we return a pointer to a buffer of size 1 whose sole byte has never been initialized, and we're claiming that this pointer points to a NUL-terminated string. That's bad! ☹️
The text was updated successfully, but these errors were encountered:
There is an edge case in
tal_strdup
that results in the return of an unterminated string to the caller.ccan/ccan/tal/str/str.h
Line 19 in cd56b18
ccan/ccan/tal/str/str.c
Lines 15 to 19 in cd56b18
ccan/ccan/tal/tal.h
Lines 407 to 410 in cd56b18
ccan/ccan/tal/tal.c
Lines 814 to 854 in cd56b18
ccan/ccan/tal/tal.c
Lines 500 to 507 in cd56b18
So at the end of this call chain, we return a pointer to a buffer of size 1 whose sole byte has never been initialized, and we're claiming that this pointer points to a NUL-terminated string. That's bad!☹️
The text was updated successfully, but these errors were encountered: