aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/rand
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/crypto/rand')
-rw-r--r--openssl/crypto/rand/rand_egd.c1
-rw-r--r--openssl/crypto/rand/rand_os2.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/openssl/crypto/rand/rand_egd.c b/openssl/crypto/rand/rand_egd.c
index 1b6e501b7..737aebfa2 100644
--- a/openssl/crypto/rand/rand_egd.c
+++ b/openssl/crypto/rand/rand_egd.c
@@ -113,6 +113,7 @@ int RAND_egd_bytes(const char *path, int bytes)
#else
# include <openssl/opensslconf.h>
# include OPENSSL_UNISTD
+# include <stddef.h>
# include <sys/types.h>
# include <sys/socket.h>
# ifndef NO_SYS_UN_H
diff --git a/openssl/crypto/rand/rand_os2.c b/openssl/crypto/rand/rand_os2.c
index 9c4a137bb..02148d5bf 100644
--- a/openssl/crypto/rand/rand_os2.c
+++ b/openssl/crypto/rand/rand_os2.c
@@ -149,6 +149,9 @@ int RAND_poll(void)
if (DosQuerySysState) {
char *buffer = OPENSSL_malloc(256 * 1024);
+ if(!buffer)
+ return 0;
+
if (DosQuerySysState(0x1F, 0, 0, 0, buffer, 256 * 1024) == 0) {
/*
* First 4 bytes in buffer is a pointer to the thread count there