Skip to content

Commit 0ab98f2

Browse files
committed
解决偶现内存污染导致输出结果异常,进而造成闪退的问题
1 parent db84ec8 commit 0ab98f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fpcalc/src/main/cpp/fpcalc_jni.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ struct FpcalcResult {
4040
int char_size = strlen(str);
4141
if (is_raw) {
4242
raw_fingerprint = (char *) malloc(char_size * sizeof(char));
43-
return strcat(raw_fingerprint, str) != nullptr;
43+
return strcpy(raw_fingerprint, str) != nullptr;
4444
} else {
4545
fingerprint = (char *) malloc(char_size * sizeof(char));
46-
return strcat(fingerprint, str) != nullptr;
46+
return strcpy(fingerprint, str) != nullptr;
4747
}
4848
}
4949

0 commit comments

Comments
 (0)