Content-Length: 262349 | pFad | http://github.com/postgrespro/postgres_cluster/commit/db8fb8db2a02a767ffb488ab7491a28d189408e2

E4 Fix PaxosSet not appending zero to the encoded value. · postgrespro/postgres_cluster@db8fb8d · GitHub
Skip to content

Commit db8fb8d

Browse files
committed
Fix PaxosSet not appending zero to the encoded value.
1 parent d070988 commit db8fb8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/mmts/multimaster.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,9 +1222,10 @@ void PaxosSet(char const* key, void const* value, int size, bool nowait)
12221222
char *enc, *dec;
12231223

12241224
enclen = hex_enc_len(value, size);
1225-
enc = palloc(enclen);
1225+
enc = palloc(enclen) + 1;
12261226
len = hex_encode(value, size, enc);
12271227
Assert(len == enclen);
1228+
enc[len] = '\0';
12281229

12291230
raftable_set(key, enc, nowait ? 1 : INT_MAX);
12301231
pfree(enc);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/db8fb8db2a02a767ffb488ab7491a28d189408e2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy