From: Yu Watanabe Date: Wed, 12 May 2021 01:16:36 +0000 (+0900) Subject: gpt: introduce GPT_LAVEL_MAX X-Git-Tag: v249-rc1~243^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6001df659464506990d98efe109288b78438d3e7;p=thirdparty%2Fsystemd.git gpt: introduce GPT_LAVEL_MAX --- diff --git a/src/shared/gpt.c b/src/shared/gpt.c index 558b69c4879..bd1f43ffdd4 100644 --- a/src/shared/gpt.c +++ b/src/shared/gpt.c @@ -104,7 +104,7 @@ int gpt_partition_label_valid(const char *s) { if (!recoded) return -ENOMEM; - return char16_strlen(recoded) <= 36; + return char16_strlen(recoded) <= GPT_LABEL_MAX; } bool gpt_partition_type_is_root(sd_id128_t id) { diff --git a/src/shared/gpt.h b/src/shared/gpt.h index 6581973793d..c92d9c0974c 100644 --- a/src/shared/gpt.h +++ b/src/shared/gpt.h @@ -115,6 +115,9 @@ #define GPT_FLAG_NO_AUTO (1ULL << 63) #define GPT_FLAG_GROWFS (1ULL << 59) +/* maximum length of gpt label */ +#define GPT_LABEL_MAX 36 + const char *gpt_partition_type_uuid_to_string(sd_id128_t id); const char *gpt_partition_type_uuid_to_string_harder( sd_id128_t id,