Blame SOURCES/autofs-5.0.7-add-null-check-in-read_one.patch

ab3a3d
autofs-5.0.7 - add null check in read_one()
ab3a3d
ab3a3d
From: Ian Kent <raven@themaw.net>
ab3a3d
ab3a3d
The pointter p shouldn't be null here but add a chack anyway.
ab3a3d
---
ab3a3d
 modules/lookup_file.c |    6 ++++--
ab3a3d
 1 file changed, 4 insertions(+), 2 deletions(-)
ab3a3d
ab3a3d
diff --git a/modules/lookup_file.c b/modules/lookup_file.c
ab3a3d
index 65e5ee6..2836996 100644
ab3a3d
--- a/modules/lookup_file.c
ab3a3d
+++ b/modules/lookup_file.c
ab3a3d
@@ -302,8 +302,10 @@ static int read_one(unsigned logopt, FILE *f, char *key, unsigned int *k_len, ch
ab3a3d
 				if (gotten == got_real || gotten == getting)
ab3a3d
 					goto got_it;
ab3a3d
 			} else if (mapent_len < MAPENT_MAX_LEN) {
ab3a3d
-				mapent_len++;
ab3a3d
-				*(p++) = ch;
ab3a3d
+				if (p) {
ab3a3d
+					mapent_len++;
ab3a3d
+					*(p++) = ch;
ab3a3d
+				}
ab3a3d
 				nch = getc(f);
ab3a3d
 				if (nch == EOF &&
ab3a3d
 				   (gotten == got_real || gotten == getting))