From e1ab14c4ab7a1ee30b896c848863b08f006e7680 Mon Sep 17 00:00:00 2001 From: 12Boti <38918062+12Boti@users.noreply.github.com> Date: Fri, 9 Jun 2023 14:16:03 +0200 Subject: [PATCH] fix format string vulnerability (#223) --- gpttype_adapter.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gpttype_adapter.cpp b/gpttype_adapter.cpp index d7c334c00..a9ece44f2 100644 --- a/gpttype_adapter.cpp +++ b/gpttype_adapter.cpp @@ -949,9 +949,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs, generation_o } ::utreplace(tmp, "\n", "\\n"); outstr += tmp; - printf(outstr.c_str()); - - printf("\n\n"); + printf("%s\n\n", outstr.c_str()); } while (remaining_tokens > 0)