aboutsummaryrefslogtreecommitdiffstats
path: root/lib/odbc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/odbc')
-rw-r--r--lib/odbc/aclocal.m42
-rw-r--r--lib/odbc/c_src/odbcserver.c12
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/odbc/aclocal.m4 b/lib/odbc/aclocal.m4
index aeb31fa58a..46b30a16b3 100644
--- a/lib/odbc/aclocal.m4
+++ b/lib/odbc/aclocal.m4
@@ -1423,7 +1423,7 @@ case "$THR_LIB_NAME" in
AC_DEFINE(ETHR_X86_OUT_OF_ORDER, 1, [Define if x86/x86_64 out of order instructions should be synchronized])
fi
ethr_have_native_atomics=yes;;
- macppc | ppc | "Power Macintosh")
+ macppc | ppc | powerpc | "Power Macintosh")
ethr_have_native_atomics=yes;;
tile)
ethr_have_native_atomics=yes;;
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c
index 5730e20774..8de81a30ae 100644
--- a/lib/odbc/c_src/odbcserver.c
+++ b/lib/odbc/c_src/odbcserver.c
@@ -277,11 +277,15 @@ int main(void)
msg = receive_erlang_port_msg();
temp = strtok(msg, ";");
+ if (temp == NULL)
+ DO_EXIT(EXIT_STDIN_BODY);
length = strlen(temp);
supervisor_port = safe_malloc(length + 1);
strcpy(supervisor_port, temp);
temp = strtok(NULL, ";");
+ if (temp == NULL)
+ DO_EXIT(EXIT_STDIN_BODY);
length = strlen(temp);
odbc_port = safe_malloc(length + 1);
strcpy(odbc_port, temp);
@@ -1819,12 +1823,20 @@ static byte * receive_erlang_port_msg(void)
len |= lengthstr[i];
}
+ if (len <= 0 || len > 1024) {
+ DO_EXIT(EXIT_STDIN_HEADER);
+ }
+
buffer = (byte *)safe_malloc(len);
if (read_exact(buffer, len) <= 0) {
DO_EXIT(EXIT_STDIN_BODY);
}
+ if (buffer[len-1] != '\0') {
+ DO_EXIT(EXIT_STDIN_BODY);
+ }
+
return buffer;
}