From 1da917e5b971ac6e43e2048640dfb9d0ad03ed1a Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Tue, 23 Sep 2014 00:01:15 +0200 Subject: [PATCH] Fix crash due to negative max copy length. --- src/core/inf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/inf.c b/src/core/inf.c index 3bb789f..2e8d37a 100644 --- a/src/core/inf.c +++ b/src/core/inf.c @@ -390,7 +390,7 @@ static int check_user_agent(struct hub_info* hub, struct hub_user* user, struct str = adc_msg_unescape(ua_version_encoded); if (str) { - memcpy(user->id.user_agent + offset, str, MIN(strlen(str), MAX_UA_LEN) - offset); + memcpy(user->id.user_agent + offset, str, MIN(strlen(str), MAX_UA_LEN - offset)); hub_free(str); } }