Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8142bfce authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Taras Antoshchuk
Browse files

Don't throw in socket_read if socket_read_all returns < 0

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2096720

Bug: 229813087
Merged-In: I2a04a799d3748c221f8555fa7afc40d73f0f392c
Change-Id: Ie1624980ed310dcc93c552edec04208a9538b210
parent 648717a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -257,7 +257,7 @@ static jint socket_read (JNIEnv *env, jobject object, jobject fileDescriptor)
    err = socket_read_all(env, object, fd, &buf, 1);
    err = socket_read_all(env, object, fd, &buf, 1);


    if (err < 0) {
    if (err < 0) {
        jniThrowIOException(env, errno);
        // socket_read_all has already thrown
        return (jint)0;
        return (jint)0;
    }
    }