1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 13:26:44 +02:00

fix possible buffer overflows and undefined behaviour

This commit is contained in:
Jfreegman
2014-07-25 17:55:21 -04:00
parent fb5a9bc043
commit f630a3e604
6 changed files with 11 additions and 12 deletions

View File

@ -170,7 +170,7 @@ static void shift_hist_back(ChatContext *ctx)
/* adds a line to the ln_history buffer at hst_pos and sets hst_pos to end of history. */
void add_line_to_hist(ChatContext *ctx)
{
if (ctx->len > MAX_STR_SIZE)
if (ctx->len >= MAX_STR_SIZE)
return;
if (ctx->hst_tot >= MAX_LINE_HIST)