[libdmapsharing] Fix clang warning
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing] Fix clang warning
- Date: Wed, 30 Oct 2013 01:47:54 +0000 (UTC)
commit 28d26ba51dac6565a796a4e2c68ad28f89af398f
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 29 11:42:31 2013 +0100
Fix clang warning
dmap-md5.c:187:26: warning: 'memset' call operates on objects of type 'MD5_CTX'
while the size is based on a different
type 'MD5_CTX *' [-Wsizeof-pointer-memaccess]
memset (ctx, 0, sizeof (ctx)); /* In case it's sensitive */
~~~ ^~~
That should be "sizeof(*ctx)" instead.
See https://bugzilla.redhat.com/show_bug.cgi?id=1023528
https://bugzilla.gnome.org/show_bug.cgi?id=711063
libdmapsharing/dmap-md5.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libdmapsharing/dmap-md5.c b/libdmapsharing/dmap-md5.c
index 4472472..c646d6c 100644
--- a/libdmapsharing/dmap-md5.c
+++ b/libdmapsharing/dmap-md5.c
@@ -176,7 +176,7 @@ DMAP_MD5Final (DMAPHashContext * ctx, unsigned char digest[16])
MD5Transform (ctx->buf, (guint32 *) ctx->in, ctx->version);
byteReverse ((unsigned char *) ctx->buf, 4);
memcpy (digest, ctx->buf, 16);
- memset (ctx, 0, sizeof (ctx)); /* In case it's sensitive */
+ memset (ctx, 0, sizeof (*ctx)); /* In case it's sensitive */
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]