]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make wpa_hexdump_buf{,-key} handle NULL buffer
authorJouni Malinen <j@w1.fi>
Sun, 31 Oct 2010 10:09:18 +0000 (12:09 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 31 Oct 2010 10:09:18 +0000 (12:09 +0200)
This matches with behavior of other wpa_hexdump* functions.

src/utils/wpa_debug.h

index 9dace70f629686e8c261eed0e745477f7d201698..f2e86460c115a3264910bda47ee8d37fca561694 100644 (file)
@@ -81,7 +81,8 @@ void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
 static inline void wpa_hexdump_buf(int level, const char *title,
                                   const struct wpabuf *buf)
 {
-       wpa_hexdump(level, title, wpabuf_head(buf), wpabuf_len(buf));
+       wpa_hexdump(level, title, buf ? wpabuf_head(buf) : NULL,
+                   buf ? wpabuf_len(buf) : 0);
 }
 
 /**
@@ -102,7 +103,8 @@ void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len);
 static inline void wpa_hexdump_buf_key(int level, const char *title,
                                       const struct wpabuf *buf)
 {
-       wpa_hexdump_key(level, title, wpabuf_head(buf), wpabuf_len(buf));
+       wpa_hexdump_key(level, title, buf ? wpabuf_head(buf) : 0,
+                       buf ? wpabuf_len(buf) : 0);
 }
 
 /**