Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4189 closed defect (fixed)

Undefined behaviour in SADFWrite

Reported by: Algunenano Owned by: Algunenano
Priority: medium Milestone: PostGIS 2.2.8
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

Running using gcc -fsanitize=undefined -fsanitize-undefined-trap-on-error:

Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/un/dev_public/postgis/loader/.libs/lt-pgsql2shp -f /tmp/pgis_reg/dumper postgi'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00005613a20ab07d in SADFWrite (p=0x0, size=32, nmemb=0, file=0x5613a2d4dc40)
(gdb) bt
#0  0x00005613a20ab07d in SADFWrite (p=0x0, size=32, nmemb=0, file=0x5613a2d4dc40)
#1  0x00005613a20b6436 in DBFWriteHeader (psDBF=psDBF@entry=0x5613a2d510c0) at dbfopen.c:237
#2  0x00005613a20b821f in DBFWriteHeader (psDBF=0x5613a2d510c0) at dbfopen.c:211
#3  DBFClose (psDBF=0x5613a2d510c0) at dbfopen.c:587
#4  0x00005613a20c21cf in ShpDumperCloseTable (state=state@entry=0x5613a2d447e0) at pgsql2shp-core.c:2191
#5  0x00005613a20ab80a in main (argc=<optimized out>, argv=<optimized out>) at pgsql2shp-cli.c:229

PR: https://github.com/postgis/postgis/pull/310

Change History (5)

comment:1 by Raul Marin, 6 years ago

In 16862:

Fix undefined behaviour in SADFWrite

Also addresses several gcc warnings
References #4189

comment:2 by Raul Marin, 6 years ago

Resolution: fixed
Status: assignedclosed

In 16863:

Fix undefined behaviour in SADFWrite

Also addresses several GCC warnings.

Closes #4189
Closes https://github.com/postgis/postgis/pull/310

comment:3 by Raul Marin, 6 years ago

In 16864:

Fix undefined behaviour in SADFWrite

References #4189

comment:4 by Raul Marin, 6 years ago

In 16865:

Fix undefined behaviour in SADFWrite

References #4189

comment:5 by Raul Marin, 6 years ago

In 16866:

Fix undefined behaviour in SADFWrite

References #4189

Note: See TracTickets for help on using tickets.