mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 00:03:03 +01:00
Report failure instead of having AV in case of too many suggested protocol versions
This commit is contained in:
parent
d64476c72c
commit
b36b5fb9a0
@ -313,6 +313,13 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
|
|||||||
MAP(xdr_enum, reinterpret_cast<xdr_op&>(connect->p_cnct_client));
|
MAP(xdr_enum, reinterpret_cast<xdr_op&>(connect->p_cnct_client));
|
||||||
MAP(xdr_cstring, connect->p_cnct_file);
|
MAP(xdr_cstring, connect->p_cnct_file);
|
||||||
MAP(xdr_short, reinterpret_cast<SSHORT&>(connect->p_cnct_count));
|
MAP(xdr_short, reinterpret_cast<SSHORT&>(connect->p_cnct_count));
|
||||||
|
|
||||||
|
// report protocol failure in case of too many suggested versions
|
||||||
|
if (connect->p_cnct_count > FB_NELEM(connect->p_cnct_versions))
|
||||||
|
{
|
||||||
|
return P_FALSE(xdrs, p);
|
||||||
|
}
|
||||||
|
|
||||||
MAP(xdr_cstring, connect->p_cnct_user_id);
|
MAP(xdr_cstring, connect->p_cnct_user_id);
|
||||||
for (i = 0, tail = connect->p_cnct_versions;
|
for (i = 0, tail = connect->p_cnct_versions;
|
||||||
i < connect->p_cnct_count; i++, tail++)
|
i < connect->p_cnct_count; i++, tail++)
|
||||||
|
Loading…
Reference in New Issue
Block a user