]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
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 c66c665e08cac6873563b71b15d89323d60b9497..46eaf7b647c3d4421d3e83a197b9a3fdd18ea34a 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);