Skip to content

Commit

Permalink
fix: Added check for empty subfeature that could cause memory read-pa…
Browse files Browse the repository at this point in the history
…st-end
  • Loading branch information
Gregungory committed Apr 5, 2024
1 parent 1065f52 commit 425d236
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rt/renderopts.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: renderopts.c,v 2.25 2024/04/05 17:52:20 greg Exp $";
static const char RCSid[] = "$Id: renderopts.c,v 2.26 2024/04/05 17:55:25 greg Exp $";
#endif
/*
* renderopts.c - process common rendering options
Expand Down Expand Up @@ -75,7 +75,8 @@ match_subfeatures( /* check if subfeatures are supported */
while (*reqs && (*cp = *reqs++) != ',')
cp++;
*cp = '\0';
n = cp - subfeat;
if (!(n = cp - subfeat))
continue; /* empty subfeature */
for (cp = mysublist; (cp = strstr(cp, subfeat)) != NULL; cp++)
if ((cp[-1] == ',') | (cp[-1] == '=') &&
(cp[n] == ',') | (cp[n] == '\n'))
Expand Down

0 comments on commit 425d236

Please sign in to comment.