[gjs] byteArray: Fix bug with length > maxint32



commit 17a296a40c24906b3162c76d214b5f348fe05d0f
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Sep 18 20:56:40 2016 -0700

    byteArray: Fix bug with length > maxint32
    
    This is extremely unlikely to happen, but I noticed it while making some
    other changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742249

 gjs/byteArray.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index fda8023..48a143b 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -83,7 +83,7 @@ gjs_value_from_gsize(JSContext         *context,
                      gsize              v,
                      JS::MutableHandleValue value_p)
 {
-    if (v > (gsize) JSVAL_INT_MAX) {
+    if (v <= (gsize) JSVAL_INT_MAX) {
         value_p.set(INT_TO_JSVAL(v));
         return JS_TRUE;
     } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]