]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix modstack_call_init to use the original string when it has
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 29 Sep 2025 09:31:50 +0000 (11:31 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 29 Sep 2025 09:31:50 +0000 (11:31 +0200)
  changed, to call modstack_config with. And skip the changed name
  in the string correctly. Thanks to Jan Komissar.

doc/Changelog
services/modstack.c

index f906c9fc67868f3527006b927be458b86c61ac57..261708b8540051a215b3b223a9c4d22cfc0e252b 100644 (file)
@@ -1,5 +1,8 @@
 29 September 2025: Wouter
        - Rebuild configure script from its sources.
+       - Fix modstack_call_init to use the original string when it has
+         changed, to call modstack_config with. And skip the changed name
+         in the string correctly. Thanks to Jan Komissar.
 
 26 September 2025: Yorgos
        - Test for nonstring attribute in configure and add
index 2bc79c4adfd77456ea62d42e6025b7ca9b1c963e..f5913dc387c9ca65750ef7f1c357f051effb5217 100644 (file)
@@ -262,6 +262,7 @@ int
 modstack_call_init(struct module_stack* stack, const char* module_conf,
        struct module_env* env)
 {
+       const char* orig_module_conf = module_conf;
         int i, changed = 0;
         env->need_to_validate = 0; /* set by module init below */
         for(i=0; i<stack->num; i++) {
@@ -276,11 +277,13 @@ modstack_call_init(struct module_stack* stack, const char* module_conf,
                                changed = 1;
                        }
                }
-               module_conf += strlen(stack->mod[i]->name);
+               /* Skip this module name in module_conf. */
+               while(*module_conf && !isspace((unsigned char)*module_conf))
+                       module_conf++;
        }
        if(changed) {
                modstack_free(stack);
-               if(!modstack_config(stack, module_conf)) {
+               if(!modstack_config(stack, orig_module_conf)) {
                        return 0;
                }
        }