[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#177061: broken Depends and Provides parsing



Package: libdebian-installer3
Version: 0.10
Tags: patch

Recent memory cleanups broke Depends and Provides parsing.  Please
apply the following patch.

Matt

diff -ur debian-installer.orig/libdebian-installer/debian-installer.c debian-installer/libdebian-installer/debian-installer.c
--- debian-installer.orig/libdebian-installer/debian-installer.c	2002-12-30 07:42:03.000000000 -0800
+++ debian-installer/libdebian-installer/debian-installer.c	2003-01-16 14:04:50.000000000 -0800
@@ -328,7 +328,7 @@
              * Basic depends line parser. Can ignore versioning
              * info since the depends are already satisfied.
              */
-            b = strchr(buf, ' ') + 1;
+            b = strdup(strchr(buf, ' ') + 1);
             i = 0;
             while (*b != 0 && *b != '\n')
             {
@@ -342,7 +342,7 @@
                     else if (p->depends[i] == 0)
                     {
                         dep = malloc(sizeof(struct package_dependency));
-                        dep->name = strdup(b);
+                        dep->name = b;
                         dep->ptr = NULL;
                         p->depends[i] = dep;
                     }
@@ -356,7 +356,7 @@
         }
         else if (di_stristr(buf, "Provides: ") == buf)
         {
-            b = strchr(buf, ' ') + 1;
+            b = strdup(strchr(buf, ' ') + 1);
             i = 0;
             while (*b != 0 && *b != '\n')
             {
@@ -370,7 +370,7 @@
                     else if (p->provides[i] == 0)
                     {
                         dep = malloc(sizeof(struct package_dependency));
-                        dep->name = strdup(b);
+                        dep->name = b;
                         dep->ptr = NULL;
                         p->provides[i] = dep;
                     }



Reply to: