diff options
Diffstat (limited to 'apps/s_client.c')
| -rw-r--r-- | apps/s_client.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/s_client.c b/apps/s_client.c index 3625f8fcdc99..d356359a97ef 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -3892,7 +3892,11 @@ static void user_data_init(struct user_data_st *user_data, SSL *con, char *buf, static int user_data_add(struct user_data_st *user_data, size_t i) { - if (user_data->buflen != 0 || i > user_data->bufmax) + /* + * We must allow one byte for a NUL terminator so i must be less than + * bufmax + */ + if (user_data->buflen != 0 || i >= user_data->bufmax) return 0; user_data->buflen = i; |
