projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
005ffb1
)
Fix a possible crash in the file browser
author
Byrial Jensen
<byrial@vip.cybercity.dk>
Sun, 18 Dec 2011 12:26:20 +0000 (13:26 +0100)
committer
Byrial Jensen
<byrial@vip.cybercity.dk>
Sun, 18 Dec 2011 12:26:20 +0000 (13:26 +0100)
If the OK button was selected in the file browser when no file was selected
there was a read out of bounds which could crash xboard
filebrowser/selfile.c
patch
|
blob
|
history
diff --git
a/filebrowser/selfile.c
b/filebrowser/selfile.c
index
e6edfe4
..
729453b
100644
(file)
--- a/
filebrowser/selfile.c
+++ b/
filebrowser/selfile.c
@@
-883,7
+883,7
@@
XsraSelFile(toplevel, prompt, ok, cancel, failed,
SFprepareToReturn();
return stderr;
}
- if ((*name_return)[strlen(*name_return)-1] != '/' && // [HGM] refuse directories
+ if ((!(*name_return)[0] || (*name_return)[strlen(*name_return)-1] != '/') && // [HGM] refuse directories
(fp = SFopenFile(*name_return, mode, prompt, failed))) {
SFprepareToReturn();
return fp;