Menu

#39 segfault in basename_simple of main.c

open
nobody
oops (16)
5
2007-11-23
2007-11-23
No

Rioutil V1.5.0 was working sometimes and sometimes not (segfault). Turns out to be a really simple array indexing bug on line 53 of main.c in the basename_simple function.

was: for (i=strlen(x)-1;x[i]!='/';i--);

fix: for (i=strlen(x)-1;i>=0&&x[i]!='/';i--);

This occurs whenever given file path doesn't have a slash in it somewhere.

Discussion


Log in to post a comment.