Package: smcroute
Version: 0.95-1
Severity: important
Tags: patch

Dear Maintainer,

   * What led up to the situation?
        I use smcroute to route over vtun interfaces. After upgrade from 
squeeze to wheezy, it segfaults when there are vtun interfaces active.
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
        Patch smcroute to not deref a NULL-pointer. The first run, the 
ifa->ifa_addr is NULL, but it seems to call the function twice, and the second 
time the field is set, so in the end it works fine.
   * What was the outcome of this action?
        smcroute does not segfault anymore
   * What outcome did you expect instead?

Please find attached a patch to fix a NULL-pointer dereference. The manpage for 
struct ifaddr says explicitly that ifa_addr can be NULL, so that should be 
checked.


-- System Information:
Debian Release: 7.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=UTF-8 (charmap=locale: Cannot set LC_CTYPE 
to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages smcroute depends on:
ii  libc6  2.13-38

smcroute recommends no packages.

smcroute suggests no packages.

-- Configuration Files:
/etc/smcroute/startup.sh changed [not included]

-- debconf information excluded
--- ifvc.orig.c	2013-05-11 12:07:49.000000000 +0200
+++ ifvc.c	2013-05-11 12:06:51.000000000 +0200
@@ -50,7 +50,8 @@
   }
 
   for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
-    int family = ifa->ifa_addr->sa_family;
+    int family = 0;
+    if(ifa->ifa_addr) family  = ifa->ifa_addr->sa_family;
 
     /* Skip non-IPv4 and non-IPv6 interfaces */
     if ((family != AF_INET) && (family != AF_INET6)) continue;

Reply via email to