projects
/
empserver
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b62b35
)
Fix getpath() not to crash when path exceeds MAX_PATH_LEN
author
Markus Armbruster
<armbru@pond.sub.org>
Thu, 14 Jan 2010 21:39:42 +0000
(22:39 +0100)
committer
Markus Armbruster
<armbru@pond.sub.org>
Tue, 19 Jan 2010 07:40:17 +0000
(08:40 +0100)
Trivial for players to trigger. Broken in commit
0b0612ea
, v4.3.16.
Spotted by the Clang Static Analyzer.
src/lib/subs/paths.c
patch
|
blob
|
history
diff --git
a/src/lib/subs/paths.c
b/src/lib/subs/paths.c
index e9754b3db214440ef7208fa2cd1b17fe16ff9230..4a95ed38739e98cdb4e6dfe3609393783e98588a 100644
(file)
--- a/
src/lib/subs/paths.c
+++ b/
src/lib/subs/paths.c
@@
-173,7
+173,7
@@
getpath(char *buf, char *arg, coord x, coord y, int onlyown,
if (p + strlen(bp) + 1 >= buf + MAX_PATH_LEN) {
pr("Path length may not exceed %d.\n", MAX_PATH_LEN);
pr("Aborting...\n");
-
bp =
NULL;
+
return
NULL;
}
strcpy(p, bp);
if (*bp)