[Olsr-dev] [PATCH] p2pd: fix uninitialised pointer for first nonOlsrInterface

Ferry Huberts (spam-protected)
Tue Mar 1 12:13:19 CET 2011


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---

I've just pushed this patch into the stable branch.
It prevents random crashes of the p2pd plugin.


 lib/p2pd/src/NetworkInterfaces.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/p2pd/src/NetworkInterfaces.c b/lib/p2pd/src/NetworkInterfaces.c
index 99206ce..fa59d56 100644
--- a/lib/p2pd/src/NetworkInterfaces.c
+++ b/lib/p2pd/src/NetworkInterfaces.c
@@ -274,6 +274,7 @@ CreateInterface(const char *ifName, struct interface *olsrIntf)
    * added at the front of the list, non-OLSR interfaces at the back. */
   if (nonOlsrInterfaces == NULL) {
     /* First NonOlsrInterface object in list */
+    newIf->next = NULL;
     nonOlsrInterfaces = newIf;
     lastNonOlsrInterface = newIf;
   } else if (olsrIntf != NULL) {
-- 
1.7.4





More information about the Olsr-dev mailing list