projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
237a380
)
fix possible buffer underrun by 1
author
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 10 Mar 2011 20:48:15 +0000
(21:48 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 4 Sep 2011 14:51:46 +0000
(14:51 +0000)
citadel/control.c
patch
|
blob
|
history
diff --git
a/citadel/control.c
b/citadel/control.c
index 242cac8163cf97c247c5ebeff6e3b2d14bbd4967..2e5bf43c876aa27896ad9da9b87d4b4f7240905c 100644
(file)
--- a/
citadel/control.c
+++ b/
citadel/control.c
@@
-686,9
+686,12
@@
void cmd_conf(char *argbuf)
extract_token(confname, argbuf, 1, '|', sizeof confname);
confptr = CtdlGetSysConfig(confname);
if (confptr != NULL) {
+ long len;
+
+ len = strlen(confptr);
cprintf("%d %s\n", LISTING_FOLLOWS, confname);
- client_write(confptr,
strlen(confptr)
);
- if (
confptr[strlen(confptr) - 1] != 10
)
+ client_write(confptr,
len
);
+ if (
(len > 0) && (confptr[len - 1] != 10)
)
client_write("\n", 1);
cprintf("000\n");
free(confptr);