Fix possible buffer overflow in _news_cb()
This commit is contained in:
parent
6870226159
commit
bbb2264de5
1 changed files with 5 additions and 2 deletions
|
@ -2905,8 +2905,11 @@ namespace pvpgn
|
|||
t_connection *c = (t_connection*)data;
|
||||
|
||||
tm = std::localtime(&date);
|
||||
if (tm) std::strftime(strdate, 64, "%B %d, %Y", tm);
|
||||
else std::strcpy(strdate, localize(c, "(invalid date)").c_str());
|
||||
if (tm)
|
||||
std::strftime(strdate, 64, "%B %d, %Y", tm);
|
||||
else
|
||||
std::snprintf(strdate, sizeof strdate, "%s", localize(c, "(invalid date)").c_str());
|
||||
|
||||
message_send_text(c, message_type_info, c, strdate);
|
||||
|
||||
for (p = lstr_get_str(lstr); *p;) {
|
||||
|
|
Loading…
Reference in a new issue