From 612ae3544723bfa6a632db405b814dcfa85ec68a Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 17 Apr 2008 16:46:18 +0000 Subject: [PATCH] Avoid a potential memory corruption on little-endian architectures --- src/appinterface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/appinterface.c b/src/appinterface.c index 0b0327a..117f6be 100644 --- a/src/appinterface.c +++ b/src/appinterface.c @@ -1116,6 +1116,11 @@ static int _post_exec_out(AppInterfaceCallArg * aica, char buf[], size_t buflen, Buffer * b; uint32_t size; + if(aica->size > buflen) + { + errno = ENOBUFS; + return -error_set_code(1, "%s", strerror(ENOBUFS)); + } switch(aica->type) { case AICT_VOID: