From: Paul Floyd Date: Sat, 6 Dec 2025 09:50:38 +0000 (+0100) Subject: FreeBSD client stack: add an assert to check the stringtable doesn't get overwritten X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c48791a0db7ee5e69fd061c696608c121bb5b190;p=thirdparty%2Fvalgrind.git FreeBSD client stack: add an assert to check the stringtable doesn't get overwritten There's already an assert that the stringsize calculated matches the stringsize writte. This adds a check that the pointer table area does not overwrite the stringtable (that is, that the NULL pointer after the last auxv entry pointer does not overwrite the first string [either the interpreter or argv[0]) --- diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index cd127736c..40f74168c 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -841,6 +841,8 @@ static Addr setup_client_stack(const void* init_sp, vg_assert((strtab-stringbase) == stringsize); + vg_assert((HChar*)auxv < stringbase); + /* client_SP is pointing at client's argc/argv */ if (0) {