summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-08-06 23:14:17 +0200
committerGravatar Nikias Bassen2014-08-06 23:14:17 +0200
commit778256cf50e44da36f4bbf6ee01abb0486a4418f (patch)
tree77035a6d0dfada4a5ec92675184f10427fcbfaf4 /src
parent191186a39cd3d31235f43db63c94d1b206131f1d (diff)
downloadlibimobiledevice-778256cf50e44da36f4bbf6ee01abb0486a4418f.tar.gz
libimobiledevice-778256cf50e44da36f4bbf6ee01abb0486a4418f.tar.bz2
lockdown: Only set SystemBUID in pair_record_generate() if it actually contains a value
This will prevent a crash in libplist when plist_new_string() will be called with a NULL pointer.
Diffstat (limited to 'src')
-rw-r--r--src/lockdown.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index 3e2fe06..c6efb16 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -743,7 +743,8 @@ static lockdownd_error_t pair_record_generate(lockdownd_client_t client, plist_t
}
/* set SystemBUID */
- if (userpref_read_system_buid(&system_buid)) {
+ userpref_read_system_buid(&system_buid);
+ if (system_buid) {
plist_dict_set_item(*pair_record, USERPREF_SYSTEM_BUID_KEY, plist_new_string(system_buid));
}