]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/netatalk_conf.c
Memory overflow caused by 'basedir regex', bug #567
[netatalk.git] / libatalk / util / netatalk_conf.c
index 71acf8841adf263e68f15a290b228da2cae89e42..32bda78ab9fd4786fcd34276ab466ec22fc2b71d 100644 (file)
@@ -1682,7 +1682,7 @@ struct vol *getvolbypath(AFPObj *obj, const char *path)
     strlcat(tmpbuf, "/", MAXPATHLEN);
 
     /* (5) */
-    p = path + strlen(basedir);
+    p = path + match[0].rm_eo - match[0].rm_so;
     while (*p == '/')
         p++;
     EC_NULL_LOG( user = strdup(p) );