Blame SOURCES/autofs-5.0.7-add-mapent-null-check-in-lookup-nisplus-lookup_mount.patch

304803
autofs-5.0.7 - add mapent null check in lookup_nisplus.c:lookup_mount()
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
malloc(3) could return null under low memory conditions, add a null check
304803
for this case.
304803
---
304803
 modules/lookup_nisplus.c |    3 ++-
304803
 1 file changed, 2 insertions(+), 1 deletion(-)
304803
304803
diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c
304803
index 8237a1e..ef942a7 100644
304803
--- a/modules/lookup_nisplus.c
304803
+++ b/modules/lookup_nisplus.c
304803
@@ -584,7 +584,8 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
304803
 		if (me && (me->source == source || *me->key == '/')) {
304803
 			mapent_len = strlen(me->mapent);
304803
 			mapent = malloc(mapent_len + 1);
304803
-			strcpy(mapent, me->mapent);
304803
+			if (mapent)
304803
+				strcpy(mapent, me->mapent);
304803
 		}
304803
 	}
304803
 	cache_unlock(mc);