Page 1 of 1

lrs_alloc_dat(NULL) -> segfault

Posted: 20 Mar 2013, 15:28
by jamesjer
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.

Re: lrs_alloc_dat(NULL) -> segfault

Posted: 24 Mar 2013, 22:08
by joswig
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.