Skip to contentSkip to conversation

master - report: fix dereference of string as uint64_t

PATCH Zdenek Kabelac 1 participant 1 message Nov 15, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=36d7c639d14e121e839b2117dcf744097e6ebfde
Commit:        36d7c639d14e121e839b2117dcf744097e6ebfde
Parent:        9eb81b1bf74411bba6cc950a4ebe0a44856c0e74
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Sep 23 10:18:10 2013 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Nov 15 11:05:02 2013 +0100

report: fix dereference of string as uint64_t

Fix buggy usage of "" (empty string) as a numerical string value used for sorting.

On intel 64b platform this was typically resolve as 0xffffff0000000000 - which is already 'close' to UINT64_MAX which is used for _minusone64.

On other platforms it might have been giving
different numbers depends on aligment of strings.

Use proper &_minusone64 for sorting value when the reported value is NUM.

Note: each numerical value needs to be thought about if it needs default value &_zero64 or &_minusone64 since for cases, were value of zero is valid, sorting should not be mixing entries together.

---
 WHATS_NEW           |    1 +
 lib/report/report.c |   84 ++++++++++++++++++--------------------------------
 2 files changed, 31 insertions(+), 54 deletions(-)
WHATS_NEW +1 -0
index b190ca4..fb3b21a 100644
@@ -1,5 +1,6 @@
 Version 2.02.105 -
 =====================================
+  Fix reporting of empty numerical values.
   Simplify reporting code.
 
 Version 2.02.104 - 13th November 2013
lib/report/report.c +30 -54

154 lines not on this page · raw message