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

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