diff options
author | David Timber <mieabby@gmail.com> | 2020-09-03 16:30:07 +0930 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2020-09-03 16:30:07 +0930 |
commit | 1aa37a98e47335e283d08a7798bd8e0d2eda7227 (patch) | |
tree | 019b3853e9e890e9ce2f4af22d99012d122a9b8d | |
parent | 55f73d9c963cdd1ddda8741e178d0930b99e2eb8 (diff) |
* [proone] prne_s_g null check
-rw-r--r-- | src/mbedtls.c | 2 | ||||
-rw-r--r-- | src/proone.c | 10 | ||||
-rw-r--r-- | src/proone.h | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/mbedtls.c b/src/mbedtls.c index bda22c4..3b1c49f 100644 --- a/src/mbedtls.c +++ b/src/mbedtls.c @@ -13,7 +13,7 @@ int prne_mbedtls_x509_crt_verify_cb (void *param, mbedtls_x509_crt *crt, int crt_depth, uint32_t *flags) { - *flags &= ~MBEDTLS_X509_BADCERT_EXPIRED; + *flags &= ~(uint32_t)MBEDTLS_X509_BADCERT_EXPIRED; return 0; } diff --git a/src/proone.c b/src/proone.c index baf8132..29691fa 100644 --- a/src/proone.c +++ b/src/proone.c @@ -774,7 +774,7 @@ int main (const int argc, const char **args) { if (prne_g.child_pid > 0) { static int status; - static bool has_ny_bin; + static bool has_ny_bin = false; static int caught_signal = 0; prne_dbgpf("* Child: %d\n", prne_g.child_pid); @@ -799,10 +799,12 @@ int main (const int argc, const char **args) { } } while (false); - has_ny_bin = strlen(prne_s_g->ny_bin_path) > 0; + if (prne_s_g != NULL) { + has_ny_bin = strlen(prne_s_g->ny_bin_path) > 0; - if (!(WIFEXITED(status) && WEXITSTATUS(status) == 0)) { - prne_s_g->crash_cnt += 1; + if (!(WIFEXITED(status) && WEXITSTATUS(status) == 0)) { + prne_s_g->crash_cnt += 1; + } } if (WIFEXITED(status)) { diff --git a/src/proone.h b/src/proone.h index 700bd64..3906ba1 100644 --- a/src/proone.h +++ b/src/proone.h @@ -73,5 +73,5 @@ struct prne_shared_global { extern struct prne_global prne_g; -// TODO: could be NULL on some environments +// could be NULL on some environments extern struct prne_shared_global *prne_s_g; |