Commit Graph

1319 Commits

Author SHA1 Message Date
Baruch Siach
81fc2c9740 Don't disable C99 long double math on non Unix platforms
CMakeLists.txt may enable HAVE_MATH_C99_LONG_DOUBLE only on Unix platforms.
Limit the effect of this symbol accordingly.
2015-05-05 21:27:17 +03:00
Marc-André Moreau
70ecd9b619 Merge pull request #2589 from baruchsiach/fix-math
Don't use unavailable C99 long double math functions
2015-05-05 10:47:03 -04:00
MartinHaimberger
9a4f645f78 Merge pull request #2582 from nfedera/fix-2015-04-28-01
Fix unchecked CreateEvent calls and misc fixes
2015-05-04 10:14:27 +02:00
Baruch Siach
414663cc36 Don't use unavailable C99 long double math functions
uClibc variants do not provide the C99 long double math functions like ceill,
powl, etc.. For future compatibility use check_symbol_exists() to check
whether these functions are available, and keep the result in
HAVE_MATH_C99_LONG_DOUBLE. Use that instead of the fragile Cygwin version
check in triodef.h.

Fixes build failures under uClibc(-ng) like:

../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `powl'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `fmodl'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `ceill'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `log10l'
../../libwinpr/utils/libwinpr-utils.so.0.1.0: undefined reference to `floorl'
collect2: error: ld returned 1 exit status

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2015-05-03 21:12:30 +03:00
Bernhard Miklautz
dd2e7f393d Merge pull request #2584 from baruchsiach/fix-eventfd-2
Fix build with newer uclibc versions
2015-04-30 14:20:33 +02:00
Baruch Siach
3b7d3190a1 Fix build with newer uclibc versions
uClibc master branch, as well as uclibc-ng add eventfd_{read,write}
definitions. Instead of testing for __UCLIBC__, have cmake explicitly check
for the existence of eventfd_read and save the result in
WITH_EVENTFD_READ_WRITE.

Fixes build errors like:

.../winpr/libwinpr/synch/event.c:120:12: error: static declaration of 'eventfd_read' follows non-static declaration
 static int eventfd_read(int fd, eventfd_t* value)
            ^
In file included from .../winpr/libwinpr/synch/event.c:39:0:
.../usr/include/sys/eventfd.h:37:12: note: previous declaration of 'eventfd_read' was here
 extern int eventfd_read (int __fd, eventfd_t *__value);
            ^
.../winpr/libwinpr/synch/event.c:125:12: error: static declaration of 'eventfd_write' follows non-static declaration
 static int eventfd_write(int fd, eventfd_t value)
            ^
In file included from .../winpr/libwinpr/synch/event.c:39:0:
.../usr/include/sys/eventfd.h:40:12: note: previous declaration of 'eventfd_write' was here
 extern int eventfd_write (int __fd, eventfd_t __value);
2015-04-29 20:31:25 +03:00
Norbert Federa
ef1fd12b15 Fix unchecked CreateEvent calls and misc fixes
1)
Added missing checks for CreateEvent which also required the
following related changes:

- changed freerdp_context_new API to BOOL
- changed freerdp_peer_context_new API to BOOL
- changed pRdpClientNew callback to BOOL
- changed pContextNew callback to BOOL
- changed psPeerAccepted callback to BOOL
- changed psPeerContextNew callback to BOOL

2)
Fixed lots of missing alloc and error checks in the
changed code's neighbourhood.

3)
Check freerdp_client_codecs_prepare result to avoid segfaults
caused by using non-initialized codecs.

4)
Fixed deadlocks in x11 caused by missing xf_unlock_x11() calls
in some error handlers

5)
Some fixes in thread pool:
- DEFAULT_POOL assignment did not match TP_POOL definition
- don't free the pool pointer if it points to the static DEFAULT_POOL
- added error handling and cleanup in InitializeThreadpool
2015-04-29 18:18:39 +02:00
Armin Novak
b7fccafb94 Added EBUSY to success states. 2015-04-29 08:48:07 +02:00
Armin Novak
07ee198203 Better error handling on mutex destroy. 2015-04-28 17:31:27 +02:00
Armin Novak
fe27913859 Ensuring mutex is unlocked on destroy. 2015-04-28 09:42:46 +02:00
Armin Novak
ac15ce2da8 Added mutex debug flag.
When mutex debugging is enabled now a stack trace
is logged, if a mutex is locked on destruction.
2015-04-28 08:55:49 +02:00
Bryan Everly
cb66f3ee70 Removed compiler warning about obsolete header file in OpenBSD 2015-04-22 09:50:50 -04:00
Bernhard Miklautz
d5e7314392 Merge pull request #2564 from akallabeth/pthread_mutex_timedjoin_detection
Fixed pthread_mutex_timedjoin detection.
2015-04-22 14:42:31 +02:00
Hardening
6cd7713e12 Merge pull request #2544 from bmiklautz/boolenization
change return types of callbacks to BOOL
2015-04-22 11:01:27 +02:00
Armin Novak
5911332dfe Fixed pthread_mutex_timedjoin detection. 2015-04-22 09:32:59 +02:00
Bryan Everly
d31301f73f Modified code to use bulitin pthread functions on OpenBSD 2015-04-21 16:14:56 -04:00
Bryan Everly
8c75127a67 Necessary changes to get latest branch working on OpenBSD 5.6 2015-04-21 14:42:06 -04:00
Bernhard Miklautz
c9ee30a815 TestStream: set function parameters to void 2015-04-21 14:25:59 +02:00
Bernhard Miklautz
61473923e4 TestStream: fix compiler warning
Remove unnecessary argument from read function call.
2015-04-21 14:16:33 +02:00
Armin Novak
ad41fc59a3 Fixed reading bitmap from buffer. 2015-04-20 15:13:23 +02:00
Armin Novak
7990ea6371 Added proper bitmap and png image test. 2015-04-19 12:29:28 +02:00
Armin Novak
e5cdd8a299 Fixed bitmap reading bug. 2015-04-19 12:29:17 +02:00
Armin Novak
813e75e14d Fixed NULL dereference. 2015-04-16 22:04:38 +02:00
Armin Novak
60de56e1bb Fixed NULL dereference and double free 2015-04-16 21:56:57 +02:00
Armin Novak
276757c082 Fixed NULL dereference 2015-04-16 21:56:26 +02:00
Armin Novak
0d9bcb63b7 Fixed memory leaks and NULL dereferences. 2015-04-16 21:39:25 +02:00
Bernhard Miklautz
1093f647d3 ObjectPool: fix regression
winpr allocation checks introduced a problem that lead to zero size
allocations in ObjectPool
2015-04-14 13:47:23 +02:00
Bernhard Miklautz
a8c44f15c0 winpr: small fixes and cleanups
Update the pull request and integrate the latest comments and
suggestions.

