Commit cacdd4fc authored by Vinit Deshpande's avatar Vinit Deshpande Committed by Android (Google) Code Review
Browse files

Merge "Fix mismatched buffer size in supplicant and WifiNative" into mnc-dr-dev

parents 70478da8 bbbafda1
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment