strcpy:skip ubsan check.

string/lib_strcpy.c:87:15: runtime error: signed integer overflow: -2132367969 - 16843009 cannot be represented in type 'long int'
    #0 0x48e77096 in strcpy string/lib_strcpy.c:87
    #1 0x535b6ea4 in libconfig_strbuf_append_string libconfig/lib/strbuf.c:60
    #2 0x53ad7f52 in libconfig_yyparse /home/ygc/ssd/x4b-sim/external/libconfig/grammar.y:186
    #3 0x5358d281 in __config_read libconfig/lib/libconfig.c:561
    #4 0x5358dea0 in config_read_file libconfig/lib/libconfig.c:677
    #5 0x52cdd0a5 in tts_vendor_list_get src/vendor.c:114
    #6 0x52cde739 in default_tts_vendor_get src/vendor.c:356
    #7 0x52a07e1d in vendorswitch_init src/vendorswitch/vendorswitch.c:501
    #8 0x52444fb9 in mico_misc_main /home/ygc/ssd/x4b-sim/vendor/xiaomi/miai/mico_misc/instance/main.c:72
    #9 0x48bee720 in nxtask_startup sched/task_startup.c:70
    #10 0x48b41eb4 in nxtask_start task/task_start.c:112
    #11 0x48c1ef3d in pre_start sim/sim_initialstate.c:52

Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
This commit is contained in:
yangguangcai 2024-04-22 14:28:11 +08:00 committed by Xiang Xiao
parent c113a224e8
commit fba3967f2f
1 changed files with 4 additions and 4 deletions

View File

@ -76,15 +76,15 @@ FAR char *strcpy(FAR char *dest, FAR const char *src)
#ifdef CONFIG_LIBC_STRING_OPTIMIZE #ifdef CONFIG_LIBC_STRING_OPTIMIZE
FAR char *dst0 = dest; FAR char *dst0 = dest;
FAR const char *src0 = src; FAR const char *src0 = src;
FAR long *aligned_dst; FAR unsigned long *aligned_dst;
FAR const long *aligned_src; FAR const unsigned long *aligned_src;
/* If SRC or DEST is unaligned, then copy bytes. */ /* If SRC or DEST is unaligned, then copy bytes. */
if (!UNALIGNED(src0, dst0)) if (!UNALIGNED(src0, dst0))
{ {
aligned_dst = (FAR long *)dst0; aligned_dst = (FAR unsigned long *)dst0;
aligned_src = (FAR long *)src0; aligned_src = (FAR unsigned long *)src0;
/* SRC and DEST are both "long int" aligned, try to do "long int" /* SRC and DEST are both "long int" aligned, try to do "long int"
* sized copies. * sized copies.