diff options
author | Damien Diederen <dd@crosstwine.com> | 2015-01-21 22:07:30 +0300 |
---|---|---|
committer | Damien Diederen <dd@crosstwine.com> | 2015-05-05 23:21:13 +0300 |
commit | 33654c34186ab34990b19fbcdf830c44d2aa1348 (patch) | |
tree | 6866246607b46f87ff6dd76b1d8c8dad696a765d /mcs/class/Mono.Data.Tds | |
parent | d7a417a3494aba3f72dc8d76a003c57315d9fe40 (diff) |
[Mono.Data.Tds] Serialize GUIDs as 16-byte arrays (rather than zero)
Make sure we do not accidentally to encode an object by breaking out for
unknown TypeCode.Object instances (this is where the zero bytes used to
silently come from).
Diffstat (limited to 'mcs/class/Mono.Data.Tds')
-rw-r--r-- | mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs index af8d3904452..3892035220c 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs @@ -219,6 +219,9 @@ namespace Mono.Data.Tds.Protocol { case TypeCode.Object : if (o is byte[]) Append ((byte[]) o); + else if (o is Guid) + Append (((Guid) o).ToByteArray ()); + else break; return; case TypeCode.Int16 : Append ((short) o); |