Fix potential loop when requesting attribute data.
authorSimo Sorce <simo@redhat.com>
Thu, 14 Jan 2016 15:24:17 +0000 (10:24 -0500)
committerSimo Sorce <simo@redhat.com>
Thu, 14 Jan 2016 15:24:17 +0000 (10:24 -0500)
If this function fail we are better off abandoning the whole quest, continueing
here may end us up in an infinite loop where the fucntion keeps failing w/o
changing attr.more

Thanks to Alejandro Perez for finding this flaw.

Signed-off-by: Simo Sorce <simo@redhat.com>
src/environ.c

index 1ea72e0..f9bbf30 100644 (file)
@@ -214,7 +214,7 @@ void mag_get_name_attributes(request_rec *req, struct mag_config *cfg,
             attr.value = empty_buffer;
             attr.display_value = empty_buffer;
 
-            if (!mag_get_name_attr(req, name, &attr)) continue;
+            if (!mag_get_name_attr(req, name, &attr)) break;
 
             if (cfg->name_attributes->output_json) {
                 mag_add_json_name_attr(req, i == 0, &attr, &json);