From: Tobias Brunner Date: Mon, 27 May 2013 16:41:16 +0000 (+0200) Subject: Allow memwipe() to be called with NULL argument X-Git-Tag: 5.1.0dr1~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c480b5f4580ab97122a525e534a866bcf5843644;p=thirdparty%2Fstrongswan.git Allow memwipe() to be called with NULL argument --- diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h index c66c665e08..46eaf7b647 100644 --- a/src/libstrongswan/utils/utils.h +++ b/src/libstrongswan/utils/utils.h @@ -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);