Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaffd38e

Browse files
pgcrypto: Remove static storage class from variables
Variables p, sp and ep were labeled with static storage classbut are all assigned before use so they cannot carry any dataacross calls. Fix by removing the static label.Also while in there, make the magic variable const as it willnever change.Author: Japin Li <japinli@hotmail.com>Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/ME0P300MB0445096B67ACE8CE25772F00B6F72@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM
1 parent9e02005 commitaffd38e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎contrib/pgcrypto/crypt-md5.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ _crypt_to64(char *s, unsigned long v, int n)
3333
char*
3434
px_crypt_md5(constchar*pw,constchar*salt,char*passwd,unsigneddstlen)
3535
{
36-
staticchar*magic="$1$";/* This string is magic for this algorithm.
37-
* Having it this way, we can get better later
38-
* on */
39-
staticchar*p;
40-
staticconstchar*sp,
36+
staticconstchar*magic="$1$";/* This string is magic for this
37+
*algorithm.Having it this way, we
38+
* can get better later on */
39+
char*p;
40+
constchar*sp,
4141
*ep;
4242
unsignedcharfinal[MD5_SIZE];
4343
intsl,
@@ -81,7 +81,7 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
8181
px_md_update(ctx, (constuint8*)pw,strlen(pw));
8282

8383
/* Then our magic string */
84-
px_md_update(ctx, (uint8*)magic,strlen(magic));
84+
px_md_update(ctx, (constuint8*)magic,strlen(magic));
8585

8686
/* Then the raw salt */
8787
px_md_update(ctx, (constuint8*)sp,sl);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp