Skip to content

Commit

Permalink
Fix p4Create() off-by sizeof (P4_Ctx) with debug code (doh!).
Browse files Browse the repository at this point in the history
  • Loading branch information
SirWumpus committed Nov 8, 2024
1 parent db190ac commit 20f0e7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/post4.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,11 @@ p4Create(P4_Options *opts)
goto error0;
}
ctx->end = (P4_Char *)ctx + opts->mem_size * 1024;
ctx->here = (P4_Char*)(ctx+1);
/* GH-5 Setting memory to something other than zero can
* help debug possible memory use before initialising.
*/
MEMSET(ctx+1, BYTE_ME, opts->mem_size * 1024);
ctx->here = (P4_Char*)(ctx+1);
MEMSET(ctx->here, BYTE_ME, ctx->end - ctx->here);

ctx->radix = 10;
ctx->unkey = EOF;
Expand Down

0 comments on commit 20f0e7c

Please sign in to comment.