A critical buffer overflow vulnerability (CVE-2024-38541) was identified and fixed in the Linux kernel's of_modalias() function. The flaw occurs when the buffer is too small for the initial snprintf() call, causing a negative length parameter and a pointer that can exceed the buffer boundary. This can lead to memory corruption. The issue was addressed by adding proper buffer overflow checks after the first snprintf() and correcting the length check after strlen(), including the terminating null character.