libcli: continue to read from the socket even if the size is 0
commit43e5b94448a8a4a1f772901433f8c30fd95809ed
authorMatthieu Patou <mat@matws.net>
Thu, 19 Sep 2013 18:18:32 +0000 (19 11:18 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 20 Sep 2013 09:05:42 +0000 (20 11:05 +0200)
treefe5e8a18d489aa07dc27ff28b70b5cdfbc232284
parentf7a9cb0eca0b2b2ed07e49ef56cd35dded3b2fe5
libcli: continue to read from the socket even if the size is 0

This is an issue found by Codenomicon, with a malicious packet with 0
bytes UDP payload we will continiously be looping trying to react from
the socket event and continiously do nothing as we will bail out
thinking that we had a memory allocation error.

Original fix comes from Volker Lendecke <vl@samba.org>

Signed-off-by: Matthieu Patou <mat@matws.net>
Fix bug #10158 - netbios related samba process consume 100% CPU.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Fri Sep 20 11:05:42 CEST 2013 on sn-devel-104
source4/libcli/dgram/dgramsocket.c