From 06188e981801d18c103d1525f5d463b2967fcd88 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 13 May 2015 10:45:16 -0400 Subject: [PATCH] Fixed segfault in tox-bootstrapd. --- other/bootstrap_daemon/tox-bootstrapd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/other/bootstrap_daemon/tox-bootstrapd.c b/other/bootstrap_daemon/tox-bootstrapd.c index 1bcae732..8b5e6a4b 100644 --- a/other/bootstrap_daemon/tox-bootstrapd.c +++ b/other/bootstrap_daemon/tox-bootstrapd.c @@ -105,6 +105,9 @@ int manage_keys(DHT *dht, char *keys_file_path) keys_file = fopen(keys_file_path, "w"); + if (!keys_file) + return 0; + const size_t write_size = fwrite(keys, sizeof(uint8_t), KEYS_SIZE, keys_file); if (write_size != KEYS_SIZE) {