From: James Antill <[email protected]>

---
 build/parseReqs.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/build/parseReqs.c b/build/parseReqs.c
index 36db460..609d379 100644
--- a/build/parseReqs.c
+++ b/build/parseReqs.c
@@ -40,6 +40,7 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char 
*field, rpmTagVal tagN,
 {
     const char *r, *re, *v, *ve;
     const char *emsg = NULL;
+    const char *sep = NULL;
     char * N = NULL, * EVR = NULL;
     rpmTagVal nametag = RPMTAG_NOT_FOUND;
     rpmsenseFlags Flags;
@@ -154,6 +155,22 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char 
*field, rpmTagVal tagN,
            EVR = xmalloc((ve-v) + 1);
            rstrlcpy(EVR, v, (ve-v) + 1);
            if (rpmCharCheck(spec, EVR, ve-v, ".-_+:%{}~")) goto exit;
+
+            /* While ':' and '-' are valid, only one of each is valid. */
+            sep = strchr(EVR, '-');
+            if (sep && strchr(sep+1, '-')) {
+                rpmlog(RPMLOG_ERR, _("line %d: Double separator '%c' in: 
%s\n"),
+                       spec->lineNum, '-', spec->line);
+                goto exit;
+            }
+
+            sep = strchr(EVR, ':');
+            if (sep && strchr(sep+1, ':')) {
+                rpmlog(RPMLOG_ERR, _("line %d: Double separator '%c' in: 
%s\n"),
+                       spec->lineNum, ':', spec->line);
+                goto exit;
+            }
+
            re = ve;    /* ==> next token after EVR string starts here */
        } else
            EVR = NULL;
-- 
1.7.7.6

_______________________________________________
Rpm-maint mailing list
[email protected]
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to