Index: rpmio/rpmio.c =================================================================== --- rpmio/rpmio.c.orig +++ rpmio/rpmio.c @@ -1576,8 +1576,8 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n" if (stdio[0] == '\0') return NULL; zstdio[0] = '\0'; - strncat(zstdio, stdio, sizeof(zstdio) - strlen(zstdio)); - strncat(zstdio, other, sizeof(zstdio) - strlen(zstdio)); + strncat(zstdio, stdio, sizeof(zstdio) - strlen(zstdio) - 1); + strncat(zstdio, other, sizeof(zstdio) - strlen(zstdio) - 1); if (end == NULL && other[0] == '\0') return fd; Index: lib/signature.c =================================================================== --- lib/signature.c.orig +++ lib/signature.c @@ -5,6 +5,7 @@ #include "system.h" #include +#include #include #include