null terminate payload

This commit is contained in:
Jethro Grassie 2019-05-05 01:37:49 -04:00
parent f70955d648
commit 5d84d80c61
No known key found for this signature in database
GPG key ID: DE8ED755616565BB

View file

@ -865,7 +865,7 @@ startup_pauout(uint64_t height)
pool_stats.last_block_found = block->timestamp; pool_stats.last_block_found = block->timestamp;
if (block->height > height - 60) if (block->height > height - 60)
break; continue;
if (block->status & BLOCK_UNLOCKED || block->status & BLOCK_ORPHANED) if (block->status & BLOCK_UNLOCKED || block->status & BLOCK_ORPHANED)
continue; continue;
@ -1158,16 +1158,14 @@ rpc_get_request_body(char *body, const char* method, char* fmt, ...)
pb += strlen(pb); pb += strlen(pb);
break; break;
} }
char append = ':'; *pb++ = count++ % 2 ? ',' : ':';
if (count++ % 2 != 0)
append = ',';
*pb++ = append;
} }
va_end(args); va_end(args);
*--pb = '}'; *--pb = '}';
pb++; pb++;
} }
*pb = '}'; *pb++ = '}';
*pb = '\0';
log_trace("Payload: %s", body); log_trace("Payload: %s", body);
} }