Skip to content

Commit fba3967

Browse files
yangguangcai1xiaoxiang781216
authored andcommitted
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 apache#3 0x5358d281 in __config_read libconfig/lib/libconfig.c:561 apache#4 0x5358dea0 in config_read_file libconfig/lib/libconfig.c:677 apache#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 <yangguangcai@xiaomi.com>
1 parent c113a22 commit fba3967

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/libc/string/lib_strcpy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ FAR char *strcpy(FAR char *dest, FAR const char *src)
7676
#ifdef CONFIG_LIBC_STRING_OPTIMIZE
7777
FAR char *dst0 = dest;
7878
FAR const char *src0 = src;
79-
FAR long *aligned_dst;
80-
FAR const long *aligned_src;
79+
FAR unsigned long *aligned_dst;
80+
FAR const unsigned long *aligned_src;
8181

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

8484
if (!UNALIGNED(src0, dst0))
8585
{
86-
aligned_dst = (FAR long *)dst0;
87-
aligned_src = (FAR long *)src0;
86+
aligned_dst = (FAR unsigned long *)dst0;
87+
aligned_src = (FAR unsigned long *)src0;
8888

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

0 commit comments

Comments
 (0)