diff --git a/src/utils_tools.c b/src/utils_tools.c index acd9708c..ce841592 100644 --- a/src/utils_tools.c +++ b/src/utils_tools.c @@ -204,7 +204,7 @@ const char *uuid_or_device(const char *spec) strcpy(device, "/dev/disk/by-uuid/"); ptr = &device[strlen(device)]; i = uuid_len; - while ((s = spec[i++]) && i < PATH_MAX) { + while ((s = spec[i++]) && i < (PATH_MAX - 13)) { if (!isxdigit(s) && s != '-') return spec; /* Bail it out */ if (isalpha(s))