From 51f8c8e930221cc5feeac4f84be5550b4e5be9dd Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 5 Dec 2014 15:54:20 +0100 Subject: Correct ugly boundary checks in database init The check if dbargc exceeds MAX_ARGUMENTS was done _after_ it was checked if the array element is NULL. This was not the intention. Signed-off-by: David Sommerseth --- plugin/eurephia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugin') diff --git a/plugin/eurephia.c b/plugin/eurephia.c index 03224f1..a716e1d 100644 --- a/plugin/eurephia.c +++ b/plugin/eurephia.c @@ -122,7 +122,7 @@ eurephiaCTX *eurephiaInit(const char const **argv, const char const **envp, // Put the rest of the arguments into an own array which will be the db module arguments if( optind < argc ) { // copy arguments, but make sure we do not exceed our limit - while( (optind < argc) && (dbargc < MAX_ARGUMENTS) ) { + while( (dbargc < MAX_ARGUMENTS) && (optind < argc) ) { dbargv[dbargc] = argv[optind++]; dbargc++; dbargv[dbargc] = NULL; -- cgit