lrs_alloc_dat(NULL) -> segfault

Questions and problems about using polymake go here.
jamesjer
Posts: 35
Joined: 01 Mar 2012, 16:51

lrs_alloc_dat(NULL) -> segfault

Postby jamesjer » 20 Mar 2013, 15:28

I just experienced a polymake segfault. The problem is that apps/polytope/src/lrs_interface.cc has this code on line 313:

Q=lrs_alloc_dat(0);

and here is a snippet from the lrslib code:

lrs_dat *
lrs_alloc_dat (char *name)
{
lrs_dat *Q;
...
Q->name=(char *) CALLOC ((unsigned) strlen(name)+1, sizeof (char));
...
}

Calling strlen(NULL) causes the segfault. I will attach a patch that fixes the problem.
Attachments
polymake-lrslib.patch
Patch to fix crash in lrslib
(409 Bytes) Downloaded 370 times

User avatar
joswig
Main Author
Posts: 282
Joined: 24 Dec 2010, 11:10

Re: lrs_alloc_dat(NULL) -> segfault

Postby joswig » 24 Mar 2013, 22:08

It seems you are using a version of lrslib other than the one shipped with polymake. Your patch is not necessary for polymake's lrslib. The polymake version fixes a few glitches of the original.


Return to “Helpdesk”