]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-39621: Make buf arg to md5_compress be const. (GH-18497)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 13 Feb 2020 05:12:53 +0000 (21:12 -0800)
committerGitHub <noreply@github.com>
Thu, 13 Feb 2020 05:12:53 +0000 (21:12 -0800)
(cherry picked from commit 597ebed748d0b0c061f8c108bd98270d103286c1)

Co-authored-by: Andy Lester <andy@petdance.com>
Modules/md5module.c

index b9a351a8c1cdd28f49a8cd7b2f85c96911d23bcc..c2ebaaf61f91c6926d6170a85ab69df6805c03a4 100644 (file)
@@ -119,7 +119,7 @@ typedef struct {
     a = (a + I(b,c,d) + M + t); a = ROLc(a, s) + b;
 
 
-static void md5_compress(struct md5_state *md5, unsigned char *buf)
+static void md5_compress(struct md5_state *md5, const unsigned char *buf)
 {
     MD5_INT32 i, W[16], a, b, c, d;
 
@@ -242,7 +242,7 @@ md5_process(struct md5_state *md5, const unsigned char *in, Py_ssize_t inlen)
 
     while (inlen > 0) {
         if (md5->curlen == 0 && inlen >= MD5_BLOCKSIZE) {
-           md5_compress(md5, (unsigned char *)in);
+           md5_compress(md5, in);
            md5->length    += MD5_BLOCKSIZE * 8;
            in             += MD5_BLOCKSIZE;
            inlen          -= MD5_BLOCKSIZE;