projects
/
monky
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca9ebd9
)
Fix "off-by-one" bug in hddtemp found by valgrind
author
Pavel Labath
<pavelo@centrum.sk>
Fri, 15 Jan 2010 22:41:04 +0000
(23:41 +0100)
committer
Pavel Labath
<pavelo@centrum.sk>
Fri, 15 Jan 2010 22:44:39 +0000
(23:44 +0100)
src/hddtemp.c
patch
|
blob
|
history
diff --git
a/src/hddtemp.c
b/src/hddtemp.c
index
12e6f24
..
5f7edec
100644
(file)
--- a/
src/hddtemp.c
+++ b/
src/hddtemp.c
@@
-130,7
+130,7
@@
static char *fetch_hddtemp_output(void)
close(sockfd);
}
if (!rp) {
- NORM_ERR("could not connect to mpd host");
+ NORM_ERR("could not connect to hddtemp host");
goto GET_OUT;
}
@@
-172,6
+172,8
@@
static int read_hdd_val(const char *line, char **dev, short *val, char *unit,
line_s = *saveptr;
again:
+ if(!*p)
+ goto out_fail;
/* read the device */
*dev = ++p;
if (!(p = strchr(p, line_s[0])))