diff --git a/src/checkpoint/dispatch/reconstructor.h b/src/checkpoint/dispatch/reconstructor.h index 67e8b2c3..7a8a07f0 100644 --- a/src/checkpoint/dispatch/reconstructor.h +++ b/src/checkpoint/dispatch/reconstructor.h @@ -153,9 +153,11 @@ struct Reconstructor { template static T* constructAllowFailImpl(void* buf, isNotConstructible* = nullptr) { - std::unique_ptr msg = std::make_unique(32768); - sprintf( + constexpr int max_buffer_length = 32768; + std::unique_ptr msg = std::make_unique(max_buffer_length); + snprintf( &msg[0], + max_buffer_length, "Checkpoint is failing to reconstruct a class %s, due to it being " "abstract or the absence of a suitable constructor (default or tagged) " "or reconstruct()",