]> arthur.barton.de Git - netatalk.git/commitdiff
Merge branch 'branch-netatalk-2-1'
authorHAT <hat@fa2.so-net.ne.jp>
Sat, 22 Jan 2011 12:14:35 +0000 (21:14 +0900)
committerHAT <hat@fa2.so-net.ne.jp>
Sat, 22 Jan 2011 12:14:35 +0000 (21:14 +0900)
NEWS
libatalk/adouble/ad_attr.c

diff --git a/NEWS b/NEWS
index ec4972322661e8e49bc1154dd6d387bbe0a3f186..93184a09c74bf0efc76a9f4905a573e74a0483e8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -67,6 +67,7 @@ Changes in 2.1.6
 * FIX: gentoo: cannot set $CNID_CONFIG
 * FIX: ubuntu: servername was empty
 * FIX: Solaris: configure script failed to enable DDP module
+* FIX: AppleDouble buffer overrun by extremely long filename
 * UPD: afpd: return version info with machine type in DSIGetStatus
 
 Changes in 2.1.5
index 8b3a32041325a5d405cc114fc1208eba38aa5456..123560b5683b3e4af2729ce02631f238c48ffe4a 100644 (file)
@@ -190,9 +190,12 @@ u_int32_t ad_forcegetid (struct adouble *adp)
  */
 int ad_setname(struct adouble *ad, const char *path)
 {
+    int len;
+    if ((len = strlen(path)) > ADEDLEN_NAME)
+        len = ADEDLEN_NAME;
     if (path && ad_getentryoff(ad, ADEID_NAME)) {
-        ad_setentrylen( ad, ADEID_NAME, strlen( path ));
-        memcpy(ad_entry( ad, ADEID_NAME ), path, ad_getentrylen( ad, ADEID_NAME ));
+        ad_setentrylen( ad, ADEID_NAME, len);
+        memcpy(ad_entry( ad, ADEID_NAME ), path, len);
         return 1;
     }
     return 0;