Skip to content

Commit

Permalink
fix: loop or crash when too big width of y (space)
Browse files Browse the repository at this point in the history
Issue #104.
  • Loading branch information
moinejf committed Aug 31, 2021
1 parent 5a6b55f commit d880797
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions abcparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2362,11 +2362,16 @@ static char *parse_note(char *p,
p++;
if (isdigit((unsigned char) *p) /* number of points */
|| *p == '-') { /* accept negative offset... */
s->u.note.notes[0].shhd = strtol(p, &q, 10);
len = strtol(p, &q, 10);
if (len < -100 || len > 100) {
syntax("Bad width of y (space)", p);
len = 10;
}
p = q;
} else {
s->u.note.notes[0].shhd = 10; // default
len = 10; // default
}
s->u.note.notes[0].shhd = len;
goto add_deco;
case 'x': /* invisible rest */
s->flags |= ABC_F_INVIS;
Expand Down

0 comments on commit d880797

Please sign in to comment.