=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryzman(at)gmail(dot)com> writes:
> ...
> rp = result = NULL; /* keep compiler quiet */
> }
> *rp = '\0';
> ....
> this strikes me as a clear case of possible null pointer dereference,
> wouldn't you agree ?
No, I wouldn't. You need to enlarge your peephole by one line:
else
{
elog(ERROR, "unrecognized bytea_output setting: %d",
bytea_output);
rp = result = NULL; /* keep compiler quiet */
}
*rp = '\0';
The "keep compiler quiet" line is unreachable code (and that comment is
supposed to remind you of that).
regards, tom lane