lkml.org 
[lkml]   [2023]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] ubi: Fix failure attaching when vid_hdr offset equals to (sub)page size
----- Ursprüngliche Mail -----
> Von: "chengzhihao1" <chengzhihao1@huawei.com>
> + /*
> + * Memory allocation for VID header is ubi->vid_hdr_alsize
> + * which is described in comments in io.c.
> + * Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds
> + * ubi->vid_hdr_alsize, so that all vid header operations
> + * won't access memory out of bounds.
> + */
> + if ((ubi->vid_hdr_shift + UBI_VID_HDR_SIZE) > ubi->vid_hdr_alsize) {
> + ubi_err(ubi, "Invalid VID header offset %d, VID header shift(%d)"
> + " + VID header size(%d) > VID header aligned size(%d).",
> + ubi->vid_hdr_offset, ubi->vid_hdr_shift,
> + (int)UBI_VID_HDR_SIZE, ubi->vid_hdr_alsize);

Hmm, why are you casting to int instead of using %zu as format string?

Thanks,
//richard

\
 
 \ /
  Last update: 2023-03-27 00:44    [W:0.025 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site