From 4be410bfa46c7fe3faadcd8b4f5d93b601d287fa Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Fri, 6 Nov 2015 16:09:19 +0000 Subject: [PATCH] ARPCPrint: fix segfault caused by vfprintf Some format strings in VS_ARPC messages makes vfprintf crash, but not the fprintf path in ARPCPrint. So remove the vfprintf. It has the benefit that we don't need special handling of non-vfprintf platforms anymore. --- mme/ARPCPrint.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/mme/ARPCPrint.c b/mme/ARPCPrint.c index e737f146..840a8978 100644 --- a/mme/ARPCPrint.c +++ b/mme/ARPCPrint.c @@ -107,23 +107,9 @@ void ARPCPrint (FILE * fp, void const * memory, size_t extent) *argp = LE32TOH (*argp); argp++; } - -#if defined (__UCLIBC__) - -/* - * This is a simple fix to work around uclibc implementation issue with variable arugment lists; We are - * testing a better one but most PLC users will not have access to firmware that exercises this module; - */ - argp = (uint32_t *)(&data->LIST [LE16TOH (data->ARGOFFSET)]); fprintf (fp, (char *)(&data->LIST [LE16TOH (data->STROFFSET)]), argp [0], argp [1], argp [2], argp [3], argp [4], argp [5], argp [6], argp [7], argp [8], argp [9], argp [10], argp [11], argp [12], argp [13], argp [14], argp [15], argp [16], argp [17], argp [18], argp [19], argp [20], argp [21], argp [22], argp [23], argp [24], argp [25], argp [26], argp [27], argp [28], argp [29], argp [30], argp [31], argp [32], argp [33], argp [34], argp [35], argp [36], argp [37], argp [38], argp [39]); -#else - - vfprintf (fp, (char *)(&data->LIST [LE16TOH (data->STROFFSET)]), (void *)(&data->LIST [LE16TOH (data->ARGOFFSET)])); - -#endif - fprintf (fp, "\n"); fflush (fp); return;