comparison src/xs_support.c @ 937:b31d420b7fee

Actually clear the whole xs_md5state_t structure, instead of incorrectly using sizeof(ctx) whereas sizeof(*ctx) should have been used.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Nov 2012 17:42:03 +0200
parents b928b8a9c5bf
children f8e1de328ac1
comparison
equal deleted inserted replaced
936:79f20427c99d 937:b31d420b7fee
421 memcpy(((guint32 *) ctx->in) + 15, &ctx->bits[1], sizeof(guint32)); 421 memcpy(((guint32 *) ctx->in) + 15, &ctx->bits[1], sizeof(guint32));
422 422
423 xs_md5_transform(ctx->buf, (guint32 *) ctx->in); 423 xs_md5_transform(ctx->buf, (guint32 *) ctx->in);
424 xs_md5_bytereverse((guint8 *) ctx->buf, 4); 424 xs_md5_bytereverse((guint8 *) ctx->buf, 4);
425 memcpy(digest, ctx->buf, 16); 425 memcpy(digest, ctx->buf, 16);
426 memset(ctx, 0, sizeof(ctx)); 426 memset(ctx, 0, sizeof(*ctx));
427 } 427 }
428 428
429 429
430 /* Copy a given string over in *result. 430 /* Copy a given string over in *result.
431 */ 431 */