Skip to contentSkip to conversation

disk: ubi: use a format string when copying the volume name

PATCH Tom Rini 1 participant 1 message Aug 25 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Tom Rini

author
#1 lore raw
Quoted 5 lines · Daniel Golle

part_get_info_ubi() passes the UBI volume name straight to snprintf() as its format argument:

	snprintf(info->name, PART_NAME_LEN, vol->name);
Quoted 7 lines

A volume name that contains a '%' is then interpreted as a printf conversion specifier, yielding a wrong partition name or reading unintended variadic arguments; a '%n' would be undefined behaviour. Volume names are user-defined and boot methods select images by volume name, so copy the name through a "%s" format instead.

[...]

Applied to u-boot/main, thanks!

[1/1] disk: ubi: use a format string when copying the volume name

      commit: fb79a4fcb09b49c6d6ef0a9a030e1abef32358e9
Signature · 1 line
Tom