File: snprintf-format-security

package info (click to toggle)
crossfire 1.75.0-5
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 23,904 kB
  • sloc: ansic: 83,200; sh: 4,659; perl: 1,736; lex: 1,443; makefile: 1,198; python: 43
file content (13 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
Index: crossfire-1.75.0/server/c_chat.c
===================================================================
--- crossfire-1.75.0.orig/server/c_chat.c	2021-01-23 16:29:20.909848529 +0200
+++ crossfire-1.75.0/server/c_chat.c	2021-01-23 16:35:06.418120238 +0200
@@ -651,7 +651,7 @@
         const char *self_reply;
         if (emotion > EMOTE_FIRST && emotion < EMOTE_LAST && single_emotes[emotion - 1][0] != NULL) {
             self_reply = single_emotes[emotion - 1][0];
-            snprintf(buf2, sizeof(buf2), single_emotes[emotion - 1][1], op->name);
+            snprintf(buf2, sizeof(buf2), "%s", single_emotes[emotion - 1][1], op->name);
         } else {
             self_reply = "You are a nut.";
             snprintf(buf2, sizeof(buf2), "%s dances with glee.", op->name);