Skip to content

Commit f42d21a

Browse files
committed
Fix infinite loop issue in TextSocketHelper.ReadLine
1 parent b2bf7c3 commit f42d21a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Enyim.Caching/Memcached/Protocol/Text/TextSocketHelper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ private static string ReadLine(PooledSocket socket)
6868
{
6969
data = socket.ReadByte();
7070

71+
if (data == -1)
72+
{
73+
return string.Empty;
74+
}
75+
7176
if (data == 13)
7277
{
7378
gotR = true;

0 commit comments

Comments
 (0)