Re: [PATCH] Tools: hv: Fix for long file names from readdir

From: Tomas Hozza
Date: Thu Nov 08 2012 - 09:52:43 EST


> > - char dev_id[256];
> > + char dev_id[512];
>
> Shouldnt that be PATH_MAX or similar?

dirent->d_name should be PATH_MAX, but it is mostly
not guaranteed. And then the dev_id is concatenated
with two strings so it can exceed 256 bytes.

After discussion with K. Y. Srinivasan I just doubled
the size and added size checks for sanity.

Tomas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/