From: Luca Boccassi Date: Fri, 6 Mar 2026 20:25:05 +0000 (+0000) Subject: udev: ensure tag parsing stays within bounds X-Git-Tag: v260-rc3~20^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45a200cd751fae382f4145760cf84fd181db1319;p=thirdparty%2Fsystemd.git udev: ensure tag parsing stays within bounds This cannot actually happen, but add a safety check nonetheless. Reported on yeswehack.com as: YWH-PGM9780-43 Follow-up for d7867b31836173d1a943ecb1cab6484536126411 --- diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index 4db20e4a13f..cdd8da3203f 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -654,7 +654,7 @@ static void add_id_tag(UdevEvent *event, const char *path) { size_t i = 0; /* compose valid udev tag name */ - for (const char *p = path; *p; p++) { + for (const char *p = path; *p && i < sizeof(tag) - 1; p++) { if (ascii_isdigit(*p) || ascii_isalpha(*p) || *p == '-') {