Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.5.1
-
None
-
None
Description
protected string DecodeString(byte[] buffer, int offset, int length) |
{
|
var result = string.Empty; |
if (buffer != null && buffer.Length > 0 && length > 0) |
{
|
result = Encoding.UTF8.GetString(buffer, offset, length);
|
}
|
return result; |
}
|
When a null string is inserted with the Encode method the decodeString method used by Decode transform it in emptyString.
So the Encode / Decode is not idempotent for the strings
maybe is better to use string result= null instead of var result = string.Empty;
Attachments
For Gerrit Dashboard: NCBC-1555 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
86345,6 | NCBC-1555: DecodeString method doesn't manage null string | master | couchbase-net-client | Status: MERGED | +2 | +1 |