Opened 6 years ago

Closed 5 years ago

#4327 closed defect (fixed)

Possible problem in file raster/rt_pg/rtpostgis.c line 471

Reported by: petrum Owned by: Algunenano
Priority: medium Milestone: PostGIS 2.5.3
Component: raster Version: master
Keywords: Cc:

Description

While experimenting with a novel static analysis technique in CodeSonar, we noticed the following potential problem at the next location:

FilePath: raster/rt_pg/rtpostgis.c Function: _PG_init Line number: 471

If the POSTGIS_ENABLE_OUTDB_RASTERS variable is set to the empty string, the result of getenv will be deallocated at the indicated line (which is forbidden according to the specification of getenv).

Thanks, Petru-Florin Mihancea

Change History (6)

comment:1 by robe, 6 years ago

Milestone: PostGIS 2.5.2PostGIS 2.5.3

comment:2 by Algunenano, 5 years ago

Owner: changed from Bborie Park to Algunenano

Thanks a lot for the report, it is indeed a bug.

PR to solve this is https://github.com/postgis/postgis/pull/419

Needs to be backported to all stable branches.

comment:3 by Raul Marin, 5 years ago

In 17522:

Avoid pfree'ing the result of getenv

References #4327
Closes https://github.com/postgis/postgis/pull/419/

comment:4 by Raul Marin, 5 years ago

In 17523:

Avoid pfree'ing the result of getenv

References #4327

comment:5 by Raul Marin, 5 years ago

In 17524:

Avoid pfree'ing the result of getenv

References #4327

comment:6 by Raul Marin, 5 years ago

Resolution: fixed
Status: newclosed

In 17525:

Avoid pfree'ing the result of getenv

Closes #4327

Note: See TracTickets for help on using tickets.