Merge in SNORT/snort3 from ~BHRYNIV/snort3:fix_user_agent_out_of_bound to master
Squashed commit of the following:
commit
d47746bb6f35558637d3bac4f3de466c259f511f
Author: Bohdan Hryniv <bhryniv@cisco>
Date: Thu Jul 17 14:04:53 2025 -0400
appid: fix out-of-bounds caused by strncat in identify_user_agent
if (match->client_id == APP_ID_INTERNET_EXPLORER
&& strstr((const char*)buffPtr, "SLCC2"))
{
- if ((MAX_VERSION_SIZE-i) >= (sizeof(COMPATIBLE_BROWSER_STRING) - 1))
+ if ((MAX_VERSION_SIZE-i-1) >= (sizeof(COMPATIBLE_BROWSER_STRING) - 1))
{
- strncat(temp_ver, COMPATIBLE_BROWSER_STRING, MAX_VERSION_SIZE - i);
+ strncat(temp_ver, COMPATIBLE_BROWSER_STRING, MAX_VERSION_SIZE - i - 1);
}
}
// Pick firefox over some things, but pick a misc app over Firefox.
return partNum;
}
-