Author: timb
Date: 2008-10-13 22:20:45 +0200 (Mon, 13 Oct 2008)
New Revision: 1537

Modified:
   trunk/openvas-libnasl/ChangeLog
   trunk/openvas-libnasl/nasl/nasl_cmd_exec.c
Log:
Fixed logic bug, fdopen returns NULL on failure and not as the test was "!= 
FALSE"


Modified: trunk/openvas-libnasl/ChangeLog
===================================================================
--- trunk/openvas-libnasl/ChangeLog     2008-10-13 14:33:58 UTC (rev 1536)
+++ trunk/openvas-libnasl/ChangeLog     2008-10-13 20:20:45 UTC (rev 1537)
@@ -1,3 +1,8 @@
+2008-10-13  Tim Brown <[EMAIL PROTECTED]>
+
+       * nasl/nasl_cmd_exec.c: Fixed logic bug, fdopen returns NULL
+       on failure and not as the test was "!= FALSE".
+
 2008-10-12  Tim Brown <[EMAIL PROTECTED]>
 
        * nasl/nasl_cmd_exec.c: Fixed problem of TRUE not being defined.

Modified: trunk/openvas-libnasl/nasl/nasl_cmd_exec.c
===================================================================
--- trunk/openvas-libnasl/nasl/nasl_cmd_exec.c  2008-10-13 14:33:58 UTC (rev 
1536)
+++ trunk/openvas-libnasl/nasl/nasl_cmd_exec.c  2008-10-13 20:20:45 UTC (rev 
1537)
@@ -20,7 +20,6 @@
   * This file contains all the "unsafe" functions found in NASL
   */
 #include <includes.h>
-#include <glib.h>
 
 #include "nasl_tree.h"
 #include "nasl_global_ctxt.h"
@@ -278,7 +277,7 @@
     }
   }
   fp = fdopen(fd, "r");
-  if (fp != FALSE) {
+  if (fp == NULL) {
     close(fp);
     nasl_perror(lexic, "fread: %s: %s\n", fname, strerror(errno));
     return NULL;
@@ -411,7 +410,7 @@
     }
   }
   fp = fdopen(fd, "w");
-  if (fp != FALSE) {
+  if (fp == NULL) {
     close(fp);
     nasl_perror(lexic, "fread: %s: %s\n", fname, strerror(errno));
     return NULL;

_______________________________________________
Openvas-commits mailing list
[email protected]
http://lists.wald.intevation.org/mailman/listinfo/openvas-commits

Reply via email to