* TestLibrary*: fix typo in error message
* TestPipeCreateNamedPipeOverlapped: free possibly allocated memory
* smartcard_pcsc.c: format fix
* process.c: add missing NULL check
* MessageQueue.c: delete possibly initialized critical section on error
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
12e1d94567 winpr: fixes and cleanup
Integrated notes and issues for the pending pull request
* wf_info:
 * cleanup: remove unnecessary breaks
 * fix typo
 * change usage of calloc
* print.c: fix incorrect check
* makecert.c: cleanup includes
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
850de59b55 winpr: add checks for *alloc
Add missing checks if memory allocation was successful. Also adapt
caller(s) when possible.
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
20e2774aa8 comm/tests: set label comm
Set the comm label to all comm related test that they can be excluded
more easily.
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
b8e41b843d aligned memory: fixes in _aligned_offset_recalloc
* _aligned_offset_recalloc did ignore the nmemb element
  therefore only *one* element was allocated
* in case memblock was NULL the allocated memory
  wasn't zeroed
* restructure realloc and recalloc to check if the memory was initially
  created aligned before allocating a new segment
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
5692117f8c wlog: add missing check
Integrate pull request feedback
2015-03-31 15:20:10 +02:00
Armin Novak
71d4b81c6d Removed scopes. 2015-03-31 15:18:46 +02:00
Armin Novak
b1edaf677b Removed duplicated NULL pointer checks. 2015-03-31 15:18:46 +02:00
Armin Novak
d50ce6bd7a Corrected end of string checks. 2015-03-31 15:18:46 +02:00
Armin Novak
853ac63afd Removed INVALID_HANDLE_VALUE. 2015-03-31 15:18:46 +02:00
Armin Novak
bd55b0df80 Removed INVALID_HANDLE_VALUE from types not using it. 2015-03-31 15:18:45 +02:00
Armin Novak
b3ea02a777 Removed INVALID_HANDLE_VALUE from types not using it. 2015-03-31 15:18:45 +02:00
Armin Novak
afe8bd2a86 Fixed missing checks for invalid handle. 2015-03-31 15:18:45 +02:00
Hardening
bdb975afe8 Merge pull request #2510 from akallabeth/build_date
Added version and build info functions
2015-03-30 19:14:59 +02:00
Armin Novak
8e521e7aee Fixed return value in test. 2015-03-30 18:18:14 +02:00
Armin Novak
eedf45583a Using sprintf_s now. 2015-03-30 18:17:07 +02:00
Armin Novak
0adab13719 Now returning const char* 2015-03-30 18:09:02 +02:00
Armin Novak
cf941304b3 Fixed windows _snprintf. 2015-03-30 18:05:46 +02:00
Armin Novak
8f228163a8 Added version and build info functions
Added functions to get
 * Version String
 * Build Time String
 * Git Revision String
and appropriate tests.
2015-03-30 17:51:29 +02:00
Bernhard Miklautz
74c8400789 coding style fixes
Add missing space after if
2015-03-30 17:15:45 +02:00
Bernhard Miklautz
f469e069dc stream: Stream_Ensure*Capacity: change return type
Change the return type of Stream_Ensure*Capacity from void to BOOL to be
able to detect realloc problems easily. Otherwise the only way to detect
this was to check if the capacity after the call was >= the required
size.
In case Stream_Ensure*Capacity fails the old memory is still available
and need to freed outside.

This commit also adds checks to most calls of Stream_Ensure*Capacity to
check if the call was successful.
2015-03-30 16:33:48 +02:00
Bernhard Miklautz
1d7b3694a9 Integrate feedback from pull request (#2492)
* shell: add missing NULL checks
* thread: handle case where HAVE_EVENTFD_H isn't defined
* wlog: return NULL instead of 0
* wlog: use g_RootLog instead of WLog_GetRoot
  otherwise a new root might be initialized on uninit
* indentation and style fixes
2015-03-25 17:38:21 +01:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00