Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix format-security error #1026

Open
wants to merge 1 commit into
base: vanilla
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/wsproto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ bool WinsockInterfaceClass::Set_Socket_Options(void)
if (err == INVALID_SOCKET) {
char out[128];
sprintf(out, "TS: Failed to set socket option SO_RCVBUF - error code %d.\n", LastSocketError);
fprintf(stderr, out);
fprintf(stderr, "%s", out);
assert(err != INVALID_SOCKET);
}

Expand All @@ -583,7 +583,7 @@ bool WinsockInterfaceClass::Set_Socket_Options(void)
if (err == INVALID_SOCKET) {
char out[128];
sprintf(out, "TS: Failed to set socket option SO_SNDBUF - error code %d.\n", LastSocketError);
fprintf(stderr, out);
fprintf(stderr, "%s", out);
assert(err != INVALID_SOCKET);
}

Expand Down
2 changes: 1 addition & 1 deletion redalert/cheklist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void CheckListClass::Draw_Entry(int index, int x, int y, int width, int selected
buffer[0] = UNCHECK_CHAR;
}
buffer[1] = ' ';
sprintf(&buffer[2], obj->Text);
sprintf(&buffer[2], "%s", obj->Text);

TextPrintType flags = TextFlags;
RemapControlType* scheme = GadgetClass::Get_Color_Scheme();
Expand Down
2 changes: 1 addition & 1 deletion tiberiandawn/cheklist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void CheckListClass::Draw_Entry(int index, int x, int y, int width, int selected
buffer[0] = UNCHECK_CHAR;
}
buffer[1] = ' ';
sprintf(&buffer[2], obj->Text);
sprintf(&buffer[2], "%s", obj->Text);

TextPrintType flags = TextFlags;

Expand Down
2 changes: 1 addition & 1 deletion tiberiandawn/netdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4076,7 +4076,7 @@ void Net_Reconnect_Dialog(int reconn, int fresh, int oldest_index, unsigned int
id = Ipx.Connection_ID(oldest_index);
sprintf(buf1, Text_String(TXT_RECONNECTING_TO), Ipx.Connection_Name(id));
} else {
sprintf(buf1, Text_String(TXT_WAITING_FOR_CONNECTIONS));
sprintf(buf1, "%s", Text_String(TXT_WAITING_FOR_CONNECTIONS));
}
sprintf(buf2, Text_String(TXT_TIME_ALLOWED), timeval + 1);
buf3 = Text_String(TXT_PRESS_ESC);
Expand Down