Blob Blame History Raw
commit e78a4bc9a921f597224af07def876ba18b8733c5
Author: Thomas Woerner <twoerner@redhat.com>
Date:   Tue Oct 25 12:40:45 2016 +0200

    Fix segmentation fault if used with the options -1 -C
    
    Curses is not used with the "-1" single option, but c_warn is used if
    counters are not enabled in the kernel and "-C" option is given.
    
    Fixes: RHBZ#599181

diff --git a/iptstate.cc b/iptstate.cc
index 5874605..b4b6108 100644
--- a/iptstate.cc
+++ b/iptstate.cc
@@ -2407,7 +2407,10 @@ int main(int argc, char *argv[])
       prompt = "Counters requested, but not enabled in the";
       prompt += " kernel!";
       flags.counters = 0;
-      c_warn(mainwin, prompt, flags);
+      if (flags.single)
+	  cerr << prompt << endl;
+      else
+	  c_warn(mainwin, prompt, flags);
     }
 
     // Sort our table