Allow memwipe() to be called with NULL argument
authorTobias Brunner <tobias@strongswan.org>
Mon, 27 May 2013 16:41:16 +0000 (18:41 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 27 May 2013 16:41:16 +0000 (18:41 +0200)
src/libstrongswan/utils/utils.h

index c66c665..46eaf7b 100644 (file)
@@ -423,6 +423,10 @@ static inline void memwipe_inline(void *ptr, size_t n)
  */
 static inline void memwipe(void *ptr, size_t n)
 {
+       if (!ptr)
+       {
+               return;
+       }
        if (__builtin_constant_p(n))
        {
                memwipe_inline(ptr, n);