From 604490aa96efd0cf439b962a98313dc1ca9f6eae Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 9 Mar 2016 21:30:54 +0100 Subject: do not bork when receiving empty patterns --- src/system.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/system.cc b/src/system.cc index 47ea436..d7d0f71 100644 --- a/src/system.cc +++ b/src/system.cc @@ -182,6 +182,12 @@ void System::receive(void) break; case META2: rxExpect = DATA_FIRSTBLOCK; + /* + * skip empty patterns (would bork because of remaining_bytes-- + * otherwise + */ + if (remaining_bytes == 0) + rxExpect = NEXT_BLOCK; break; case DATA_FIRSTBLOCK: if (remaining_bytes == 0) { -- cgit v1.2.3