Module: kamailio
Branch: master
Commit: bbe0370939ff8a14e931595389b6678817ff1056
URL:
https://github.com/kamailio/kamailio/commit/bbe0370939ff8a14e931595389b6678…
Author: Ilya Shipitsin <chipitsine(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-06-28T16:45:54+02:00
utils/db_berkeley: access variable after null pointer check
---
Modified: utils/db_berkeley/kambdb_recover.c
---
Diff:
https://github.com/kamailio/kamailio/commit/bbe0370939ff8a14e931595389b6678…
Patch:
https://github.com/kamailio/kamailio/commit/bbe0370939ff8a14e931595389b6678…
---
diff --git a/utils/db_berkeley/kambdb_recover.c b/utils/db_berkeley/kambdb_recover.c
index 891cf2cfdc..30733a01ff 100644
--- a/utils/db_berkeley/kambdb_recover.c
+++ b/utils/db_berkeley/kambdb_recover.c
@@ -336,14 +336,14 @@ int recover(char* jfn)
return 2;
}
- tp = tbc->dtp;
-
- if(!tbc || !tp)
+ if(!tbc || !tbc->dtp)
{
fprintf(stderr, "[recover]: FAILED to get find metadata for : %s.\n", tn);
fclose(fp);
return 3;
}
+
+ tp = tbc->dtp;
while ( fgets(line , MAX_ROW_SIZE, fp) != NULL )
{