Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection error not handled correctly in requestContentsOfDirectoryAtFilePath #54

Open
jimkeir opened this issue Nov 21, 2017 · 1 comment

Comments

@jimkeir
Copy link

jimkeir commented Nov 21, 2017

Hardware / Software

Which version of the library were you using?
1.0.8, from pod

Which version of iOS are you running?
11

What model of iOS device were you testing on?
iPad Air 2

If using CocoaPods, which version of CocoaPods are you on?
1.3.1

In TOSMBSession.m, lines 291-3 are:
smb_tid shareID = -1;
smb_tree_connect(self.session, cStringName, &shareID);
if (shareID < 0) {

The bundled version of smb_share.h declares shareID as smb_tid, and smb_types.h declares this as uint16_t . The comparison "shareID < 0" is never true, because the range of values of uint16_t is 0 -> 65535 . Use the return code of smb_tree_connect, which is signed int, instead of the smb_tid.

@TimOliver
Copy link
Owner

Oh! Nicely spotted! Thanks! I'll need to fix that when I get the chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants