From 4eae38f45320cb6dbdaadd36df3f08fd9f8a9aa6 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 7 Jun 2009 14:45:55 +0000 Subject: [PATCH] consider fgets return value git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1853 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_cgi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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")) { -- 2.30.2