erofs-utils: mkfs: fix an undefined behavior of memcpy
authorGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 6 Sep 2024 08:36:51 +0000 (16:36 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Mon, 9 Sep 2024 04:54:19 +0000 (12:54 +0800)
commitff1ca05f60f731b038b9a2515be5c6022f54fb05
treea63535caefe8541ccfd5d61cd3bac4e1f3071928
parentd18972d387a425a366741ad6b246c0081e2dc8b0
erofs-utils: mkfs: fix an undefined behavior of memcpy

Call trace:
 - erofs_mkfs_build_tree
  - erofs_mkfs_go(sbi, ~0, NULL, 0);

inode.c:1395:20: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior inode.c:1395:20 in

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Sandeep Dhavale <dhavale@google.com>
Link: https://lore.kernel.org/r/20240906083651.341555-1-hsiangkao@linux.alibaba.com
lib/inode.c