mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core: fix buffer overflow in function eval_string_range_chars
This commit is contained in:
@@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
|
||||
Bug fixes::
|
||||
|
||||
* core: fix buffer overflow in function eval_string_range_chars
|
||||
* core: fix buffer overflow in function eval_string_base_encode
|
||||
* core: fix integer overflow in function util_version_number
|
||||
* core: fix integer overflow in base32 encoding/decoding
|
||||
|
||||
@@ -299,6 +299,9 @@ eval_string_range_chars (const char *range)
|
||||
string = NULL;
|
||||
result = NULL;
|
||||
|
||||
if (!range || !range[0])
|
||||
goto end;
|
||||
|
||||
for (i = 0; eval_range_chars[i][0]; i++)
|
||||
{
|
||||
if (strcmp (range, eval_range_chars[i][0]) == 0)
|
||||
@@ -308,11 +311,15 @@ eval_string_range_chars (const char *range)
|
||||
char1 = utf8_char_int (range);
|
||||
|
||||
/* next char must be '-' */
|
||||
if (!range[0])
|
||||
goto end;
|
||||
ptr_char = utf8_next_char (range);
|
||||
if (!ptr_char || !ptr_char[0] || (ptr_char[0] != '-'))
|
||||
goto end;
|
||||
|
||||
/* next char is the char2 */
|
||||
if (!range[0])
|
||||
goto end;
|
||||
ptr_char = utf8_next_char (ptr_char);
|
||||
if (!ptr_char || !ptr_char[0])
|
||||
goto end;
|
||||
|
||||
Reference in New Issue
Block a user