All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iptables-restore -c faults if there are no counters
@ 2004-02-26 14:14 Thomas Woerner
  0 siblings, 0 replies; only message in thread
From: Thomas Woerner @ 2004-02-26 14:14 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]


Hello,


the function parse_counters does not check the input string and is producing a 
fault if it is NULL.


Thanks,
Thomas

-- 
Thomas Woerner, Software Engineer      Phone: +49-711-96437-0
Red Hat GmbH                           Fax  : +49-711-96437-111
Hauptstaetterstr. 58                   Email: twoerner@redhat.com
D-70178 Stuttgart                      Web  : http://www.redhat.de/

[-- Attachment #2: iptables-1.2.9-counters.patch --]
[-- Type: text/x-patch, Size: 474 bytes --]

--- iptables-1.2.9/iptables-restore.c.counters	2004-02-26 14:52:48.110211624 +0100
+++ iptables-1.2.9/iptables-restore.c	2004-02-26 15:10:24.495616632 +0100
@@ -71,7 +71,11 @@
 
 int parse_counters(char *string, struct ipt_counters *ctr)
 {
-	return (sscanf(string, "[%llu:%llu]", &ctr->pcnt, &ctr->bcnt) == 2);
+	if (string != NULL)
+		return (sscanf(string, "[%llu:%llu]", &ctr->pcnt, &ctr->bcnt)
+			== 2);
+	else
+		return (0 == 2);
 }
 
 /* global new argv and argc */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-26 14:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-26 14:14 [PATCH] iptables-restore -c faults if there are no counters Thomas Woerner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.