diff options
| author | 2022-02-07 01:13:45 +0100 | |
|---|---|---|
| committer | 2022-02-07 01:13:45 +0100 | |
| commit | 2727078f8f2d94cd03344a3c83672b543d726b39 (patch) | |
| tree | 1cb2122ed613626d786031daa1bed3b230b7cdaa /src | |
| parent | a5316629a34ec5e1cd0cf76b4cb1625c5a6f3f88 (diff) | |
| download | libplist-2727078f8f2d94cd03344a3c83672b543d726b39.tar.gz libplist-2727078f8f2d94cd03344a3c83672b543d726b39.tar.bz2 | |
xplist: Prevent undefined behavior by not trying to negate INT64_MIN
Diffstat (limited to 'src')
| -rw-r--r-- | src/xplist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xplist.c b/src/xplist.c index 9569d07..d8f6458 100644 --- a/src/xplist.c +++ b/src/xplist.c | |||
| @@ -409,7 +409,7 @@ static int num_digits_i(int64_t i) | |||
| 409 | int64_t po10; | 409 | int64_t po10; |
| 410 | n=1; | 410 | n=1; |
| 411 | if (i < 0) { | 411 | if (i < 0) { |
| 412 | i = -i; | 412 | i = (i == INT64_MIN) ? INT64_MAX : -i; |
| 413 | n++; | 413 | n++; |
| 414 | } | 414 | } |
| 415 | po10=10; | 415 | po10=10; |
