GNU bug report logs -
#77325
Crash in Fjson_parse_buffer: ZV changes underneath it?
Previous Next
Full log
View this message in rfc822 format
> Date: Sat, 29 Mar 2025 15:37:17 +0000
> From: Pip Cet <pipcet <at> protonmail.com>
> Cc: dancol <at> dancol.org, 77325 <at> debbugs.gnu.org
>
> The code does seem a bit complicated for what it's trying to achieve, to
> be honest. I think it'd be clearer just to write:
>
> unsigned char *begin = PT_ADDR;
> unsigned char *end = min (GPT_ADDR, ZV_ADDR);
> unsigned char *secondary_begin = min (GAP_END_ADDR, ZV_ADDR));
> unsigned char *secondary_end = ZV_ADDR;
>
> json_parser_init (&p, conf, begin, end, secondary_begin,
> secondary_end);
>
> json_parser_init fixes up secondary_begin and secondary_end to be NULL
> pointers in this case.
I'd prefer the secondary_* values to be set NULL explicitly, otherwise
it is hard to understand what the code does without looking deep into
the subroutines of json_parse.
This bug report was last modified 78 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.