If the line contains no location info and a comma in a comment, what
follows the comma will be interpreted as location info. Actually ignore
what's in comments by adjusting the line length.

Index: geofeed.c
===================================================================
RCS file: /cvs/src/usr.sbin/rpki-client/geofeed.c,v
retrieving revision 1.8
diff -u -p -r1.8 geofeed.c
--- geofeed.c   14 Dec 2022 10:45:34 -0000      1.8
+++ geofeed.c   22 Dec 2022 10:18:45 -0000
@@ -198,8 +198,10 @@ geofeed_parse(X509 **x509, const char *f
 
                /* zap comments */
                delim = memchr(line, '#', linelen);
-               if (delim != NULL)
+               if (delim != NULL) {
                        *delim = '\0';
+                       linelen = delim - line;
+               }
 
                /* Split prefix and location info */
                delim = memchr(line, ',', linelen);

Reply via email to