Closed 129tyc closed 3 years ago
Nice catch!
That res2+2 looks like the right length for conversion to ucs2, not from. It indeed makes sense to simply use the the max buffer size there (or res4+1, but there is not benefit to calculating it).
However, that 4096 should not just come out of nowhere. Where is msg defined? Should we pass the total size through *msg_len instead?
Nice catch!
That res_2+2 looks like the right length for conversion to ucs2, not from. It indeed makes sense to simply use the the max buffer size there (or res_4+1, but there is not benefit to calculating it).
However, that 4096 should not just come out of nowhere. Where is msg defined? Should we pass the total size through *msg_len instead?
@wdoekes simply fix magic number because of my poor c++ skill... 😢
This issue happens to both of my K3765 as well: Bus 001 Device 008: ID 12d1:1465 Huawei Technologies Co., Ltd. K3765 HSPA Bus 001 Device 005: ID 12d1:1465 Huawei Technologies Co., Ltd. K3765 HSPA
It's totally reproduceable. And I've confirmed this CR fixed the issue, just like a magic.
It would be great if we can get this PR reviewed and merged soon.
Similar to issue #140 .
Maybe I found the solution for parsing ucs-2 type SMS. After debugging the parsing code, I thought the function
iconv
in libconv need more buffer length to convert ucs-2 to utf-8. So I increase the output buffer length and the code just works! No more error, everything is fine. #93