summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-08-10 13:42:48 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-08-10 13:42:48 +0200
commit068776b5a7b274bfacdb7c9152feeec65a65290b (patch)
treea91a5a95126bf0736e64b795a95a2bc8ed586d51 /src
parentccf18f4bf64bb20fb80b8d16781c21a9fbde5f96 (diff)
downloadweechat-068776b5a7b274bfacdb7c9152feeec65a65290b.zip
core: fix zero-length malloc of an hashtable item with type "buffer"
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-hashtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/wee-hashtable.c b/src/core/wee-hashtable.c
index 9ec9546b7..b18666fe9 100644
--- a/src/core/wee-hashtable.c
+++ b/src/core/wee-hashtable.c
@@ -270,7 +270,7 @@ hashtable_alloc_type (enum t_hashtable_type type,
*size = sizeof (void *);
break;
case HASHTABLE_BUFFER:
- if (value)
+ if (value && (size_value > 0))
{
*pointer = malloc (size_value);
if (*pointer)