projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c1c9f06
)
Fixing 0000280: stack smashing detected
author
Muhammad Usama
<m.usama@gmail.com>
Thu, 26 Jan 2017 20:48:38 +0000
(
01:48
+0500)
committer
Muhammad Usama
<m.usama@gmail.com>
Thu, 26 Jan 2017 20:48:38 +0000
(
01:48
+0500)
It was a buffer overflow in wd_get_cmd function.
watchdog/wd_if.c
patch
|
blob
|
blame
|
history
diff --git
a/watchdog/wd_if.c
b/watchdog/wd_if.c
index fc472a427dfa80e241cd982af69cd4067d28480d..169b8958f30ba843d6e124fa0495792cd79833e5 100644
(file)
--- a/
watchdog/wd_if.c
+++ b/
watchdog/wd_if.c
@@
-147,12
+147,12
@@
wd_get_cmd(char * buf, char * cmd)
{
int i,j;
i = 0;
- while(isspace(cmd[i]) != 0)
+ while(
cmd[i] &&
isspace(cmd[i]) != 0)
{
i++;
}
j = 0;
- while(isspace(cmd[i]) == 0)
+ while(
cmd[i] &&
isspace(cmd[i]) == 0)
{
buf[j++] = cmd[i++];
}