]> arthur.barton.de Git - netatalk.git/commitdiff
Fixed a bug that could lead to segfaults.
authorsrittau <srittau>
Thu, 30 Aug 2001 00:06:41 +0000 (00:06 +0000)
committersrittau <srittau>
Thu, 30 Aug 2001 00:06:41 +0000 (00:06 +0000)
libatalk/util/getiface.c

index 1ea4f647b7c1cf9f0da3d6dbdabbd22f3911e23a..be054c99ea1c2b8f7c09f278bbc00530d0c6be8d 100644 (file)
@@ -48,6 +48,11 @@ static int addname(char **list, int *i, int *length, const char *name)
        
       if (!new) /* just break if we can't allocate anything */
        return -1;
+
+      /* copy the old list */
+      memcpy(new, list, *length);
+      list = new;
+      
       *length += IFACE_NUM;
     }