Skip to contentSkip to conversation

invalid fadvise parameter

PATCH Ulrich Drepper 1 participant 1 message Feb 13, 2004

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The len parameter for fadvise has a signed type and negative values passed must be rejected. The attached patch does the job.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFALHBE2ijCOnn/RHQRAlFAAJ99cQ5raRpz2OuSRSi3Xf4WdYuPvwCgycGi 0QZLMcHfqOcxjEzDl2tGDuA=
=igyM
-----END PGP SIGNATURE-----

fadvise.c-new renamed from fadvise.c +1 -1
@@ -33,7 +33,7 @@
 		return -EBADF;
 
 	mapping = file->f_mapping;
-	if (!mapping) {
+	if (!mapping || len < 0) {
 		ret = -EINVAL;
 		goto out;
 	}