summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2019-10-29 09:59:23 +0200
committerPanu Matilainen <pmatilai@redhat.com>2019-11-18 12:46:29 +0200
commitb0c354e642921dfccba535576b7d3c6d895957f9 (patch)
tree593321a2d5407543fa6d6907a0422c43c3285817
parentd93597e231223acc742a23031c01f7816f5d4698 (diff)
downloadrpm-b0c354e642921dfccba535576b7d3c6d895957f9.tar.gz
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... (cherry picked from commit 63930cd5244bd646d226b73dd43a2a3e681c58ad)
-rw-r--r--lib/manifest.c3
1 files changed, 2 insertions, 1 deletions
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);