libsmb2 icon indicating copy to clipboard operation
libsmb2 copied to clipboard

Fixed "Implicit conversion loses integer precision" warning

Open amosavian opened this issue 1 year ago • 8 comments

This merge request changes varable types from int or unsigned int to platform dependent variables like ssize_t and size_t.

In few places where underlying SMB2 type is 32-bit length integer, an explicit type cast is added to silence the warning.

Also smb2_timeval.tv_sec became time_t in order to fix 2038 issue, and smb2_timeval.tv_sec to suseconds_t to make it generalized.

amosavian avatar Dec 01 '23 11:12 amosavian

It didn´t compile on both windows and linux!

Wolf3s avatar Dec 01 '23 11:12 Wolf3s

Both compiled successfully, but this request i think it´s not good, in some parts of the code

Wolf3s avatar Dec 01 '23 12:12 Wolf3s

Fixing this warning will possibly lead to another problems.

Wolf3s avatar Dec 01 '23 12:12 Wolf3s

My test cases in AMSMB2 run successfully. These changes should not lead to any issue as the the types are wider. Also some variables that contain length are became unsigned. I think that would be logical error if they became negative and could lead to an exploit. @Wolf3s

amosavian avatar Dec 01 '23 12:12 amosavian

Few conversion warnings still remains in MSVC, I think we should fix them too @Wolf3s

amosavian avatar Dec 01 '23 12:12 amosavian

Few conversion warnings still remains in MSVC, I think we should fix them too @Wolf3s

Yes it should, mainly on the x64 part.

Wolf3s avatar Dec 01 '23 12:12 Wolf3s

My test cases in AMSMB2 run successfully. These changes should not lead to any issue as the the types are wider. Also some variables that contain length are became unsigned. I think that would be logical error if they became negative and could lead to an exploit. @Wolf3s

So there is no exploit or logical error in this case.

Wolf3s avatar Dec 01 '23 12:12 Wolf3s

Plans to continue Or you will leave it?

Wolf3s avatar Jan 12 '24 23:01 Wolf3s