opkg: protect against NULL src
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 05:15:12 +0000 (05:15 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 05:15:12 +0000 (05:15 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@100 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg.c

index 9f63812320c6b4b71cb1ebb6b16d768f26c38b48..4320ab985dffaaef28a26069994a5a2b13211cb9 100644 (file)
@@ -61,7 +61,8 @@ old_pkg_to_new (pkg_t *old)
   new->name = sstrdup (old->name);
   new->version = pkg_version_str_alloc (old);
   new->architecture = sstrdup (old->architecture);
-  new->repository = sstrdup (old->src->name);
+  if (old->src)
+    new->repository = sstrdup (old->src->name);
   new->description = sstrdup (old->description);
   new->tags = sstrdup (old->tags);
   new->url = sstrdup (old->url);