Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cb8d490

Browse files
kvapkelvich
authored andcommitted
Fix PaxosSet not appending zero to the encoded value.
1 parent 9994464 commit cb8d490

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

multimaster.c

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

12231223
enclen = hex_enc_len(value, size);
1224-
enc = palloc(enclen);
1224+
enc = palloc(enclen) + 1;
12251225
len = hex_encode(value, size, enc);
12261226
Assert(len == enclen);
1227+
enc[len] = '\0';
12271228

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

0 commit comments

Comments
 (0)