core: fix potential NULL pointer in function gui_color_emphasize

This commit is contained in:
Sebastien Helleu 2014-02-22 12:07:43 +01:00
parent c3c1a63ea8
commit 0110f81e88
2 changed files with 7 additions and 1 deletions

View File

@ -13,6 +13,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev)
* core: fix potential NULL pointer in function gui_color_emphasize
* core: use same return code and message in all commands when arguments are
wrong/missing
* core: add option "-beep" in command /print

View File

@ -615,7 +615,12 @@ gui_color_emphasize (const char *string,
int rc, length_search, length_emphasis, length_result;
int pos1, pos2, real_pos1, real_pos2, count_emphasis;
if (!string && !regex)
/* string is required */
if (!string)
return NULL;
/* search or regex is required */
if (!search && !regex)
return NULL;
color_emphasis = gui_color_get_custom ("emphasis");