Client: Bugfix: Reading FindInformationList may have caused infinite loop

This commit is contained in:
TalAloni 2020-09-04 16:13:55 +03:00
parent b59fb0917e
commit 0f43ef1f88

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
/* Copyright (C) 2014-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
*
* You can redistribute this program and/or modify it under the terms of
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -24,6 +24,10 @@ namespace SMBLibrary.SMB1
{
FindInformation entry = FindInformation.ReadEntry(buffer, offset, informationLevel, isUnicode);
this.Add(entry);
if (entry.NextEntryOffset == 0)
{
break;
}
offset += (int)entry.NextEntryOffset;
}
}