skydevgit / crisscross

Automatically exported from code.google.com/p/crisscross
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

LList's change method segfaults with an index that is out of bounds #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Using the LList class's change method with an index that is either negative
or too large (greater than the size of the list) results in a segmentation
fault.

The expected behaviour is that the LList object remains unmodified.

The fix is to add a check for a NULL value that may be returned from the
getItem method.

Original issue reported on code.google.com by omo...@gmail.com on 25 Apr 2010 at 9:37

GoogleCodeExporter commented 9 years ago
I fixed this issue in my fork of the project here:
http://github.com/omouse/crisscross/commit/479a3283aa32b9305b21fbd7d19fc162449b9
a60

It's just a simple `if(x!=NULL) ...` check.

Original comment by omo...@gmail.com on 25 Apr 2010 at 9:46