Wifi: Fix runtime crash in when scan results contain KSC 5601 SSID
bug b/2178462
Change-Id: I409d9b4a163299c3383ec092cd2368a9d24236cb
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp
index 38f3fda..46000c9 100644
--- a/core/jni/android_net_wifi_Wifi.cpp
+++ b/core/jni/android_net_wifi_Wifi.cpp
@@ -20,6 +20,7 @@
#include <utils/misc.h>
#include <android_runtime/AndroidRuntime.h>
#include <utils/Log.h>
+#include <utils/String16.h>
#include "wifi.h"
@@ -92,7 +93,8 @@
if (doCommand(cmd, reply, sizeof(reply)) != 0) {
return env->NewStringUTF(NULL);
} else {
- return env->NewStringUTF(reply);
+ String16 str((char *)reply);
+ return env->NewString((const jchar *)str.string(), str.size());
}
}