mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
Fix "off-by-one" bug in hddtemp found by valgrind
This commit is contained in:
parent
002685c0ce
commit
3a23eb5f6c
@ -133,7 +133,7 @@ static char *fetch_hddtemp_output(void)
|
|||||||
close(sockfd);
|
close(sockfd);
|
||||||
}
|
}
|
||||||
if (!rp) {
|
if (!rp) {
|
||||||
NORM_ERR("could not connect to mpd host");
|
NORM_ERR("could not connect to hddtemp host");
|
||||||
goto GET_OUT;
|
goto GET_OUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,6 +175,8 @@ static int read_hdd_val(const char *line, char **dev, short *val, char *unit,
|
|||||||
line_s = *saveptr;
|
line_s = *saveptr;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
|
if(!*p)
|
||||||
|
goto out_fail;
|
||||||
/* read the device */
|
/* read the device */
|
||||||
*dev = ++p;
|
*dev = ++p;
|
||||||
if (!(p = strchr(p, line_s[0])))
|
if (!(p = strchr(p, line_s[0])))
|
||||||
|
Loading…
Reference in New Issue
Block a user