... | ... |
@@ -1330,7 +1330,7 @@ static int lsigattribs(char *attribs, struct cli_lsig_tdb *tdb) |
1330 | 1330 |
mpool_free(x->mempool, x->macro_ptids);\ |
1331 | 1331 |
} while(0); |
1332 | 1332 |
|
1333 |
-static int init_tdb(struct cli_lsig_tdb *tdb, struct cl_engine *engine, char *target, const char *virname) |
|
1333 |
+static inline int init_tdb(struct cli_lsig_tdb *tdb, struct cl_engine *engine, char *target, const char *virname) |
|
1334 | 1334 |
{ |
1335 | 1335 |
int ret; |
1336 | 1336 |
|
... | ... |
@@ -1464,53 +1464,11 @@ static int load_oneldb(char *buffer, int chkpua, struct cl_engine *engine, unsig |
1464 | 1464 |
|
1465 | 1465 |
/* TDB */ |
1466 | 1466 |
memset(&tdb, 0, sizeof(tdb)); |
1467 |
-#ifdef USE_MPOOL |
|
1468 |
- tdb.mempool = engine->mempool; |
|
1469 |
-#endif |
|
1470 |
- if((ret = lsigattribs(tokens[1], &tdb))) { |
|
1471 |
- FREE_TDB(tdb); |
|
1472 |
- if(ret == 1) { |
|
1473 |
- cli_dbgmsg("cli_loadldb: Not supported attribute(s) in logical signature for %s, skipping\n", virname); |
|
1474 |
- (*sigs)--; |
|
1475 |
- return CL_SUCCESS; |
|
1476 |
- } |
|
1477 |
- return CL_EMALFDB; |
|
1478 |
- } |
|
1479 |
- |
|
1480 |
- if(tdb.engine) { |
|
1481 |
- if(tdb.engine[0] > cl_retflevel()) { |
|
1482 |
- cli_dbgmsg("cli_loadldb: Signature for %s not loaded (required f-level: %u)\n", virname, tdb.engine[0]); |
|
1483 |
- FREE_TDB(tdb); |
|
1484 |
- (*sigs)--; |
|
1485 |
- return CL_SUCCESS; |
|
1486 |
- } else if(tdb.engine[1] < cl_retflevel()) { |
|
1487 |
- FREE_TDB(tdb); |
|
1488 |
- (*sigs)--; |
|
1489 |
- return CL_SUCCESS; |
|
1490 |
- } |
|
1491 |
- } |
|
1492 |
- |
|
1493 |
- if(!tdb.target) { |
|
1494 |
- cli_errmsg("cli_loadldb: No target specified in TDB\n"); |
|
1495 |
- FREE_TDB(tdb); |
|
1496 |
- return CL_EMALFDB; |
|
1497 |
- } else if(tdb.target[0] >= CLI_MTARGETS) { |
|
1498 |
- cli_dbgmsg("cli_loadldb: Not supported target type in logical signature for %s, skipping\n", virname); |
|
1499 |
- FREE_TDB(tdb); |
|
1467 |
+ if ((ret = init_tdb(&tdb, engine, tokens[1], virname)) != CL_SUCCESS) { |
|
1500 | 1468 |
(*sigs)--; |
1501 |
- return CL_SUCCESS; |
|
1502 |
- } |
|
1503 |
- |
|
1504 |
- if((tdb.icongrp1 || tdb.icongrp2) && tdb.target[0] != 1) { |
|
1505 |
- cli_errmsg("cli_loadldb: IconGroup is only supported in PE (target 1) signatures\n"); |
|
1506 |
- FREE_TDB(tdb); |
|
1507 |
- return CL_EMALFDB; |
|
1508 |
- } |
|
1509 |
- |
|
1510 |
- if((tdb.ep || tdb.nos) && tdb.target[0] != 1 && tdb.target[0] != 6 && tdb.target[0] != 9) { |
|
1511 |
- cli_errmsg("cli_loadldb: EntryPoint/NumberOfSections is only supported in PE/ELF/Mach-O signatures\n"); |
|
1512 |
- FREE_TDB(tdb); |
|
1513 |
- return CL_EMALFDB; |
|
1469 |
+ if (ret == CL_BREAK) |
|
1470 |
+ return CL_SUCCESS; |
|
1471 |
+ return ret; |
|
1514 | 1472 |
} |
1515 | 1473 |
|
1516 | 1474 |
root = engine->root[tdb.target[0]]; |