]> arthur.barton.de Git - netatalk.git/commitdiff
Oops, ad_path returns a static buffer
authordidg <didg>
Fri, 6 Sep 2002 04:23:45 +0000 (04:23 +0000)
committerdidg <didg>
Fri, 6 Sep 2002 04:23:45 +0000 (04:23 +0000)
etc/afpd/file.c

index b12c723f70e8789484784b2ad1653dc9f695e326..310fcdd7a2105b58d9912b0b39338298328ab2e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.56 2002-09-06 02:57:49 didg Exp $
+ * $Id: file.c,v 1.57 2002-09-06 04:23:45 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1043,13 +1043,13 @@ const int   noadouble;
     char               filebuf[8192];
     int                        sfd, dfd, len, err = AFP_OK;
     ssize_t             cc;
-    char                *dpath;
+    char                dpath[ MAXPATHLEN + 1];
     int                 admode;
 #ifdef DEBUG
     LOG(log_info, logtype_afpd, "begin copyfile:");
 #endif /* DEBUG */
 
-    dpath = ad_path( dst, ADFLAGS_HF );
+    strcpy(dpath, ad_path( dst, ADFLAGS_HF ));
     admode = ad_mode( dst, 0666 );
     if (newname) {
         if ((sfd = open( ad_path( src, ADFLAGS_HF ), O_RDONLY, 0 )) < 0 ) {