Skip to content

Commit

Permalink
strcpy:skip ubsan check.
Browse files Browse the repository at this point in the history
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
    apache#6 0x52cde739 in default_tts_vendor_get src/vendor.c:356
    apache#7 0x52a07e1d in vendorswitch_init src/vendorswitch/vendorswitch.c:501
    apache#8 0x52444fb9 in mico_misc_main /home/ygc/ssd/x4b-sim/vendor/xiaomi/miai/mico_misc/instance/main.c:72
    apache#9 0x48bee720 in nxtask_startup sched/task_startup.c:70
    apache#10 0x48b41eb4 in nxtask_start task/task_start.c:112
    apache#11 0x48c1ef3d in pre_start sim/sim_initialstate.c:52

Signed-off-by: yangguangcai <[email protected]>
  • Loading branch information
yangguangcai1 authored and xiaoxiang781216 committed Oct 17, 2024
1 parent c113a22 commit fba3967
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/libc/string/lib_strcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ FAR char *strcpy(FAR char *dest, FAR const char *src)
#ifdef CONFIG_LIBC_STRING_OPTIMIZE
FAR char *dst0 = dest;
FAR const char *src0 = src;
FAR long *aligned_dst;
FAR const long *aligned_src;
FAR unsigned long *aligned_dst;
FAR const unsigned long *aligned_src;

/* If SRC or DEST is unaligned, then copy bytes. */

if (!UNALIGNED(src0, dst0))
{
aligned_dst = (FAR long *)dst0;
aligned_src = (FAR long *)src0;
aligned_dst = (FAR unsigned long *)dst0;
aligned_src = (FAR unsigned long *)src0;

/* SRC and DEST are both "long int" aligned, try to do "long int"
* sized copies.
Expand Down

0 comments on commit fba3967

Please sign in to comment.