Skip to content

Commit

Permalink
db_text: prevent buffer overflow
Browse files Browse the repository at this point in the history
Fixes Coverity CID #200093
  • Loading branch information
razvancrainea committed Jul 20, 2020
1 parent c460787 commit 3b0cc62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/db_text/dbt_file.c
Expand Up @@ -167,12 +167,13 @@ dbt_table_p dbt_load_file(const str *tbn, const str *dbn)
{
if(c==EOF)
goto clean;
buf[bp++] = c;
if (bp==4096) {
LM_ERR("Buffer overflow for file [%s] row=[%d] col=[%d] c=[%c]."
" Required buffer size greater then 4096!\n",
path, crow+1, ccol+1, c);
goto clean;
}
buf[bp++] = c;
c = fgetc(fin);
}
colp = dbt_column_new(buf, bp);
Expand Down

0 comments on commit 3b0cc62

Please sign in to comment.