From: Sebastian Dröge Date: Wed, 23 Nov 2016 16:26:29 +0000 (+0200) Subject: rtspdefs: Assert on the excepted MD5 digest string length X-Git-Tag: 1.12.2~296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e4697ec983d31bcae25cb7049afd306c3f09219;p=platform%2Fupstream%2Fgst-plugins-base.git rtspdefs: Assert on the excepted MD5 digest string length CID 1394494. --- diff --git a/gst-libs/gst/rtsp/gstrtspdefs.c b/gst-libs/gst/rtsp/gstrtspdefs.c index c00e320..fa1fd05 100644 --- a/gst-libs/gst/rtsp/gstrtspdefs.c +++ b/gst-libs/gst/rtsp/gstrtspdefs.c @@ -543,7 +543,8 @@ auth_digest_compute_response_md5 (const gchar * method, const gchar * realm, g_checksum_update (md5_context, (const guchar *) ":", 1); g_checksum_update (md5_context, (const guchar *) password, strlen (password)); digest_string = g_checksum_get_string (md5_context); - memcpy (hex_a1, digest_string, strlen (digest_string)); + g_assert (strlen (digest_string) == 32); + memcpy (hex_a1, digest_string, 32); g_checksum_reset (md5_context); /* compute A2 */ @@ -551,7 +552,8 @@ auth_digest_compute_response_md5 (const gchar * method, const gchar * realm, g_checksum_update (md5_context, (const guchar *) ":", 1); g_checksum_update (md5_context, (const guchar *) uri, strlen (uri)); digest_string = g_checksum_get_string (md5_context); - memcpy (hex_a2, digest_string, strlen (digest_string)); + g_assert (strlen (digest_string) == 32); + memcpy (hex_a2, digest_string, 32); /* compute KD */ g_checksum_reset (md5_context);