From ef2ad6d4b9de75c5235eb26b420b3a894ed3ce6d Mon Sep 17 00:00:00 2001 From: Thomas Benson Date: Tue, 10 Mar 2026 07:23:39 -0700 Subject: [PATCH] Fix snprintf buffer size in matxException snprintf in the string-input version of the matxException constructor uses the size of the input error string rather than the pre-allocated output string buffer as its size argument. Fix this to use of the size of the output buffer. The constructor taking a const char * input already uses the correct size. Signed-off-by: Thomas Benson --- include/matx/core/error.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/matx/core/error.h b/include/matx/core/error.h index 6b3d4e73..68b91d09 100644 --- a/include/matx/core/error.h +++ b/include/matx/core/error.h @@ -147,7 +147,7 @@ namespace matx matxException(matxError_t error, const std::string &s, const char *file, int line) : e(error) { - snprintf(str, s.size(), "matxException (%s: %s) - %s:%d\n", + snprintf(str, sizeof(str), "matxException (%s: %s) - %s:%d\n", matxErrorString(error), s.c_str(), file, line); detail::printStackTrace(stack); }