Commit 96c0e360640f1f51e02c2f98dc05d3cedc104b13
1 parent
a6d243fd
Exists in
master
and in
1 other branch
Fixing CodeQL warnings.
Showing
1 changed file
with
10 additions
and
10 deletions
Show diff stats
src/core/see.c
| @@ -320,29 +320,29 @@ static const char * see_outline(unsigned char setting) { | @@ -320,29 +320,29 @@ static const char * see_outline(unsigned char setting) { | ||
| 320 | 320 | ||
| 321 | (void) strcpy(buf, ""); | 321 | (void) strcpy(buf, ""); |
| 322 | if (setting & XAO_UNDERLINE) { | 322 | if (setting & XAO_UNDERLINE) { |
| 323 | - (void) strcat(buf, paren); | ||
| 324 | - (void) strcat(buf, "underline"); | 323 | + (void) strncat(buf, paren, 63); |
| 324 | + (void) strncat(buf, "underline", 63); | ||
| 325 | paren = ","; | 325 | paren = ","; |
| 326 | } | 326 | } |
| 327 | if (setting & XAO_RIGHT) { | 327 | if (setting & XAO_RIGHT) { |
| 328 | - (void) strcat(buf, paren); | ||
| 329 | - (void) strcat(buf, "right"); | 328 | + (void) strncat(buf, paren, 63); |
| 329 | + (void) strncat(buf, "right", 63); | ||
| 330 | paren = ","; | 330 | paren = ","; |
| 331 | } | 331 | } |
| 332 | if (setting & XAO_OVERLINE) { | 332 | if (setting & XAO_OVERLINE) { |
| 333 | - (void) strcat(buf, paren); | ||
| 334 | - (void) strcat(buf, "overline"); | 333 | + (void) strncat(buf, paren, 63); |
| 334 | + (void) strncat(buf, "overline", 63); | ||
| 335 | paren = ","; | 335 | paren = ","; |
| 336 | } | 336 | } |
| 337 | if (setting & XAO_LEFT) { | 337 | if (setting & XAO_LEFT) { |
| 338 | - (void) strcat(buf, paren); | ||
| 339 | - (void) strcat(buf, "left"); | 338 | + (void) strncat(buf, paren, 63); |
| 339 | + (void) strncat(buf, "left", 63); | ||
| 340 | paren = ","; | 340 | paren = ","; |
| 341 | } | 341 | } |
| 342 | if (strcmp(paren, "(")) | 342 | if (strcmp(paren, "(")) |
| 343 | - (void) strcat(buf, ")"); | 343 | + (void) strncat(buf, ")", 63); |
| 344 | else | 344 | else |
| 345 | - (void) strcpy(buf, "(none)"); | 345 | + (void) strncpy(buf, "(none)", 63); |
| 346 | return buf; | 346 | return buf; |
| 347 | } | 347 | } |
| 348 | 348 |