From: Date: Mon, 18 Feb 2008 06:06:41 +0000 (+0530) Subject: Fix for if NULL is passed as a valid argument to memcached_behavior_set X-Git-Tag: 0.20~12 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=80592e910024f5f16caaf87f71ed51c4eb518c74;p=awesomized%2Flibmemcached Fix for if NULL is passed as a valid argument to memcached_behavior_set --- diff --git a/lib/memcached_behavior.c b/lib/memcached_behavior.c index 1e25390d..8c02a383 100644 --- a/lib/memcached_behavior.c +++ b/lib/memcached_behavior.c @@ -11,7 +11,12 @@ void set_behavior_flag(memcached_st *ptr, memcached_flags temp_flag, void *data) { - unsigned int truefalse= *(unsigned int *)data; + uint8_t truefalse; + + if (data) + truefalse= *(unsigned int *)data; + else + truefalse= 0; if (truefalse) ptr->flags|= temp_flag;