]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD client stack: add an assert to check the stringtable doesn't get overwritten
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 6 Dec 2025 09:50:38 +0000 (10:50 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 6 Dec 2025 09:50:38 +0000 (10:50 +0100)
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])

coregrind/m_initimg/initimg-freebsd.c

index cd127736ce196a5f4dc3052e60a29155be2fa34c..40f74168c90bce54713726cea8d04d803d327a62 100644 (file)
@@ -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) {