This is the same bug that the freetds driver had (and fixed). Rather than repeat everything I put in that bug report, I'll just link to it here. It's got a pretty straightforward C repro program. It's possible it would be useful to take a peek at how freetds fixed the bug.
This is the same bug that the freetds driver had (and fixed). Rather than repeat everything I put in that bug report, I'll just link to it here. It's got a pretty straightforward C repro program. It's possible it would be useful to take a peek at how freetds fixed the bug.