-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[T2580] Fix handling null values in mysql #543
[T2580] Fix handling null values in mysql #543
Conversation
@@ -196,6 +196,9 @@ func (wrapper *OldContainerDetectorWrapper) OnCryptoEnvelope(ctx context.Context | |||
|
|||
// OnColumn callback which finds serializedContainer or AcraStruct/AcraBlock for backward compatibility | |||
func (wrapper *OldContainerDetectorWrapper) OnColumn(ctx context.Context, inBuffer []byte) (context.Context, []byte, error) { | |||
if inBuffer == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we return there inBuffer
as is. Without allocating new buffer. If inBuffer
in OnColumn will be nil
, it will returned as is due to if len(inBuffer) < SerializedContainerMinSize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…ncoding-null-values
On decryption our envelope_detector returned
[]byte{}
onnil
values instead leavingnil
. MySQL encoded differently empty strings and NULL values. NULL values should have 0xfb value. So on Acra side when it receive null value as 0xfb then it changed to empty array and encode it as LengthEncoded String or Integer that are incorrect.So in this PR removed processing null data in crypto envelope. If it will be empty array, it will be returned as empty array too.
Checklist
with new changes