Commit Graph

2493 Commits

Author SHA1 Message Date
Armin Novak
58d5c5f7d1 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak
0b82768a70 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak
70e37746cb Fixed sign-compare warnings 2019-04-05 09:13:25 +02:00
Armin Novak
cfdcaa2653 Fixed sign-compare warnings 2019-04-05 09:13:25 +02:00
Armin Novak
309fe960f7 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
b5a7e4d9b9 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
279a5fe39f Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
6f3808a224 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
699d7d1462 Fixed _config_size return 2019-04-05 09:13:24 +02:00
Armin Novak
b7ac5b9bc8 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
7dfc453858 Cast SEC_* return values to HRESULT (Same as WIN32 API) 2019-04-05 09:13:24 +02:00
Armin Novak
9757d536c3 Case SCARD_* return values to HRESULT (Same as WIN32 API) 2019-04-05 09:13:24 +02:00
Armin Novak
25751517e5 Cast E_* errors to HRESULT (same as defined in WIN32 API) 2019-04-05 09:13:24 +02:00
David Fort
37358e81d0
Merge pull request #5285 from akallabeth/urbdrc_preparations
Channel, log debug and semaphore related fixes
2019-04-04 18:21:47 +02:00
David Fort
a63f717871
Merge pull request #5309 from smaeul/patch/ntlm
Fix NTLM AvPair lists
2019-04-04 18:19:56 +02:00
David Fort
058ae0db57
Merge pull request #5273 from akallabeth/mac_compile_warning_fix
Fixed mac compilation warnings.
2019-04-04 18:03:50 +02:00
Armin Novak
745c6b933a Fixed \0 terimination of clipboard file list 2019-04-03 10:17:51 +02:00
David Fort
c5156443e7
Merge pull request #5281 from akallabeth/assistance_ssl_init_fix
Fixed #5276: Enable SSL before parsing assistance file.
2019-03-28 19:04:25 +01:00
Samuel Holland
6931f54fad Fix NTLM AvPair lists
There were two main issues here: First, the `ntlm_av_pair_add` and
`ntlm_av_pair_add_copy` were not adding a new `MsvAvEOL` to the end of
the list to replace the one they overwrote. This caused the second call
to one of those functions to fail (since it couldn't find the
terminator), which was the source of the test failure. It also caused
`ntlm_av_pair_list_length` and `ntlm_print_av_pair_list` to read out of
bounds until they happened to find the right word.

Second, several bounds checks were wrong or missing. For example,
`ntlm_av_pair_add` does not ensure that the value fits inside the list.
And `ntlm_av_pair_get_len` and `ntlm_av_pair_get_value_pointer` can
return error codes or NULL, but those error returns were ignored, and
the values used anyway (such as in `ntlm_av_pair_add_copy`).

This fixes the list handling code to have the invariant that all
functions returning `NTLM_AV_PAIR*` only return non-`NULL` if the entire
returned `AvPair` is within bounds. This removes the need for the length
parameter in functions that only operate on a single `AvPair`. This
check is performed by the new `ntlm_av_pair_check` helper, which is
added in some new places and used to simplify the code in others.

Other issues fixed along the way include:
 - `ntlm_av_pair_list_length` did not cast to `PBYTE`, so it was
   returning the number of `NTLM_AV_PAIR`-sized chunks (which was
   possibly not even an integer) instead of the number of bytes
 - I removed an impossible check for `offset <= 0` in
   `ntlm_av_pair_get_next_pointer`
 - The assertion that `Value != NULL` and the call to `CopyMemory` are
   only necessary if `AvLen` is nonzero
 - `ntlm_av_pair_get_next_pointer` (renamed to `ntlm_av_pair_next`)
   could be declared `static`

With this commit, TestNTLM now passes on powerpc64.

```
$ ./Testing/TestSspi TestNTLM
NTLM_NEGOTIATE (length = 40):
NTLM_CHALLENGE (length = 168):
NTLM_AUTHENTICATE (length = 352):
$ echo $?
0
```

