From 96c0e360640f1f51e02c2f98dc05d3cedc104b13 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 15 Dec 2022 17:04:38 -0300 Subject: [PATCH] Fixing CodeQL warnings. --- src/core/see.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/see.c b/src/core/see.c index 78fed32..46534b5 100644 --- a/src/core/see.c +++ b/src/core/see.c @@ -320,29 +320,29 @@ static const char * see_outline(unsigned char setting) { (void) strcpy(buf, ""); if (setting & XAO_UNDERLINE) { - (void) strcat(buf, paren); - (void) strcat(buf, "underline"); + (void) strncat(buf, paren, 63); + (void) strncat(buf, "underline", 63); paren = ","; } if (setting & XAO_RIGHT) { - (void) strcat(buf, paren); - (void) strcat(buf, "right"); + (void) strncat(buf, paren, 63); + (void) strncat(buf, "right", 63); paren = ","; } if (setting & XAO_OVERLINE) { - (void) strcat(buf, paren); - (void) strcat(buf, "overline"); + (void) strncat(buf, paren, 63); + (void) strncat(buf, "overline", 63); paren = ","; } if (setting & XAO_LEFT) { - (void) strcat(buf, paren); - (void) strcat(buf, "left"); + (void) strncat(buf, paren, 63); + (void) strncat(buf, "left", 63); paren = ","; } if (strcmp(paren, "(")) - (void) strcat(buf, ")"); + (void) strncat(buf, ")", 63); else - (void) strcpy(buf, "(none)"); + (void) strncpy(buf, "(none)", 63); return buf; } -- libgit2 0.21.2