[freetds] [PATCH] Fix segfault when triggering a foreign keyviolation

ZIGLIO Frediano Frediano.Ziglio at vodafone.com
Mon Jan 12 09:27:23 EST 2004


> 
> Hi,
> 
> I found that when inserting a row that triggers a foreign key 
> violation or duplicate row violation, freetds was unable to 
> properly read all data from the wire.
> 
> When such an aforementioned error is triggered the database 
> sends a EED token which gets processed by tds_process_msg(). 
> When the status byte of the EED message is set to 1, 
> additional error data follows; freetds fails to read this 
> data from wire - which appears to let sqsh think it must read 
> data and thus causing it to segfault.
> 
> The attached patch fixes this bug; I'd be glad if it's not 
> too late for the release...
> 
> Greets from Karlsruhe,
> -Alex
> 

Hi,
this patch was included in 0.62 however I do not agree... the reason is
that tds_process_trailing_tokens all tokens till IDLE state so client do
not receive DONE token...

freddy77



More information about the FreeTDS mailing list