diff options
author | Nikias Bassen | 2011-05-19 01:50:45 +0200 |
---|---|---|
committer | Martin Szulecki | 2012-03-22 18:48:47 +0100 |
commit | ba92c353c07fa006ac744ce6280714650a25a6ad (patch) | |
tree | f036a7a84d512a0be07d829d1c196ca8d270f930 /tools | |
parent | e16fc4b4be279e1a7be7760191263e0bb40cdd28 (diff) | |
download | libimobiledevice-ba92c353c07fa006ac744ce6280714650a25a6ad.tar.gz libimobiledevice-ba92c353c07fa006ac744ce6280714650a25a6ad.tar.bz2 |
ideviceinfo: fix possible segmentation fault when parsing empty data nodes
Thanks to Gordon Assaf for pointing this out.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ideviceinfo.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/ideviceinfo.c b/tools/ideviceinfo.c index e05165b..c5c060e 100644 --- a/tools/ideviceinfo.c +++ b/tools/ideviceinfo.c @@ -160,10 +160,14 @@ static void plist_node_to_string(plist_t node) case PLIST_DATA: plist_get_data_val(node, &data, &u); - s = g_base64_encode((guchar *)data, u); - free(data); - printf("%s\n", s); - g_free(s); + if (u > 0) { + s = g_base64_encode((guchar *)data, u); + free(data); + printf("%s\n", s); + g_free(s); + } else { + printf("\n"); + } break; case PLIST_DATE: |