baresip/re

stack corruption detected (-fstack-protector)

Closed this issue · 3 comments

KORuL commented

in function
sa_ntop
or
net_add_address_ifname
or related to filling
struct sa temp_sa

KORuL commented

when the network changes in a mobile application, a crash occurs after calling a function from the library

retest tests works fine with -fstack-protector. it looks like a baresip-studio related bug to me. At a first look, the strlen in malloc is used without adding additional +1 for null-terminator. And strtok is reading maybe out of bounds and strcpy writing out-of-bounds.
210087765-d4e308c9-5642-49e6-9f29-264d081d54e2

strcpy()
              These functions copy the string pointed to by src, into a string at the buffer pointed to by dst.  The programmer is responsible for allo‐
              cating a destination buffer large enough, that is, strlen(src) + 1.  For the difference between the two functions, see RETURN VALUE.