summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/gui/gui-color.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index eac059a01..10b859aed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c
index 0971f6d76..13b4ea8ff 100644
--- a/src/gui/gui-color.c
+++ b/src/gui/gui-color.c
@@ -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");