mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Use wrappers of PG_DETOAST_DATUM_PACKED() more.
This makes almost all core code follow the policy introduced in the previous commit. Specific decisions: - Text search support functions with char* and length arguments, such as prsstart and lexize, may receive unaligned strings. I doubt maintainers of non-core text search code will notice. - Use plain VARDATA() on values detoasted or synthesized earlier in the same function. Use VARDATA_ANY() on varlenas sourced outside the function, even if they happen to always have four-byte headers. As an exception, retain the universal practice of using VARDATA() on return values of SendFunctionCall(). - Retain PG_GETARG_BYTEA_P() in pageinspect. (Page images are too large for a one-byte header, so this misses no optimization.) Sites that do not call get_page_from_raw() typically need the four-byte alignment. - For now, do not change btree_gist. Its use of four-byte headers in memory is partly entangled with storage of 4-byte headers inside GBT_VARKEY, on disk. - For now, do not change gtrgm_consistent() or gtrgm_distance(). They incorporate the varlena header into a cache, and there are multiple credible implementation strategies to consider.
This commit is contained in:
@ -62,7 +62,7 @@ pg_digest(PG_FUNCTION_ARGS)
|
||||
PX_MD *md;
|
||||
bytea *res;
|
||||
|
||||
name = PG_GETARG_TEXT_P(1);
|
||||
name = PG_GETARG_TEXT_PP(1);
|
||||
|
||||
/* will give error if fails */
|
||||
md = find_provider(name, (PFN) px_find_digest, "Digest", 0);
|
||||
@ -72,10 +72,10 @@ pg_digest(PG_FUNCTION_ARGS)
|
||||
res = (text *) palloc(hlen + VARHDRSZ);
|
||||
SET_VARSIZE(res, hlen + VARHDRSZ);
|
||||
|
||||
arg = PG_GETARG_BYTEA_P(0);
|
||||
len = VARSIZE(arg) - VARHDRSZ;
|
||||
arg = PG_GETARG_BYTEA_PP(0);
|
||||
len = VARSIZE_ANY_EXHDR(arg);
|
||||
|
||||
px_md_update(md, (uint8 *) VARDATA(arg), len);
|
||||
px_md_update(md, (uint8 *) VARDATA_ANY(arg), len);
|
||||
px_md_finish(md, (uint8 *) VARDATA(res));
|
||||
px_md_free(md);
|
||||
|
||||
@ -100,7 +100,7 @@ pg_hmac(PG_FUNCTION_ARGS)
|
||||
PX_HMAC *h;
|
||||
bytea *res;
|
||||
|
||||
name = PG_GETARG_TEXT_P(2);
|
||||
name = PG_GETARG_TEXT_PP(2);
|
||||
|
||||
/* will give error if fails */
|
||||
h = find_provider(name, (PFN) px_find_hmac, "HMAC", 0);
|
||||
@ -110,13 +110,13 @@ pg_hmac(PG_FUNCTION_ARGS)
|
||||
res = (text *) palloc(hlen + VARHDRSZ);
|
||||
SET_VARSIZE(res, hlen + VARHDRSZ);
|
||||
|
||||
arg = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
len = VARSIZE(arg) - VARHDRSZ;
|
||||
klen = VARSIZE(key) - VARHDRSZ;
|
||||
arg = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
len = VARSIZE_ANY_EXHDR(arg);
|
||||
klen = VARSIZE_ANY_EXHDR(key);
|
||||
|
||||
px_hmac_init(h, (uint8 *) VARDATA(key), klen);
|
||||
px_hmac_update(h, (uint8 *) VARDATA(arg), len);
|
||||
px_hmac_init(h, (uint8 *) VARDATA_ANY(key), klen);
|
||||
px_hmac_update(h, (uint8 *) VARDATA_ANY(arg), len);
|
||||
px_hmac_finish(h, (uint8 *) VARDATA(res));
|
||||
px_hmac_free(h);
|
||||
|
||||
@ -228,20 +228,20 @@ pg_encrypt(PG_FUNCTION_ARGS)
|
||||
klen,
|
||||
rlen;
|
||||
|
||||
type = PG_GETARG_TEXT_P(2);
|
||||
type = PG_GETARG_TEXT_PP(2);
|
||||
c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
dlen = VARSIZE(data) - VARHDRSZ;
|
||||
klen = VARSIZE(key) - VARHDRSZ;
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
dlen = VARSIZE_ANY_EXHDR(data);
|
||||
klen = VARSIZE_ANY_EXHDR(key);
|
||||
|
||||
rlen = px_combo_encrypt_len(c, dlen);
|
||||
res = palloc(VARHDRSZ + rlen);
|
||||
|
||||
err = px_combo_init(c, (uint8 *) VARDATA(key), klen, NULL, 0);
|
||||
err = px_combo_init(c, (uint8 *) VARDATA_ANY(key), klen, NULL, 0);
|
||||
if (!err)
|
||||
err = px_combo_encrypt(c, (uint8 *) VARDATA(data), dlen,
|
||||
err = px_combo_encrypt(c, (uint8 *) VARDATA_ANY(data), dlen,
|
||||
(uint8 *) VARDATA(res), &rlen);
|
||||
px_combo_free(c);
|
||||
|
||||
@ -277,20 +277,20 @@ pg_decrypt(PG_FUNCTION_ARGS)
|
||||
klen,
|
||||
rlen;
|
||||
|
||||
type = PG_GETARG_TEXT_P(2);
|
||||
type = PG_GETARG_TEXT_PP(2);
|
||||
c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
dlen = VARSIZE(data) - VARHDRSZ;
|
||||
klen = VARSIZE(key) - VARHDRSZ;
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
dlen = VARSIZE_ANY_EXHDR(data);
|
||||
klen = VARSIZE_ANY_EXHDR(key);
|
||||
|
||||
rlen = px_combo_decrypt_len(c, dlen);
|
||||
res = palloc(VARHDRSZ + rlen);
|
||||
|
||||
err = px_combo_init(c, (uint8 *) VARDATA(key), klen, NULL, 0);
|
||||
err = px_combo_init(c, (uint8 *) VARDATA_ANY(key), klen, NULL, 0);
|
||||
if (!err)
|
||||
err = px_combo_decrypt(c, (uint8 *) VARDATA(data), dlen,
|
||||
err = px_combo_decrypt(c, (uint8 *) VARDATA_ANY(data), dlen,
|
||||
(uint8 *) VARDATA(res), &rlen);
|
||||
|
||||
px_combo_free(c);
|
||||
@ -327,23 +327,23 @@ pg_encrypt_iv(PG_FUNCTION_ARGS)
|
||||
ivlen,
|
||||
rlen;
|
||||
|
||||
type = PG_GETARG_TEXT_P(3);
|
||||
type = PG_GETARG_TEXT_PP(3);
|
||||
c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
iv = PG_GETARG_BYTEA_P(2);
|
||||
dlen = VARSIZE(data) - VARHDRSZ;
|
||||
klen = VARSIZE(key) - VARHDRSZ;
|
||||
ivlen = VARSIZE(iv) - VARHDRSZ;
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
iv = PG_GETARG_BYTEA_PP(2);
|
||||
dlen = VARSIZE_ANY_EXHDR(data);
|
||||
klen = VARSIZE_ANY_EXHDR(key);
|
||||
ivlen = VARSIZE_ANY_EXHDR(iv);
|
||||
|
||||
rlen = px_combo_encrypt_len(c, dlen);
|
||||
res = palloc(VARHDRSZ + rlen);
|
||||
|
||||
err = px_combo_init(c, (uint8 *) VARDATA(key), klen,
|
||||
(uint8 *) VARDATA(iv), ivlen);
|
||||
err = px_combo_init(c, (uint8 *) VARDATA_ANY(key), klen,
|
||||
(uint8 *) VARDATA_ANY(iv), ivlen);
|
||||
if (!err)
|
||||
err = px_combo_encrypt(c, (uint8 *) VARDATA(data), dlen,
|
||||
err = px_combo_encrypt(c, (uint8 *) VARDATA_ANY(data), dlen,
|
||||
(uint8 *) VARDATA(res), &rlen);
|
||||
|
||||
px_combo_free(c);
|
||||
@ -381,23 +381,23 @@ pg_decrypt_iv(PG_FUNCTION_ARGS)
|
||||
rlen,
|
||||
ivlen;
|
||||
|
||||
type = PG_GETARG_TEXT_P(3);
|
||||
type = PG_GETARG_TEXT_PP(3);
|
||||
c = find_provider(type, (PFN) px_find_combo, "Cipher", 0);
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
iv = PG_GETARG_BYTEA_P(2);
|
||||
dlen = VARSIZE(data) - VARHDRSZ;
|
||||
klen = VARSIZE(key) - VARHDRSZ;
|
||||
ivlen = VARSIZE(iv) - VARHDRSZ;
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
iv = PG_GETARG_BYTEA_PP(2);
|
||||
dlen = VARSIZE_ANY_EXHDR(data);
|
||||
klen = VARSIZE_ANY_EXHDR(key);
|
||||
ivlen = VARSIZE_ANY_EXHDR(iv);
|
||||
|
||||
rlen = px_combo_decrypt_len(c, dlen);
|
||||
res = palloc(VARHDRSZ + rlen);
|
||||
|
||||
err = px_combo_init(c, (uint8 *) VARDATA(key), klen,
|
||||
(uint8 *) VARDATA(iv), ivlen);
|
||||
err = px_combo_init(c, (uint8 *) VARDATA_ANY(key), klen,
|
||||
(uint8 *) VARDATA_ANY(iv), ivlen);
|
||||
if (!err)
|
||||
err = px_combo_decrypt(c, (uint8 *) VARDATA(data), dlen,
|
||||
err = px_combo_decrypt(c, (uint8 *) VARDATA_ANY(data), dlen,
|
||||
(uint8 *) VARDATA(res), &rlen);
|
||||
|
||||
px_combo_free(c);
|
||||
@ -480,8 +480,8 @@ find_provider(text *name,
|
||||
char *buf;
|
||||
int err;
|
||||
|
||||
buf = downcase_truncate_identifier(VARDATA(name),
|
||||
VARSIZE(name) - VARHDRSZ,
|
||||
buf = downcase_truncate_identifier(VARDATA_ANY(name),
|
||||
VARSIZE_ANY_EXHDR(name),
|
||||
false);
|
||||
|
||||
err = provider_lookup(buf, &res);
|
||||
|
@ -67,9 +67,9 @@ PG_FUNCTION_INFO_V1(pgp_armor_headers);
|
||||
static text *
|
||||
convert_charset(text *src, int cset_from, int cset_to)
|
||||
{
|
||||
int src_len = VARSIZE(src) - VARHDRSZ;
|
||||
int src_len = VARSIZE_ANY_EXHDR(src);
|
||||
unsigned char *dst;
|
||||
unsigned char *csrc = (unsigned char *) VARDATA(src);
|
||||
unsigned char *csrc = (unsigned char *) VARDATA_ANY(src);
|
||||
text *res;
|
||||
|
||||
dst = pg_do_encoding_conversion(csrc, src_len, cset_from, cset_to);
|
||||
@ -109,7 +109,7 @@ string_is_ascii(const char *str)
|
||||
static void
|
||||
clear_and_pfree(text *p)
|
||||
{
|
||||
px_memset(p, 0, VARSIZE(p));
|
||||
px_memset(p, 0, VARSIZE_ANY(p));
|
||||
pfree(p);
|
||||
}
|
||||
|
||||
@ -356,8 +356,8 @@ parse_args(PGP_Context *ctx, uint8 *args, int arg_len,
|
||||
static MBuf *
|
||||
create_mbuf_from_vardata(text *data)
|
||||
{
|
||||
return mbuf_create_from_data((uint8 *) VARDATA(data),
|
||||
VARSIZE(data) - VARHDRSZ);
|
||||
return mbuf_create_from_data((uint8 *) VARDATA_ANY(data),
|
||||
VARSIZE_ANY_EXHDR(data));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -369,8 +369,8 @@ init_work(PGP_Context **ctx_p, int is_text,
|
||||
fill_expect(ex, is_text);
|
||||
|
||||
if (err == 0 && args != NULL)
|
||||
err = parse_args(*ctx_p, (uint8 *) VARDATA(args),
|
||||
VARSIZE(args) - VARHDRSZ, ex);
|
||||
err = parse_args(*ctx_p, (uint8 *) VARDATA_ANY(args),
|
||||
VARSIZE_ANY_EXHDR(args), ex);
|
||||
|
||||
if (err)
|
||||
px_THROW_ERROR(err);
|
||||
@ -408,7 +408,7 @@ encrypt_internal(int is_pubenc, int is_text,
|
||||
}
|
||||
|
||||
src = create_mbuf_from_vardata(data);
|
||||
dst = mbuf_create(VARSIZE(data) + 128);
|
||||
dst = mbuf_create(VARSIZE_ANY(data) + 128);
|
||||
|
||||
/*
|
||||
* reserve room for header
|
||||
@ -427,8 +427,8 @@ encrypt_internal(int is_pubenc, int is_text,
|
||||
mbuf_free(kbuf);
|
||||
}
|
||||
else
|
||||
err = pgp_set_symkey(ctx, (uint8 *) VARDATA(key),
|
||||
VARSIZE(key) - VARHDRSZ);
|
||||
err = pgp_set_symkey(ctx, (uint8 *) VARDATA_ANY(key),
|
||||
VARSIZE_ANY_EXHDR(key));
|
||||
|
||||
/*
|
||||
* encrypt
|
||||
@ -485,9 +485,9 @@ decrypt_internal(int is_pubenc, int need_text, text *data,
|
||||
|
||||
init_work(&ctx, need_text, args, &ex);
|
||||
|
||||
src = mbuf_create_from_data((uint8 *) VARDATA(data),
|
||||
VARSIZE(data) - VARHDRSZ);
|
||||
dst = mbuf_create(VARSIZE(data) + 2048);
|
||||
src = mbuf_create_from_data((uint8 *) VARDATA_ANY(data),
|
||||
VARSIZE_ANY_EXHDR(data));
|
||||
dst = mbuf_create(VARSIZE_ANY(data) + 2048);
|
||||
|
||||
/*
|
||||
* reserve room for header
|
||||
@ -505,16 +505,16 @@ decrypt_internal(int is_pubenc, int need_text, text *data,
|
||||
|
||||
if (keypsw)
|
||||
{
|
||||
psw = (uint8 *) VARDATA(keypsw);
|
||||
psw_len = VARSIZE(keypsw) - VARHDRSZ;
|
||||
psw = (uint8 *) VARDATA_ANY(keypsw);
|
||||
psw_len = VARSIZE_ANY_EXHDR(keypsw);
|
||||
}
|
||||
kbuf = create_mbuf_from_vardata(key);
|
||||
err = pgp_set_pubkey(ctx, kbuf, psw, psw_len, 1);
|
||||
mbuf_free(kbuf);
|
||||
}
|
||||
else
|
||||
err = pgp_set_symkey(ctx, (uint8 *) VARDATA(key),
|
||||
VARSIZE(key) - VARHDRSZ);
|
||||
err = pgp_set_symkey(ctx, (uint8 *) VARDATA_ANY(key),
|
||||
VARSIZE_ANY_EXHDR(key));
|
||||
|
||||
/* decrypt */
|
||||
if (err >= 0)
|
||||
@ -571,10 +571,10 @@ pgp_sym_encrypt_bytea(PG_FUNCTION_ARGS)
|
||||
text *arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
arg = PG_GETARG_BYTEA_P(2);
|
||||
arg = PG_GETARG_BYTEA_PP(2);
|
||||
|
||||
res = encrypt_internal(0, 0, data, key, arg);
|
||||
|
||||
@ -593,10 +593,10 @@ pgp_sym_encrypt_text(PG_FUNCTION_ARGS)
|
||||
text *arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
arg = PG_GETARG_BYTEA_P(2);
|
||||
arg = PG_GETARG_BYTEA_PP(2);
|
||||
|
||||
res = encrypt_internal(0, 1, data, key, arg);
|
||||
|
||||
@ -616,10 +616,10 @@ pgp_sym_decrypt_bytea(PG_FUNCTION_ARGS)
|
||||
text *arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
arg = PG_GETARG_BYTEA_P(2);
|
||||
arg = PG_GETARG_BYTEA_PP(2);
|
||||
|
||||
res = decrypt_internal(0, 0, data, key, NULL, arg);
|
||||
|
||||
@ -638,10 +638,10 @@ pgp_sym_decrypt_text(PG_FUNCTION_ARGS)
|
||||
text *arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
arg = PG_GETARG_BYTEA_P(2);
|
||||
arg = PG_GETARG_BYTEA_PP(2);
|
||||
|
||||
res = decrypt_internal(0, 1, data, key, NULL, arg);
|
||||
|
||||
@ -664,10 +664,10 @@ pgp_pub_encrypt_bytea(PG_FUNCTION_ARGS)
|
||||
text *arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
arg = PG_GETARG_BYTEA_P(2);
|
||||
arg = PG_GETARG_BYTEA_PP(2);
|
||||
|
||||
res = encrypt_internal(1, 0, data, key, arg);
|
||||
|
||||
@ -686,10 +686,10 @@ pgp_pub_encrypt_text(PG_FUNCTION_ARGS)
|
||||
text *arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
arg = PG_GETARG_BYTEA_P(2);
|
||||
arg = PG_GETARG_BYTEA_PP(2);
|
||||
|
||||
res = encrypt_internal(1, 1, data, key, arg);
|
||||
|
||||
@ -710,12 +710,12 @@ pgp_pub_decrypt_bytea(PG_FUNCTION_ARGS)
|
||||
*arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
psw = PG_GETARG_BYTEA_P(2);
|
||||
psw = PG_GETARG_BYTEA_PP(2);
|
||||
if (PG_NARGS() > 3)
|
||||
arg = PG_GETARG_BYTEA_P(3);
|
||||
arg = PG_GETARG_BYTEA_PP(3);
|
||||
|
||||
res = decrypt_internal(1, 0, data, key, psw, arg);
|
||||
|
||||
@ -737,12 +737,12 @@ pgp_pub_decrypt_text(PG_FUNCTION_ARGS)
|
||||
*arg = NULL;
|
||||
text *res;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
key = PG_GETARG_BYTEA_P(1);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
key = PG_GETARG_BYTEA_PP(1);
|
||||
if (PG_NARGS() > 2)
|
||||
psw = PG_GETARG_BYTEA_P(2);
|
||||
psw = PG_GETARG_BYTEA_PP(2);
|
||||
if (PG_NARGS() > 3)
|
||||
arg = PG_GETARG_BYTEA_P(3);
|
||||
arg = PG_GETARG_BYTEA_PP(3);
|
||||
|
||||
res = decrypt_internal(1, 1, data, key, psw, arg);
|
||||
|
||||
@ -865,8 +865,8 @@ pg_armor(PG_FUNCTION_ARGS)
|
||||
char **keys = NULL,
|
||||
**values = NULL;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
data_len = VARSIZE(data) - VARHDRSZ;
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
data_len = VARSIZE_ANY_EXHDR(data);
|
||||
if (PG_NARGS() == 3)
|
||||
{
|
||||
num_headers = parse_key_value_arrays(PG_GETARG_ARRAYTYPE_P(1),
|
||||
@ -880,7 +880,7 @@ pg_armor(PG_FUNCTION_ARGS)
|
||||
|
||||
initStringInfo(&buf);
|
||||
|
||||
pgp_armor_encode((uint8 *) VARDATA(data), data_len, &buf,
|
||||
pgp_armor_encode((uint8 *) VARDATA_ANY(data), data_len, &buf,
|
||||
num_headers, keys, values);
|
||||
|
||||
res = palloc(VARHDRSZ + buf.len);
|
||||
@ -901,12 +901,12 @@ pg_dearmor(PG_FUNCTION_ARGS)
|
||||
int ret;
|
||||
StringInfoData buf;
|
||||
|
||||
data = PG_GETARG_TEXT_P(0);
|
||||
data_len = VARSIZE(data) - VARHDRSZ;
|
||||
data = PG_GETARG_TEXT_PP(0);
|
||||
data_len = VARSIZE_ANY_EXHDR(data);
|
||||
|
||||
initStringInfo(&buf);
|
||||
|
||||
ret = pgp_armor_decode((uint8 *) VARDATA(data), data_len, &buf);
|
||||
ret = pgp_armor_decode((uint8 *) VARDATA_ANY(data), data_len, &buf);
|
||||
if (ret < 0)
|
||||
px_THROW_ERROR(ret);
|
||||
res = palloc(VARHDRSZ + buf.len);
|
||||
@ -1004,7 +1004,7 @@ pgp_key_id_w(PG_FUNCTION_ARGS)
|
||||
int res_len;
|
||||
MBuf *buf;
|
||||
|
||||
data = PG_GETARG_BYTEA_P(0);
|
||||
data = PG_GETARG_BYTEA_PP(0);
|
||||
buf = create_mbuf_from_vardata(data);
|
||||
res = palloc(VARHDRSZ + 17);
|
||||
|
||||
|
Reference in New Issue
Block a user