Fix Segfault for to be installed symlinks pointing to existing locations
authorFlorian Festi <ffesti@redhat.com>
Tue, 16 Jun 2009 15:37:40 +0000 (17:37 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Jul 2009 06:41:11 +0000 (09:41 +0300)
fixes rhbz#505777
(cherry picked from commit 1b9e6d7f48a68fd677c70d04c9a6bb4274cf7b9f)

lib/fprint.c

index e326215..5acf828 100644 (file)
@@ -310,10 +310,10 @@ void fpLookupSubdir(rpmFpHash symlinks, rpmFpHash fphash, fingerPrintCache fpc,
                   /* setup current_fp for the new path */
                   found = 1;
                   current_fp = *fp;
-                  if (!fp->subDir) {
-                    lensubDir = 0;
-                    currentsubdir = endsubdir = NULL;
-                    break;
+                  if (fp->subDir == NULL) {
+                    /* directory exists - no need to look for symlinks */
+                    rpmFpHashAddEntry(fphash, fp, ffi);
+                    return;
                   }
                   lensubDir = strlen(fp->subDir);
                   currentsubdir = xstrdup(fp->subDir);