http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2015-November/thread.html#24537 --- rpm-5.4.15.orig/rpmio/macro.c 2015-11-28 20:47:15.000000000 +0100 +++ rpm-5.4.15/rpmio/macro.c 2015-11-28 20:51:05.634724202 +0100 @@ -706,7 +706,9 @@ FILE *shf; int rc; int c; + char * start; + start = mb->t; strncpy(buf, cmd, clen); buf[clen] = '\0'; rc = expandU(mb, buf, bufn); @@ -720,7 +722,7 @@ (void) pclose(shf); /* XXX delete trailing \r \n */ - while (iseol(mb->t[-1])) { + while (mb->t > start && iseol(mb->t[-1])) { *(mb->t--) = '\0'; mb->nb++; }