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

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