From a9829b1e5f48f2a9ac8bd5385040af5cb6dc680c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 Aug 2022 04:24:08 -0400 Subject: [PATCH] enforce null termination of read string --- tools/stl_bin2txt.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/stl_bin2txt.cpp b/tools/stl_bin2txt.cpp index 0c042ec975..976c3ad089 100644 --- a/tools/stl_bin2txt.cpp +++ b/tools/stl_bin2txt.cpp @@ -52,6 +52,7 @@ int main(int argc, char **argv) printf("Error reading binary STL header: %s\n", strerror(errno)); return 4; } + title[79] = '\0'; // ensure null termination of title string count = strlen(title); if (count == 0) snprintf(title, 80, "STL object from file %s", argv[1]);