Re: [BLACKBOX] AW: [BLACKBOX] reading with SqlODBC3

From: [at]} <Josef>
Date: Thu, 10 Dec 2009 19:27:24 +0100

----boundary-LibPST-iamunique-442277112_-_-
Content-type: text/plain

Bernhardt, please use english in this mailing list.

The bug is easy to find in BB1.6 in SqlOdbc3.ReadString:

  WinSql.SQLGetData(t.stmt, SHORT(column + 1), WinSql.SQL_C_WCHAR,
                        SYSTEM.ADR(str), LEN(str), len)

LEN(str) ist the number of Unicode characters (SQL_C_WCHAR), which happens to be
half of the buffer size. The BufferLength parameter is defined as a number of bytes.
So either use SQL_C_CHAR, as in BB<=1.5 or
adapt the buffer size. The same may be required in other procedures
such as ReadVarString.
In general it may be a good idea to check all occurences of "LEN"
and replace it by "SIZE" where appropriate.

- JT


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-442277112_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEJlcm5oYXJkdCwgcGxlYXNlIHVzZSBlbmdsaXNo
IGluIHRoaXMgbWFpbGluZyBsaXN0LlxwYXINClxwYXINClRoZSBidWcgaXMgZWFzeSB0byBmaW5k
IGluIEJCMS42IGluIFNxbE9kYmMzLlJlYWRTdHJpbmc6XHBhcg0KXHBhcg0KICBXaW5TcWwuU1FM
R2V0RGF0YSh0LnN0bXQsIFNIT1JUKGNvbHVtbiArIDEpLCBXaW5TcWwuU1FMX0NfV0NIQVIsXHBh
cg0KICAgICAgICAgICAgICAgICAgICAgICAgU1lTVEVNLkFEUihzdHIpLCBMRU4oc3RyKSwgbGVu
KVxwYXINClxwYXINCkxFTihzdHIpIGlzdCB0aGUgbnVtYmVyIG9mIFVuaWNvZGUgY2hhcmFjdGVy
cyAoU1FMX0NfV0NIQVIpLCB3aGljaCBoYXBwZW5zIHRvIGJlXHBhcg0KaGFsZiBvZiB0aGUgYnVm
ZmVyIHNpemUuIFRoZSBCdWZmZXJMZW5ndGggcGFyYW1ldGVyIGlzIGRlZmluZWQgYXMgYSBudW1i
ZXIgb2YgYnl0ZXMuXHBhcg0KU28gZWl0aGVyIHVzZSBTUUxfQ19DSEFSLCBhcyBpbiBCQjw9MS41
IG9yXHBhcg0KYWRhcHQgdGhlIGJ1ZmZlciBzaXplLiBUaGUgc2FtZSBtYXkgYmUgcmVxdWlyZWQg
aW4gb3RoZXIgcHJvY2VkdXJlc1xwYXINCnN1Y2ggYXMgUmVhZFZhclN0cmluZy4gXHBhcg0KSW4g
Z2VuZXJhbCBpdCBtYXkgYmUgYSBnb29kIGlkZWEgdG8gY2hlY2sgYWxsIG9jY3VyZW5jZXMgb2Yg
IkxFTiIgXHBhcg0KYW5kIHJlcGxhY2UgaXQgYnkgIlNJWkUiIHdoZXJlIGFwcHJvcHJpYXRlLlxw
YXINClxwYXINCi0gSlRccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUs
IHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZA
TElTVFMuT0JFUk9OLkNIfX0AZW0gXA==
----boundary-LibPST-iamunique-442277112_-_---
Received on Thu Dec 10 2009 - 19:27:24 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:39 UTC