$NetBSD: patch-am,v 1.4 1999/03/07 16:32:00 rh Exp $

--- src/extensions.c.orig	Fri Feb 26 09:08:46 1999
+++ src/extensions.c	Sun Mar  7 15:54:53 1999
@@ -1064,6 +1064,11 @@
 
       /* what's our current directory? */
 
+      if (strlen (name) >= sizeof path) { /* path too long? --> bail out */
+          perror_reply(550, "Could not determine cwdir");
+          return(-1);
+      }
+
       strcpy(path, name);
       if (sp = strrchr(path, '/'))  *sp = '\0';
       else strcpy(path, ".");
