We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72896e5 commit 7e49713Copy full SHA for 7e49713
1 file changed
src/gpt.c
@@ -195,6 +195,10 @@ int gpt_part_name_eq(const uint16_t *utf16_name, const char *ascii_label)
195
/* Skip BOM if present */
196
if (utf16_name[utf16_idx] == 0xfeff) {
197
utf16_idx = 1;
198
+ /* Ensure label + BOM offset fits in name array */
199
+ if (ascii_len + utf16_idx > GPT_PART_NAME_SIZE) {
200
+ return 0;
201
+ }
202
}
203
204
/* Compare each character */
0 commit comments