From 63930cd5244bd646d226b73dd43a2a3e681c58ad Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 29 Oct 2019 09:59:23 +0200 Subject: [PATCH] Only permit comments at beginning of line in file manifests (RhBug:112727) We only permit comments at beginning of line in specs and macro files too, of all things file manifests don't need anything fancier. Resolves the oldest rpm bug in RH bugzilla, only took 16 years... --- lib/manifest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/manifest.c b/lib/manifest.c index e6289b82f..eba108885 100644 --- a/lib/manifest.c +++ b/lib/manifest.c @@ -84,7 +84,8 @@ rpmRC rpmReadPackageManifest(FD_t fd, int * argcPtr, char *** argvPtr) } /* Skip comments. */ - if ((se = strchr(s, '#')) != NULL) *se = '\0'; + if (*s == '#') + continue; /* Trim white space. */ se = s + strlen(s);