diff --git a/contrib/babelfishpg_tds/src/backend/tds/tdslogin.c b/contrib/babelfishpg_tds/src/backend/tds/tdslogin.c index c4907a8b34..37f7edd81e 100644 --- a/contrib/babelfishpg_tds/src/backend/tds/tdslogin.c +++ b/contrib/babelfishpg_tds/src/backend/tds/tdslogin.c @@ -759,7 +759,8 @@ FetchLoginRequest(LoginRequest request) return STATUS_ERROR; /* Check we indeed got the correct packet */ - Assert(TdsCheckMessageType(TDS_LOGIN7)); + if (!TdsCheckMessageType(TDS_LOGIN7)) + return STATUS_ERROR; /* fix the client version now */ request->clientProVersion = pg_bswap32(request->clientProVersion);