]> source.dussan.org Git - tigervnc.git/commit
Fix division by zero exception in SSecurityPlain. 1048/head
authorMark Mielke <mark.mielke@gmail.com>
Sat, 20 Jun 2020 10:15:39 +0000 (06:15 -0400)
committerMark Mielke <mark.mielke@gmail.com>
Tue, 7 Jul 2020 08:29:26 +0000 (04:29 -0400)
commit7932f5e483f790169a0d2da2a7cc73c76ca93817
tree5029a853bb170935858f5a8592cae04712c16449
parent38726ce083db1a9227325bf87989513499bfa698
Fix division by zero exception in SSecurityPlain.

If using SSecurityPlain and the user specifies an empty username
and password, it will invoke InStream::checkNoWait(0) which will
cause a division by zero when calculating the number of available
items.

Enhance InStream::check() to behave properly when asked for
zero items, or zero sized items.

Add comments to InStream::check(), InStream::checkNoWait(),
and InStream::readBytes() to document expected behaviour
when requested to check or read zero items, or an item with
zero size.
common/rdr/InStream.h