summaryrefslogtreecommitdiff
path: root/sys/src/cmd/wikifs
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-11-07 12:51:59 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-11-07 12:51:59 +0100
commit797cc13c7053dbdd16c20dc4dee5aee8c92390b0 (patch)
tree5aa7a00f0edeb1d2938d2dff116ee37f2570e8a5 /sys/src/cmd/wikifs
parent5364fa720de3b963a88dc4810ed83b4f2ab11d12 (diff)
fix dangerous werrstr() usages
werrstr() takes a format string as its first argument. a common error is to pass user controlled string buffers into werrstr() that might contain format string escapes causing werrstr() to take bogus arguments from the stack and crash. so instead of doing: werrstr(buf); we want todo: werrstr("%s", buf); or if we have a local ERRMAX sized buffer that we can override: errstr(buf, sizeof buf);
Diffstat (limited to 'sys/src/cmd/wikifs')
-rw-r--r--sys/src/cmd/wikifs/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/wikifs/io.c b/sys/src/cmd/wikifs/io.c
index 43743744e..6be5f22c5 100644
--- a/sys/src/cmd/wikifs/io.c
+++ b/sys/src/cmd/wikifs/io.c
@@ -676,7 +676,7 @@ writepage(int num, ulong t, String *s, char *title)
if(conflict){
close(lfd);
voidcache(num);
- werrstr(err);
+ errstr(err, sizeof err);
return -1;
}