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

Commit149d13d

Browse files
committed
When given oversized key, encrypt/decrypt corrupted
memory. This fixes it. Also a free() was missing.marko
1 parent7e16f3c commit149d13d

File tree

1 file changed

+4
-1
lines changed
  • contrib/pgcrypto

1 file changed

+4
-1
lines changed

‎contrib/pgcrypto/px.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: px.c,v 1.3 2001/10/25 05:49:20 momjian Exp $
29+
* $Id: px.c,v 1.4 2001/11/08 15:56:58 momjian Exp $
3030
*/
3131

3232
#include<postgres.h>
@@ -88,6 +88,8 @@ combo_init(PX_Combo * cx, const uint8 *key, uint klen,
8888
memcpy(ivbuf,iv,ivlen);
8989
}
9090

91+
if (klen>ks)
92+
klen=ks;
9193
keybuf=px_alloc(ks);
9294
memset(keybuf,0,ks);
9395
memcpy(keybuf,key,klen);
@@ -96,6 +98,7 @@ combo_init(PX_Combo * cx, const uint8 *key, uint klen,
9698

9799
if (ivbuf)
98100
px_free(ivbuf);
101+
px_free(keybuf);
99102

100103
returnerr;
101104
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp