Yaniv Bronhaim has submitted this change and it was merged.

Change subject: stomp: Make sure the \0 is read before slicing the buffer
......................................................................


stomp: Make sure the \0 is read before slicing the buffer

In python if you try and slice past the end of the list\string you get
an empty string and not an IndexError

The original code check that we got all the data and sliced past the
ending \0. But on rare cases where the message ended exactly with all
the content but the \0 was not received.

The slicing code would silently ignore the fact that the index doesn't
exist and would return an empty string and switch the parser state
making all future data have the wrong offset.

This in turn made the command '\0SEND' instead of 'SEND' which has no
handler and where silently ignored. The only way to solve this was to
reconnect.

Change-Id: Ib6d7d25719f814b97ebd2cc4c33ff25dc32e1357
Bug-Url: http://bugzilla.redhat.com/1181233
Signed-off-by: Saggi Mizrahi <smizr...@redhat.com>
Reviewed-On: http://gerrit.ovirt.org/37018
Reviewed-on: http://gerrit.ovirt.org/36806
Reviewed-by: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Reviewed-by: Oved Ourfali <oourf...@redhat.com>
Reviewed-by: Yaniv Bronhaim <ybron...@redhat.com>
Tested-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M lib/yajsonrpc/stomp.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Yaniv Bronhaim: Verified; Looks good to me, approved
  Oved Ourfali: Looks good to me, but someone else must approve



-- 
To view, visit http://gerrit.ovirt.org/36806
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6d7d25719f814b97ebd2cc4c33ff25dc32e1357
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Saggi Mizrahi <smizr...@redhat.com>
Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to