hw/loongarch/boot.c: fix out-of-bound reading
commit5e21b1317f900a574d85e0890ba156078964ba2c
authorDmitry Frolov <frolov@swemel.ru>
Fri, 28 Jun 2024 12:39:10 +0000 (28 15:39 +0300)
committerSong Gao <gaosong@loongson.cn>
Fri, 12 Jul 2024 01:41:18 +0000 (12 09:41 +0800)
tree8c5a3d22d4917b710131c4eebca2c48f35914745
parent23901b2b721c0576007ab7580da8aa855d6042a9
hw/loongarch/boot.c: fix out-of-bound reading

memcpy() is trying to READ 512 bytes from memory,
pointed by info->kernel_cmdline,
which was (presumable) allocated by g_strdup("");
Found with ASAN, making check with enabled sanitizers.

Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20240628123910.577740-1-frolov@swemel.ru>
Signed-off-by: Song Gao <gaosong@loongson.cn>
hw/loongarch/boot.c