Skip to content

Commit

Permalink
gsf: check str len of string list property
Browse files Browse the repository at this point in the history
ossfuzz issue 68297
  • Loading branch information
aureliendavid committed May 13, 2024
1 parent 789bf66 commit 322bb25
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/filters/dmx_gsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,16 @@ static GF_Err gsfdmx_read_prop(GF_BitStream *bs, GF_PropertyValue *p)
p->value.string_list.vals = gf_malloc(sizeof(char*) * len2);
for (i=0; i<len2; i++) {
len = gsfdmx_read_vlen(bs);
if (len >= GF_UINT_MAX-1) {
for (u32 j=0; j<i; j++) {
gf_free(p->value.string_list.vals[j]);
p->value.string_list.vals[j] = NULL;
}
p->value.string_list.nb_items = 0;
gf_free(p->value.string_list.vals);
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[GSFDemux] invalid string length in string list property\n"));
return GF_NON_COMPLIANT_BITSTREAM;
}
char *str = gf_malloc(sizeof(char)*(len+1));
gf_bs_read_data(bs, str, len);
str[len] = 0;
Expand Down

0 comments on commit 322bb25

Please sign in to comment.