textbufferserialize: reject sections whose length is negative or runs past the data, instead of hanging or reading beyond it
This commit is contained in:
parent
07d46a2c76
commit
d0f4c65e17
1 changed files with 3 additions and 1 deletions
|
|
@ -1746,7 +1746,9 @@ read_headers (const gchar *start,
|
|||
{
|
||||
section_len = read_int ((const guchar *) start + i + 26);
|
||||
|
||||
if (i + 30 + section_len > len)
|
||||
/* a length below zero would go back, and one past the end
|
||||
* would overflow the sum */
|
||||
if (section_len < 0 || section_len > len - i - 30)
|
||||
goto error;
|
||||
|
||||
header = g_new0 (Header, 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue