summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/arch.h2
-rw-r--r--common/os_calls.h1
-rw-r--r--common/parse.h3
-rw-r--r--common/trans.c6
-rw-r--r--common/xrdp_constants.h3
5 files changed, 13 insertions, 2 deletions
diff --git a/common/arch.h b/common/arch.h
index b8780926..6a29b0a9 100644
--- a/common/arch.h
+++ b/common/arch.h
@@ -1,7 +1,7 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
- * Copyright (C) Jay Sorg 2004-2012
+ * Copyright (C) Jay Sorg 2004-2013
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/common/os_calls.h b/common/os_calls.h
index 2dbbe660..443a1840 100644
--- a/common/os_calls.h
+++ b/common/os_calls.h
@@ -125,6 +125,7 @@ int APP_CC g_get_errno(void);
int APP_CC g_execvp(const char* p1, char* args[]);
int APP_CC g_execlp3(const char* a1, const char* a2, const char* a3);
void APP_CC g_signal_child_stop(void (*func)(int));
+void APP_CC g_signal_segfault(void (*func)(int));
void APP_CC g_signal_hang_up(void (*func)(int));
void APP_CC g_signal_user_interrupt(void (*func)(int));
void APP_CC g_signal_kill(void (*func)(int));
diff --git a/common/parse.h b/common/parse.h
index 3ec37104..69a57ff8 100644
--- a/common/parse.h
+++ b/common/parse.h
@@ -56,6 +56,9 @@ struct stream
#define s_check_rem(s, n) ((s)->p + (n) <= (s)->end)
/******************************************************************************/
+#define s_check_rem_out(s, n) ((s)->p + (n) <= (s)->data + (s)->size)
+
+/******************************************************************************/
#define s_check_end(s) ((s)->p == (s)->end)
/******************************************************************************/
diff --git a/common/trans.c b/common/trans.c
index 0b672168..8313b606 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -221,8 +221,12 @@ trans_force_read_s(struct trans *self, struct stream *in_s, int size)
while (size > 0)
{
+ /* make sure stream has room */
+ if ((in_s->end + size) > (in_s->data + in_s->size))
+ {
+ return 1;
+ }
rcvd = g_tcp_recv(self->sck, in_s->end, size, 0);
-
if (rcvd == -1)
{
if (g_tcp_last_error_would_block(self->sck))
diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h
index b978d2de..a163df07 100644
--- a/common/xrdp_constants.h
+++ b/common/xrdp_constants.h
@@ -559,4 +559,7 @@
#define CMDTYPE_FRAME_MARKER 0x0004
#define CMDTYPE_STREAM_SURFACE_BITS 0x0006
+#define XRDP_MAX_BITMAP_CACHE_ID 3
+#define XRDP_MAX_BITMAP_CACHE_IDX 2000
+
#endif