mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-13 18:59:18 +02:00
SMB2: LockElement: Fixed a bug in ReadLockList / WriteLockList
This commit is contained in:
parent
519e574f94
commit
c08b425205
1 changed files with 2 additions and 2 deletions
|
@ -114,7 +114,7 @@ namespace SMBLibrary.SMB2
|
||||||
public static List<LockElement> ReadLockList(byte[] buffer, int offset, int lockCount)
|
public static List<LockElement> ReadLockList(byte[] buffer, int offset, int lockCount)
|
||||||
{
|
{
|
||||||
List<LockElement> result = new List<LockElement>();
|
List<LockElement> result = new List<LockElement>();
|
||||||
for(int lockIndex = 0; lockIndex > lockCount; lockIndex++)
|
for(int lockIndex = 0; lockIndex < lockCount; lockIndex++)
|
||||||
{
|
{
|
||||||
LockElement element = new LockElement(buffer, offset + lockIndex * StructureLength);
|
LockElement element = new LockElement(buffer, offset + lockIndex * StructureLength);
|
||||||
result.Add(element);
|
result.Add(element);
|
||||||
|
@ -124,7 +124,7 @@ namespace SMBLibrary.SMB2
|
||||||
|
|
||||||
public static void WriteLockList(byte[] buffer, int offset, List<LockElement> locks)
|
public static void WriteLockList(byte[] buffer, int offset, List<LockElement> locks)
|
||||||
{
|
{
|
||||||
for (int lockIndex = 0; lockIndex > locks.Count; lockIndex++)
|
for (int lockIndex = 0; lockIndex < locks.Count; lockIndex++)
|
||||||
{
|
{
|
||||||
LockElement element = locks[lockIndex];
|
LockElement element = locks[lockIndex];
|
||||||
element.WriteBytes(buffer, offset + lockIndex * StructureLength);
|
element.WriteBytes(buffer, offset + lockIndex * StructureLength);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue