Gcc-7 buffer size insufficient

Summary:
Bunch of commits related to insufficient buffer size. Errors in individual commits.
Closes https://github.com/facebook/rocksdb/pull/1673

Differential Revision: D4332127

Pulled By: IslamAbdelRahman

fbshipit-source-id: 878f73c
main
Daniel Black 8 years ago committed by Facebook Github Bot
parent b7239bf7e0
commit 0ab6fc167f
  1. 2
      tools/db_bench_tool.cc
  2. 2
      util/transaction_test_util.cc
  3. 2
      utilities/simulator_cache/sim_cache.cc
  4. 2
      utilities/transactions/transaction_util.cc

@ -2615,7 +2615,7 @@ class Benchmark {
if (!ok) {
thread->stats.AddMessage("(compression failure)");
} else {
char buf[100];
char buf[340];
snprintf(buf, sizeof(buf), "(output: %.1f%%)",
(produced * 100.0) / bytes);
thread->stats.AddMessage(buf);

@ -190,7 +190,7 @@ Status RandomTransactionInserter::Verify(DB* db, uint16_t num_sets) {
// For each set of keys with the same prefix, sum all the values
for (uint32_t i = 0; i < num_sets; i++) {
char prefix_buf[5];
char prefix_buf[6];
snprintf(prefix_buf, sizeof(prefix_buf), "%.4u", i + 1);
uint64_t total = 0;

@ -136,7 +136,7 @@ class SimCacheImpl : public SimCache {
std::string res;
res.append("SimCache MISSes: " + std::to_string(get_miss_counter()) + "\n");
res.append("SimCache HITs: " + std::to_string(get_hit_counter()) + "\n");
char buff[100];
char buff[350];
auto lookups = get_miss_counter() + get_hit_counter();
snprintf(buff, sizeof(buff), "SimCache HITRATE: %.2f%%\n",
(lookups == 0 ? 0 : get_hit_counter() * 100.0f / lookups));

@ -81,7 +81,7 @@ Status TransactionUtil::CheckKey(DBImpl* db_impl, SuperVersion* sv,
if (cache_only) {
// The age of this memtable is too new to use to check for recent
// writes.
char msg[255];
char msg[300];
snprintf(msg, sizeof(msg),
"Transaction could not check for conflicts for operation at "
"SequenceNumber %" PRIu64

Loading…
Cancel
Save