Fix for if NULL is passed as a valid argument to memcached_behavior_set
author <brian@gir-2.local> <>
Mon, 18 Feb 2008 06:06:41 +0000 (11:36 +0530)
committer <brian@gir-2.local> <>
Mon, 18 Feb 2008 06:06:41 +0000 (11:36 +0530)
lib/memcached_behavior.c

index 1e25390d221db9e4e0da8558e9e17baa8aa33011..8c02a383d7e6b9abe313983d61f643cfcc3a4425 100644 (file)
 
 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;