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=5052175ab8c3ce994df281cee4aa1f8c3df1b70c;p=rrdtool.git consider fgets return value git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1853 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index 13b7d06..27b4884 100644 --- a/src/rrd_cgi.c +++ b/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")) {