Revert "Fix array bounds problem in hddtemp code."
authorBrenden Matthews <brenden@rty.ca>
Mon, 25 May 2009 00:02:46 +0000 (18:02 -0600)
committerBrenden Matthews <brenden@rty.ca>
Mon, 25 May 2009 00:02:46 +0000 (18:02 -0600)
This reverts commit d0de7cbd630442f27d58d84c04ea65bb6f3d81d9.

src/hddtemp.c

index 665eb59..a622f6b 100644 (file)
@@ -91,7 +91,6 @@ static char *read_hdd_val(const char *line)
                return ret;
        /* read the device */
        dev = ++p;
-       if (!p) return ret;
        if (!(p = strchr(p, line_s[0])))
                return ret;
        *(p++) = '\0';
@@ -198,7 +197,6 @@ char *get_hddtemp_info(char *dev, char *hostaddr, int port)
        if ((p = read_hdd_val(buf)) == NULL)
                goto GET_OUT;
        do {
-               if (p >= buf + BUFLEN) break;
                if (!strncmp(dev, p, strlen(dev)))
                        asprintf(&r, "%s", p + strlen(dev));
                free(p);