Переглянути джерело

libdpkg: Blank the whole MD5 context not just the size of a pointer

The memset was using the size of the context pointer and not the actual
size of the struct.

Spotted-by: Jochen Voss <voss@seehuhn.de> (on util-linux-ng)
Guillem Jover 16 роки тому
батько
коміт
12416df9a1
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      lib/dpkg/md5.c

+ 1 - 1
lib/dpkg/md5.c

@@ -134,7 +134,7 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx)
 
 	byteSwap(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 */
 }
 
 #ifndef ASM_MD5