summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bplist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bplist.c b/src/bplist.c
index 9acd6ae..67513e6 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -269,11 +269,11 @@ static plist_t parse_real_node(const char **bnode, uint8_t size)
269 switch (size) 269 switch (size)
270 { 270 {
271 case sizeof(uint32_t): 271 case sizeof(uint32_t):
272 *(uint32_t*)buf = float_bswap32(*(uint32_t*)*bnode); 272 *(uint32_t*)buf = float_bswap32(get_unaligned((uint32_t*)*bnode));
273 data->realval = *(float *) buf; 273 data->realval = *(float *) buf;
274 break; 274 break;
275 case sizeof(uint64_t): 275 case sizeof(uint64_t):
276 *(uint64_t*)buf = float_bswap64(*(uint64_t*)*bnode); 276 *(uint64_t*)buf = float_bswap64(get_unaligned((uint64_t*)*bnode));
277 data->realval = *(double *) buf; 277 data->realval = *(double *) buf;
278 break; 278 break;
279 default: 279 default:
@@ -394,7 +394,7 @@ static plist_t parse_unicode_node(const char **bnode, uint64_t size)
394 return NULL; 394 return NULL;
395 } 395 }
396 for (i = 0; i < size; i++) 396 for (i = 0; i < size; i++)
397 unicodestr[i] = be16toh(((uint16_t*)*bnode)[i]); 397 unicodestr[i] = be16toh(get_unaligned((uint16_t*)(*bnode+(i<<1))));
398 398
399 tmpstr = plist_utf16_to_utf8(unicodestr, size, &items_read, &items_written); 399 tmpstr = plist_utf16_to_utf8(unicodestr, size, &items_read, &items_written);
400 free(unicodestr); 400 free(unicodestr);