aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os')
-rw-r--r--xorg-server/os/log.c3
-rw-r--r--xorg-server/os/strndup.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index 2697acec8..95bd8cca9 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -304,6 +304,9 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9') || f[f_idx] == '.'))
f_idx++;
+ if (f_idx >= f_len)
+ break;
+
switch (f[f_idx]) {
case 's':
string_arg = va_arg(args, char*);
diff --git a/xorg-server/os/strndup.c b/xorg-server/os/strndup.c
index b604b9bac..e0eddf13d 100644
--- a/xorg-server/os/strndup.c
+++ b/xorg-server/os/strndup.c
@@ -27,6 +27,10 @@
* SUCH DAMAGE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>