Oops, refactoring error in commit 327701572ff912413ec9564d29d946b4ab21a9f3
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Sep 2012 07:40:18 +0000 (10:40 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Sep 2012 07:40:18 +0000 (10:40 +0300)
- sizeof() doesn't work very well for malloced arrays... not that it
  matters a whole lot, this isn't a path that will ever be executed
  afaict.

lib/fprint.c

index f370b37..3252048 100644 (file)
@@ -166,7 +166,7 @@ static int doLookupId(fingerPrintCache cache,
        if (realpath(".", cdnbuf) != NULL) {
            end = cdnbuf + strlen(cdnbuf);
            if (end[-1] != '/') *end++ = '/';
-           end = stpncpy(end, dirName, sizeof(cdnbuf) - (end - cdnbuf));
+           end = stpncpy(end, dirName, PATH_MAX - (end - cdnbuf));
            *end = '\0';
            (void)rpmCleanPath(cdnbuf); /* XXX possible /../ from concatenation */
            end = cdnbuf + strlen(cdnbuf);