diff --git a/src/rustDemangle.cpp b/src/rustDemangle.cpp index 217fe475b..e9d97dd1a 100644 --- a/src/rustDemangle.cpp +++ b/src/rustDemangle.cpp @@ -1027,7 +1027,7 @@ static NODISCARD overflow_status printer_print_ch(struct printer *printer, char static NODISCARD overflow_status printer_print_u64(struct printer *printer, uint64_t n) { char buf[32] = {0}; - sprintf(buf, "%llu", (unsigned long long)n); // printing uint64 uses 21 < 32 chars + snprintf(buf, sizeof(buf), "%llu", (unsigned long long)n); // printing uint64 uses 21 < 32 chars return printer_print_str(printer, buf); } @@ -1172,7 +1172,7 @@ static NODISCARD overflow_status printer_print_path(struct printer *printer, boo if (printer->out != NULL && !printer->alternate && dis != 0) { PRINT_STR(printer, "["); char buf[24] = {0}; - sprintf(buf, "%llx", (unsigned long long)dis); + snprintf(buf, sizeof(buf), "%llx", (unsigned long long)dis); PRINT_STR(printer, buf); PRINT_STR(printer, "]"); }