diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-10-07 19:29:08 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-10-07 19:29:08 +0000 |
commit | 60c3052f42a0872a86fa3e57849f8e62c41a8db6 (patch) | |
tree | 683545f5b13bbd4cc608f97f593affb76ab55d1e | |
parent | 5e5f50da9ee67dc6d081c5aded4f7132cb84882e (diff) | |
parent | 03e4ac9ff46f5afaf86a306fd0315d6f0e18bcd6 (diff) | |
download | android_frameworks_opt_net_wifi-60c3052f42a0872a86fa3e57849f8e62c41a8db6.tar.gz android_frameworks_opt_net_wifi-60c3052f42a0872a86fa3e57849f8e62c41a8db6.tar.bz2 android_frameworks_opt_net_wifi-60c3052f42a0872a86fa3e57849f8e62c41a8db6.zip |
am 03e4ac9f: am cacdd4fc: Merge "Fix mismatched buffer size in supplicant and WifiNative" into mnc-dr-dev
* commit '03e4ac9ff46f5afaf86a306fd0315d6f0e18bcd6':
Fix mismatched buffer size in supplicant and WifiNative
-rw-r--r-- | service/jni/com_android_server_wifi_WifiNative.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/service/jni/com_android_server_wifi_WifiNative.cpp b/service/jni/com_android_server_wifi_WifiNative.cpp index 1cce0b687..31166e38f 100644 --- a/service/jni/com_android_server_wifi_WifiNative.cpp +++ b/service/jni/com_android_server_wifi_WifiNative.cpp @@ -32,7 +32,7 @@ #include "jni_helper.h" #include "rtt.h" #include "wifi_hal_stub.h" -#define REPLY_BUF_SIZE 4096 // wpa_supplicant's maximum size. +#define REPLY_BUF_SIZE 4096 + 1 // wpa_supplicant's maximum size + 1 for nul #define EVENT_BUF_SIZE 2048 namespace android { @@ -138,7 +138,12 @@ static jboolean doBooleanCommand(JNIEnv* env, jstring javaCommand) { if (!doCommand(env, javaCommand, reply, sizeof(reply))) { return JNI_FALSE; } - return (strcmp(reply, "OK") == 0); + jboolean result = (strcmp(reply, "OK") == 0); + if (!result) { + ScopedUtfChars command(env, javaCommand); + ALOGI("command '%s' returned '%s", command.c_str(), reply); + } + return result; } // Send a command to the supplicant, and return the reply as a String. |