Skip to content

Commit 54a4d8a

Browse files
committed
ows_layer_storage_fill(): fix crash when several bad configured layers are found
1 parent e1c2c18 commit 54a4d8a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ows/ows_storage.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,9 @@ static void ows_layer_storage_fill(ows * o, ows_layer * l, bool is_geom)
443443
PQclear(res);
444444

445445
ows_storage_fill_pkey(o, l);
446+
if( o->exit ) return;
446447
ows_storage_fill_attributes(o, l);
448+
if( o->exit ) return;
447449
ows_storage_fill_not_null(o, l);
448450
}
449451

@@ -501,6 +503,7 @@ void ows_layers_storage_fill(ows * o)
501503
if ( buffer_cmp(ln->layer->storage->schema, (char *) PQgetvalue(res, i, 0))
502504
&& buffer_cmp(ln->layer->storage->table, (char *) PQgetvalue(res, i, 1))) {
503505
ows_layer_storage_fill(o, ln->layer, true);
506+
if( o->exit ) break;
504507
filled = true;
505508
}
506509
}
@@ -509,12 +512,14 @@ void ows_layers_storage_fill(ows * o)
509512
if ( buffer_cmp(ln->layer->storage->schema, (char *) PQgetvalue(res_g, i, 0))
510513
&& buffer_cmp(ln->layer->storage->table, (char *) PQgetvalue(res_g, i, 1))) {
511514
ows_layer_storage_fill(o, ln->layer, false);
515+
if( o->exit ) break;
512516
filled = true;
513517
}
514518
}
515519

516520
if (!filled) {
517521
ows_layer_storage_fill(o, ln->layer, false);
522+
if( o->exit ) break;
518523
}
519524
}
520525

0 commit comments

Comments
 (0)