From acd0c7156c5baf2d0c13b21f198097f634e4f89e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 20 Sep 2019 19:22:47 +0200 Subject: [PATCH] return immediately if empty commands are sent --- src/sharedspice.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/sharedspice.c b/src/sharedspice.c index a492f3e1c..24352eee1 100644 --- a/src/sharedspice.c +++ b/src/sharedspice.c @@ -916,6 +916,16 @@ immediately */ IMPEXP int ngSpice_Command(char* comexec) { + /* Check if command is reasonable */ + if (comexec == NULL) { + fprintf(stderr, "Warning: Received command NULL, ignored"); + return 1; + } + if (*comexec == '\0') { + fprintf(stderr, "Warning: Received empty string as command, ignored"); + return 1; + } + if ( ! setjmp(errbufc) ) { immediate = FALSE;