Fixes #5250
2019-03-17 20:40:13 -05:00
Armin Novak
e5fbff357e Fixed Stream_* macros, bracing arguments. 2019-03-07 09:29:32 +01:00
MartinHaimberger
46b1e88a70
Merge pull request #5027 from akallabeth/wlog_off_fix
Fix #5024: Update inherited log level for all child loggers when setting a new one.
2019-02-28 10:55:12 +01:00
Armin Novak
e9c4173c9b Fixed winpr_HexLogDump line length calculation. 2019-02-28 09:54:05 +01:00
Armin Novak
bff5ded654 Better bounds checks for winpr_HexLogDump 2019-02-28 08:50:44 +01:00
Armin Novak
4e31cf929e Fixed ReleaseSemaphore, respect lReleaseCount
Signal the semapore lReleaseCount times.
2019-02-26 15:33:51 +01:00
Armin Novak
982ee67a4c Initialize ppKeys to NULL in HashTable_GetKeys
Ensure ppKeys=NULL in case of a function failure or empty table.
2019-02-26 15:32:22 +01:00
Armin Novak
32aa11251b Added a logger dump function operating on a preallocated logger. 2019-02-26 15:31:47 +01:00
Armin Novak
49936a7ba6 Fixed #5276: Enable SSL before parsing assistance file.
The assistance file requires primitives from the ssl wrapper.
Enable these before parsing the file.
Additionally split the FIPS mode enablement from the one time
initializer to avoid ignoring that flag.
2019-02-25 10:37:30 +01:00
Armin Novak
9566ae0e90 Fixed mac compilation warnings. 2019-02-21 17:30:12 +01:00
Armin Novak
32e5407b43 Ignore INVALID_HANDLE_VALUE during clang scanbuild runs.
The value INVALID_HANDLE_VALUE could in theory be a valid memory address,
so the analyzer is confused and thinks either we have a memroy leak
or we try to free a fixed address.
2019-02-21 12:21:51 +01:00
Armin Novak
41d382569c Respect return value from SetEvent and abort creation. 2019-02-21 12:21:51 +01:00
Martin Fleisz
3169b77d70
Merge pull request #5230 from akallabeth/sign_compare_fixes
Sign compare fixes
2019-02-08 09:35:50 +01:00
Armin Novak
22eddef668 Fixed wide character comparison. 2019-02-08 09:20:58 +01:00
Martin Fleisz
6415cfec48
Merge pull request #5131 from akallabeth/cmd_line_error_logging
Added extended error logging for assistance, rdp file and command line parser
2019-02-08 09:11:35 +01:00
Bernhard Miklautz
162a69b0f0
Merge pull request #5139 from akallabeth/drive_hotplug_shutdown_crash_fix
Fixed crash on drive hotplug shutdown.
2019-02-07 10:08:41 +01:00
Armin Novak
3679eefbd4 Fixed BipBuffer Read/Write, limit to SSIZE_MAX. 2019-01-30 18:05:49 +01:00
Armin Novak
650f63c7ca Added missing SSIZE_MAX define 2019-01-30 18:05:49 +01:00
Armin Novak
9c5c722aaa Fixed use of ASCII function on WCHAR 2019-01-30 18:05:49 +01:00
Armin Novak
221cb48e2d Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
585391dfbf Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
2bd43398e8 Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
f39ec7c453 Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
fe9dcfacca Fixed NULL dereferences and uninitialized values 2019-01-30 16:11:10 +01:00
Armin Novak
c00010478c Fix FindNextFileA path termination with a single separator. 2019-01-30 15:44:45 +01:00
Armin Novak
9033df501e Fixed compiler warnings for TRIO_CONST and limited data type. 2019-01-29 17:51:44 +01:00
Armin Novak
2e5fd8d16b Fixed clang analyzer false positive memory leaks.
Added a justification for each #ifndef __clang_analyzer__
2019-01-29 17:17:30 +01:00
akallabeth
0a8ebcfcac
Merge pull request #5187 from astrand/mingw-part1
Mingw build fixes part1
2019-01-29 10:46:21 +01:00
David Fort
ad75ae512c
Merge pull request #5200 from akallabeth/os2_fixes
Os2 fixes
2019-01-18 18:04:23 +01:00
Armin Novak
4f1462b73b Added fix for OS2 paths.
Reported on mailing list by Andrey Vasilkin
2019-01-18 13:13:41 +01:00
Armin Novak
b08505cbe0 Fixed return check in SwitchToThread
Patch on mailing list by Andrey Vasilkin
2019-01-18 13:02:30 +01:00
Armin Novak
4d4f3617bd Fixed memory leak in lodepng. 2019-01-16 15:23:12 +01:00