]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
prvm_leaktest: fix trace string truncation
authorbones_was_here <bones_was_here@xonotic.au>
Wed, 20 Dec 2023 07:40:04 +0000 (17:40 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 21 Jan 2024 07:00:45 +0000 (17:00 +1000)
This was caught by the new warnings.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
prvm_edict.c

index a03d0bd1352a636b3d18b11edb51bb8b18017a29..36a44e481266c9dfb51fc5eba9cbe9ae3d15a0ca 100644 (file)
@@ -220,8 +220,9 @@ const char *PRVM_AllocationOrigin(prvm_prog_t *prog)
        if(prog->leaktest_active)
        if(prog->depth > 0) // actually in QC code and not just parsing the entities block of a map/savegame
        {
-               buf = (char *)PRVM_Alloc(256);
-               PRVM_ShortStackTrace(prog, buf, 256);
+               // bones_was_here: this is the smallest 64 multiple that avoids truncation in Xonotic (was 256)
+               buf = (char *)PRVM_Alloc(448);
+               PRVM_ShortStackTrace(prog, buf, 448);
        }
        return buf;
 }