diff options
| author | 2017-02-08 02:45:46 +0100 | |
|---|---|---|
| committer | 2017-02-08 02:45:46 +0100 | |
| commit | 1bf28fb685f0ec46db3495004fa5fadb3d9d10ad (patch) | |
| tree | b57f1f793e81f2fcfc3b26da8708dca72a2e5241 | |
| parent | 0c6668246cde84071996dd402db1f16738113398 (diff) | |
| download | libplist-1bf28fb685f0ec46db3495004fa5fadb3d9d10ad.tar.gz libplist-1bf28fb685f0ec46db3495004fa5fadb3d9d10ad.tar.bz2 | |
xplist: Use proper variable size for integer from string parsing
| -rw-r--r-- | src/xplist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xplist.c b/src/xplist.c index e8f80fb..5f63a94 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -984,11 +984,11 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist, uint32_t depth) | |||
| 984 | } | 984 | } |
| 985 | data->intval = strtoull((char*)str, NULL, 0); | 985 | data->intval = strtoull((char*)str, NULL, 0); |
| 986 | if (is_negative || (data->intval <= INT64_MAX)) { | 986 | if (is_negative || (data->intval <= INT64_MAX)) { |
| 987 | int64_t v = data->intval; | 987 | uint64_t v = data->intval; |
| 988 | if (is_negative) { | 988 | if (is_negative) { |
| 989 | v = -v; | 989 | v = -v; |
| 990 | } | 990 | } |
| 991 | data->intval = (uint64_t)v; | 991 | data->intval = v; |
| 992 | data->length = 8; | 992 | data->length = 8; |
| 993 | } else { | 993 | } else { |
| 994 | data->length = 16; | 994 | data->length = 16; |
