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

Commitb527ebc

Browse files
pgcrypto: Fix check for buffer size
The code copying the PGP block into the temp buffer failed toaccount for the extra 2 bytes in the buffer which are neededfor the prefix. If the block was oversized, subsequent checksof the prefix would have exceeded the buffer size. Since theblock sizes are hardcoded in the list of supported ciphers itcan be verified that there is no live bug here. Backpatch allthe way for consistency though, as this bug is old.Author: Mikhail Gribkov <youzhick@gmail.com>Discussion:https://postgr.es/m/CAMEv5_uWvcMCMdRFDsJLz2Q8g16HEa9xWyfrkr+FYMMFJhawOw@mail.gmail.comBackpatch-through: v12
1 parent4c48c0f commitb527ebc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎contrib/pgcrypto/pgp-decrypt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ prefix_init(void **priv_p, void *arg, PullFilter *src)
250250
uint8tmpbuf[PGP_MAX_BLOCK+2];
251251

252252
len=pgp_get_cipher_block_size(ctx->cipher_algo);
253-
if (len>sizeof(tmpbuf))
253+
/* Make sure we have space for prefix */
254+
if (len>PGP_MAX_BLOCK)
254255
returnPXE_BUG;
255256

256257
res=pullf_read_max(src,len+2,&buf,tmpbuf);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp