Skip to Content.
Sympa Menu

freetds - Not terminated string

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "Freetds (E-mail)" <freetds AT franklin.metalab.unc.edu>
  • Subject: Not terminated string
  • Date: Mon, 19 Aug 2002 13:39:55 +0200


I do this test with SQL Query Analizer

create table #tmp1
(
s varchar(7)
)
insert into #tmp1(s) values(convert(varchar,0x41414141))
insert into #tmp1(s) values(convert(varchar,0x41004141))
select len(s) as length,s,substring(s,3,2),convert(varbinary,s) from #tmp1

It produce this result

length s
----------- ------- ---- ----------
4 AAAA AA 0x41414141
4 A AA AA 0x41004141

So mssql can store null characters in string.
Doing strlen to compute len of buffer just trim the string.

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================



  • Not terminated string, ZIGLIO Frediano, 08/19/2002

Archive powered by MHonArc 2.6.24.

Top of Page