summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-02-22 12:07:43 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-02-22 12:07:43 +0100
commit0110f81e8896c7a1f57d3f62f190f6dd7d87fe90 (patch)
tree09de8dbce340ea0df0dbd43ba24b1543609a0da1 /src
parentc3c1a63ea82d1026670cd9a8a94adfaf2d3503b5 (diff)
downloadweechat-0110f81e8896c7a1f57d3f62f190f6dd7d87fe90.zip
core: fix potential NULL pointer in function gui_color_emphasize
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui-color.c7
1 files changed, 6 insertions, 1 deletions
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");