[LTP] [PATCH v2 1/2] llistxattr: added a new test case to llistxattr02

Cyril Hrubis chrubis@suse.cz
Tue Oct 11 11:51:56 CEST 2016


Hi!
>  static void verify_llistxattr(unsigned int n)
> @@ -95,6 +101,9 @@ static void setup(void)
>  			tst_brk(TBROK | TERRNO, "lsetxattr() failed");
>  		}
>  	}
> +
> +	memset(&longpathname, 'a', sizeof(longpathname) - 1);
> +	longpathname[sizeof(longpathname)] = '\0';

This is off-by-one, the last array element is at sizeof(longpathname)-1.
Also this is not needed since the array is global, hence initialized to
0 and we fill first n-1 elements with the memset() leaving the last one
to be the '\0'.

>  }
>  
>  static struct tst_test test = {
> -- 
> 1.9.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list