summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-14 17:39:11 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-14 17:39:11 +0900
commite82b61b4208c717911d4db1f065efeb42190feef (patch)
tree4c1c407434db60d3e0ee489b7faec24e2a4c26b9
parent49694c9a64d99c8974d23e903b5913b3fdfc29fa (diff)
downloadefl-e82b61b4208c717911d4db1f065efeb42190feef.tar.gz
epp - fix bit underflow in bitshift for multibyte
this fixes CID 1193200
-rw-r--r--src/bin/edje/epp/cppexp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/edje/epp/cppexp.c b/src/bin/edje/epp/cppexp.c
index d61e05459c..79d6f3f49d 100644
--- a/src/bin/edje/epp/cppexp.c
+++ b/src/bin/edje/epp/cppexp.c
@@ -412,9 +412,10 @@ cpp_lex(struct operation *op, cpp_reader * pfile)
{
int num_bits = num_chars * width;
- if (cpp_lookup("__CHAR_UNSIGNED__",
+ if ((num_bits > 0) &&
+ (cpp_lookup("__CHAR_UNSIGNED__",
sizeof("__CHAR_UNSIGNED__") - 1, -1)
- || ((result >> (num_bits - 1)) & 1) == 0)
+ || ((result >> (num_bits - 1)) & 1) == 0))
op->value =
result & ((unsigned long)~0 >>
(HOST_BITS_PER_LONG - num_bits));