=?UTF-8?Q?Grzegorz_Ja=C5=9Bkiewicz?= <gryz...@gmail.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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to