Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
gf_text_get_utf8_line: add dest buffer len check (fixes #2647)
  • Loading branch information
aureliendavid committed Oct 17, 2023
1 parent d2de8b5 commit d0ced41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/filters/load_text.c
Expand Up @@ -377,6 +377,10 @@ char *gf_text_get_utf8_line(char *szLine, u32 lineSize, FILE *txt_in, s32 unicod
GF_LOG(GF_LOG_DEBUG, GF_LOG_PARSER, ("[TXTIn] Line too long to convert to utf8 (len: %d)\n", len));
j = GF_ARRAY_LENGTH(szLineConv) -1 ;
}
if ( j >= lineSize ) {
GF_LOG(GF_LOG_DEBUG, GF_LOG_PARSER, ("[TXTIn] UT8 converted line too long for buffer (len: %d, buffer: %d)\n", j, lineSize));
j = lineSize-1 ;
}
szLineConv[j] = 0;
strcpy(szLine, szLineConv);
return sOK;
Expand Down

0 comments on commit d0ced41

Please sign in to comment.