diff options
author | David Sommerseth <dazo@eurephia.org> | 2014-12-05 15:54:20 +0100 |
---|---|---|
committer | David Sommerseth <dazo@eurephia.org> | 2014-12-05 15:54:20 +0100 |
commit | 51f8c8e930221cc5feeac4f84be5550b4e5be9dd (patch) | |
tree | 273723250b69b159a4207047d842b3352c553d64 /plugin | |
parent | 6308228c754e9ad0fb33aa8830d0a0bc46736b20 (diff) | |
download | eurephia-51f8c8e930221cc5feeac4f84be5550b4e5be9dd.tar.gz eurephia-51f8c8e930221cc5feeac4f84be5550b4e5be9dd.tar.xz eurephia-51f8c8e930221cc5feeac4f84be5550b4e5be9dd.zip |
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 <dazo@eurephia.org>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/eurephia.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |