pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: starbugs@qq.com
Subject: BUG #16188: The usage of NULL pointer in rege_dfa.c
Date: Mon, 06 Jan 2020 03:20:01 +0000
Message-ID: <16188-c632b0d6f863a87e@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16188
Logged by:          Jian Zhang
Email address:      starbugs@qq.com
PostgreSQL version: 12.1
Operating system:   Linux
Description:        

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”. This “statesarea” field of pointer “d” is
used later in line 481. The program should check the effectiveness of the
return value of function “MALLOC” to avoid this error.



view thread (2+ messages)  latest in thread

Message-ID: <16188-c632b0d6f863a87e@postgresql.org>
Permalink:  ../16188-c632b0d6f863a87e@postgresql.org/
Also on:    postgresql.org/message-id/16188-c632b0d6f863a87e@postgresql.org

 · 

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: noreply@postgresql.org, starbugs@qq.com
  Subject: Re: BUG #16188: The usage of NULL pointer in rege_dfa.c
  In-Reply-To: <16188-c632b0d6f863a87e@postgresql.org>
  References: <16188-c632b0d6f863a87e@postgresql.org>

* 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