From: oetiker Date: Sun, 7 Jun 2009 14:45:55 +0000 (+0000) Subject: consider fgets return value X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4eae38f45320cb6dbdaadd36df3f08fd9f8a9aa6;p=rrdtool-all.git consider fgets return value git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1853 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index 13b7d067..27b4884b 100644 --- a/program/src/rrd_cgi.c +++ b/program/src/rrd_cgi.c @@ -1387,7 +1387,8 @@ s_var **rrdcgiReadVariables( length = atoi(ip); if ((line = (char *) malloc(length + 2)) == NULL) return NULL; - fgets(line, length + 1, stdin); + if (fgets(line, length + 1, stdin) == NULL) + return NULL; } else return NULL; } else if (cp && !strcmp(cp, "GET")) {