]> git.saurik.com Git - cycript.git/commitdiff
CYUTF8String cannot have a negative size, even -1.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Mar 2016 09:25:53 +0000 (02:25 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Mar 2016 09:25:53 +0000 (02:25 -0700)
Console.cpp

index 8a8277e211f2c2d0e752ba06abdd265dfe3a89d5..1f725ae54188b213dfee840283c9f10cd7af2f41 100644 (file)
@@ -272,9 +272,10 @@ static CYUTF8String Run(CYPool &pool, int client, CYUTF8String code) {
         _assert(CYSendAll(client, code.data, code.size));
         mode_ = Waiting;
         _assert(CYRecvAll(client, &size, sizeof(size)));
-        if (size == _not(uint32_t))
+        if (size == _not(uint32_t)) {
+            size = 0;
             json = NULL;
-        else {
+        else {
             char *temp(new(pool) char[size + 1]);
             _assert(CYRecvAll(client, temp, size));
             temp[size] = '\0';