Skip to content

Commit 37d7f1d

Browse files
Fix alignment for NetShareEnum request handling
The missing alignment meant that the info level was being misread if the host name of the server had an even number of characters, because in that case the end of the string ended up not being 4-byte-aligned. This meant that the info level was being misread as e.g. 65536 instead of 1, which had the ultimate result that instead of success and a list of the available shares, an error message would be sent back and the server couldn't be accessed.
1 parent 4363869 commit 37d7f1d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/filesys/smb/dcerpc/server/SrvsvcDCEHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ protected final boolean netShareEnum(SMBSrvSession sess, DCEBuffer inBuf, DCEBuf
140140

141141
try {
142142
inBuf.skipPointer();
143-
srvName = inBuf.getString();
143+
srvName = inBuf.getString(DCEBuffer.ALIGN_INT);
144144
shrInfo = new ShareInfoList(inBuf);
145145
}
146146
catch (DCEBufferException ex) {

0 commit comments

Comments
 (0)