projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b561be
)
When given oversized key, encrypt/decrypt corrupted
author
Bruce Momjian
<
[email protected]
>
Thu, 8 Nov 2001 15:56:58 +0000
(15:56 +0000)
committer
Bruce Momjian
<
[email protected]
>
Thu, 8 Nov 2001 15:56:58 +0000
(15:56 +0000)
memory. This fixes it. Also a free() was missing.
marko
contrib/pgcrypto/px.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/pgcrypto/px.c
b/contrib/pgcrypto/px.c
index 5f9f0834ad659c272060a2e2a7efe815f0ce2c2b..19253bac16fe8ba0db7e5e2c1b34ff16f47f2aa5 100644
(file)
--- a/
contrib/pgcrypto/px.c
+++ b/
contrib/pgcrypto/px.c
@@
-88,6
+88,8
@@
combo_init(PX_Combo * cx, const uint8 *key, uint klen,
memcpy(ivbuf, iv, ivlen);
}
+ if (klen > ks)
+ klen = ks;
keybuf = px_alloc(ks);
memset(keybuf, 0, ks);
memcpy(keybuf, key, klen);
@@
-96,6
+98,7
@@
combo_init(PX_Combo * cx, const uint8 *key, uint klen,
if (ivbuf)
px_free(ivbuf);
+ px_free(keybuf);
return err;
}