[Cluster-devel] [PATCH 38/41] qdiskd: fix possible resource leak in scandisk

Lon Hohberger lhh at redhat.com
Tue Nov 29 18:04:00 UTC 2011


On 11/23/2011 05:15 AM, Fabio M. Di Nitto wrote:
> Spotted by Coverity Scan
>

> -	while (fgets(line, sizeof(line), fp)
> -	       != NULL) {
> +
> +	while (fgets(line, sizeof(line) - 1, fp) != NULL) {

fgets takes at most size-1, this isn't needed

-- Lon




More information about the Cluster-devel mailing list