diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2017-01-24 05:41:05 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2017-01-24 05:41:05 +0000 |
commit | 377a01b2a7f9df963c0501eab30df7f8c64686f4 (patch) | |
tree | 7c01fd85b264260a8e5b9d44bc55bacc49209f66 /pjlib-util/src/pjlib-util/md5.c | |
parent | e4275a54cfd41a3d0f107f18130de3b780a17aac (diff) |
Misc (re #1945): Fixed compile warnings on Android 64bit platforms, e.g: dereferencing type-punned pointer, using uninitialized var.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5544 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib-util/src/pjlib-util/md5.c')
-rw-r--r-- | pjlib-util/src/pjlib-util/md5.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pjlib-util/src/pjlib-util/md5.c b/pjlib-util/src/pjlib-util/md5.c index 45aee07d..7f393069 100644 --- a/pjlib-util/src/pjlib-util/md5.c +++ b/pjlib-util/src/pjlib-util/md5.c @@ -151,8 +151,10 @@ PJ_DEF(void) pj_md5_final(pj_md5_context *ctx, unsigned char digest[16]) byteReverse(ctx->in, 14); /* Append length in bits and transform */ - ((pj_uint32_t *) ctx->in)[14] = ctx->bits[0]; - ((pj_uint32_t *) ctx->in)[15] = ctx->bits[1]; + //((pj_uint32_t *) ctx->in)[14] = ctx->bits[0]; + //((pj_uint32_t *) ctx->in)[15] = ctx->bits[1]; + pj_memcpy(&ctx->in[14 << 2], &ctx->bits[0], sizeof(ctx->bits[0])); + pj_memcpy(&ctx->in[15 << 2], &ctx->bits[1], sizeof(ctx->bits[1])); MD5Transform(ctx->buf, (pj_uint32_t *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); |