tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5e4b523d51c11d073def64e3a2dd268eb3a9ae22

commit 5e4b523d51c11d073def64e3a2dd268eb3a9ae22
Author: Tom Hacohen <t...@stosb.com>
Date:   Wed Apr 22 13:17:28 2015 +0100

    Eldbus: fix potential unsigned int underflow.
    
    Subtracting two unsigned values results in an unsigned value, which means
    abs() will have no effect.
    This also means that if base is smaller than size, we'll have an
    unsigned int underflow.
    
    I did it this way (with the if) because it looked like base might be
    smaller than size. However, please remove the if (and don't reinstate
    the abs) if this is not the case.
---
 src/lib/eldbus/eldbus_message_to_eina_value.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eldbus/eldbus_message_to_eina_value.c 
b/src/lib/eldbus/eldbus_message_to_eina_value.c
index 777bf17..bac9860 100644
--- a/src/lib/eldbus/eldbus_message_to_eina_value.c
+++ b/src/lib/eldbus/eldbus_message_to_eina_value.c
@@ -91,7 +91,7 @@ _type_offset(char type, unsigned base)
      return base;
    if (!(base % size))
      return base;
-   padding = abs(base - size);
+   padding = (base > size) ? base - size : size - base;
    return base + padding;
 }
 

-- 


Reply via email to