]> arthur.barton.de Git - netatalk.git/commitdiff
Don't SEGV if the mangled filename doesn't have an extension.
authorjmarcus <jmarcus>
Thu, 30 May 2002 20:48:29 +0000 (20:48 +0000)
committerjmarcus <jmarcus>
Thu, 30 May 2002 20:48:29 +0000 (20:48 +0000)
Special thanks to:      Steve Freitas <steve@newportit.com> for helping me
                        track this down

etc/afpd/mangle.c

index 0057fb2c7ebde57039c4e23fe29aa4f325fdc1ae..a96b41e6e09e2821112ffc8397067668570735c3 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: mangle.c,v 1.2 2002-05-30 06:41:16 jmarcus Exp $ 
+ * $Id: mangle.c,v 1.3 2002-05-30 20:48:29 jmarcus Exp $ 
  *
  * Copyright (c) 2002. Joe Marcus Clarke (marcus@marcuscom.com)
  * All Rights Reserved.  See COPYRIGHT.
@@ -30,7 +30,7 @@ demangle(const struct vol *vol, char *mfilename) {
        }
 
        ext = strrchr(mfilename, '.');
-       if (strlen(mangle) != strlen(MANGLE_CHAR) + MANGLE_LENGTH + strlen(ext)) {
+       if (strlen(mangle) != strlen(MANGLE_CHAR) + MANGLE_LENGTH + (ext != NULL)?strlen(ext):0) {
            return mfilename;
        }