pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: starbugs@qq.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16188: The usage of NULL pointer in rege_dfa.c
Date: Sun, 05 Jan 2020 23:09:01 -0500
Message-ID: <739.1578283741@sss.pgh.pa.us> (raw)
In-Reply-To: <16188-c632b0d6f863a87e@postgresql.org>
References: <16188-c632b0d6f863a87e@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> We checked the code in file “rege_dfa.c” and there is one error occurring in
> line 481. This error is caused by the usage of pointer with NULL value. The
> code in this line is “d->work = &d->statesarea[nss * wordsper];” We checked
> the code two lines before the error occurred line and the code is
> “d->statesarea = (unsigned *) MALLOC((nss + WORK) * wordsper
> *sizeof(unsigned));”. We found the code hasn’t checked weather the process
> “MALLOC” is success or not which directly define the value of the
> “statesarea” field of pointer “d”.

I don't see any bug there.  If the malloc for statesarea fails, the
code will exit a few lines further down, without ever having dereferenced
d->work.  So whether d->work is a valid pointer or not is irrelevant.

			regards, tom lane





view thread (2+ messages)

Message-ID: <739.1578283741@sss.pgh.pa.us>
Permalink:  ../739.1578283741@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/739.1578283741@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, starbugs@qq.com
  Subject: Re: BUG #16188: The usage of NULL pointer in rege_dfa.c
  In-Reply-To: <739.1578283741@sss.pgh.pa.us>
  References: <16188-c632b0d6f863a87e@postgresql.org> <739.1578283741@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox