Skip to contentSkip to conversation

Fix small bug in nfnl_subsys_open (uninitialized values)

PATCH Applied Victor Stinner 2 participants 2 messages Dec 28, 2006 – Dec 29, 2006 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,

I found a bug in libnfnetlink, function nfnl_subsys_open(). I attached a patch to fix it.

The problem is that callback structures weren't initialized. So sometimes, bytes are nul, sometimes... not.

Victor Stinner
http://www.inl.fr/

libnfnetlink.c +1 -1
Index: src/libnfnetlink.c
===================================================================
@@ -244,7 +244,7 @@
 		return NULL;
 	}
 
-	ssh->cb = malloc(sizeof(*(ssh->cb)) * cb_count);
+	ssh->cb = calloc(cb_count, sizeof(*(ssh->cb)));
 	if (!ssh->cb)
 		return NULL;
 
maintainer Applied
#1 lore raw
Quoted 5 lines · Victor Stinner

I found a bug in libnfnetlink, function nfnl_subsys_open(). I attached a patch to fix it.

The problem is that callback structures weren't initialized. So sometimes, bytes are nul, sometimes... not.

Applied, thanks Victor.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris