#137 sdcclib can access bad memory when parsing files

closed-accepted
nobody
None
5
2009-05-07
2009-05-06
Jon Nall
No

The loop in GetNameFromPath in sdcclib.c needs to check the validity of i before using it to access a string.

I believe this bug is reproducible when you give sdcclib and argument without any path qualifier (e.g. "filename.rel"). Specifically, I am on Mac OSX 10.5.6

Patch is attached and is created against r5450.

Discussion

  • Both GetNameFromPath() and ChangeExtension() had this problem. Fixed in r5451.

     
    • status: open --> closed-accepted