]> git.ozlabs.org Git - ppp.git/blobdiff - modules/deflate.c
pppd: Fix SIGSEGV in EAP-TLS code when TLS verify method is not specified
[ppp.git] / modules / deflate.c
index f77f6eb657dfbca1a932961677f6357d853bcc18..27023261edbf7ca0130a33c7e3b50892b1b66d49 100644 (file)
@@ -4,30 +4,38 @@
  * This version is for use with STREAMS under SunOS 4.x, Solaris 2,
  * SVR4, OSF/1 and AIX 4.x.
  *
- * Copyright (c) 1994 The Australian National University.
- * All rights reserved.
+ * Copyright (c) 1994 Paul Mackerras. All rights reserved.
  *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, provided that the above copyright
- * notice appears in all copies.  This software is provided without any
- * warranty, express or implied. The Australian National University
- * makes no representations about the suitability of this software for
- * any purpose.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
  *
- * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
- * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
- * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
- * THE AUSTRALIAN NATIONAL UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY
- * OF SUCH DAMAGE.
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
  *
- * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
- * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
- * OR MODIFICATIONS.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
  *
- * $Id: deflate.c,v 1.10 2001/03/09 01:03:50 paulus Exp $
+ * 3. The name(s) of the authors of this software must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission.
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by Paul Mackerras
+ *     <paulus@samba.org>".
+ *
+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $Id: deflate.c,v 1.12 2004/01/17 05:47:55 carlsonj Exp $
  */
 
 #ifdef AIX4
 #include "../common/zlib.h"
 #endif
 
+#ifdef SOL2
+#include <sys/sunddi.h>
+#endif
+
 #if DO_DEFLATE
 
 #define DEFLATE_DEBUG  1
@@ -68,25 +80,25 @@ struct deflate_state {
 
 #define DEFLATE_OVHD   2               /* Deflate overhead/packet */
 
-static void    *z_alloc __P((void *, u_int items, u_int size));
-static void    *z_alloc_init __P((void *, u_int items, u_int size));
-static void    z_free __P((void *, void *ptr));
-static void    *z_comp_alloc __P((u_char *options, int opt_len));
-static void    *z_decomp_alloc __P((u_char *options, int opt_len));
-static void    z_comp_free __P((void *state));
-static void    z_decomp_free __P((void *state));
-static int     z_comp_init __P((void *state, u_char *options, int opt_len,
-                                int unit, int hdrlen, int debug));
-static int     z_decomp_init __P((void *state, u_char *options, int opt_len,
-                                    int unit, int hdrlen, int mru, int debug));
-static int     z_compress __P((void *state, mblk_t **mret,
-                                 mblk_t *mp, int slen, int maxolen));
-static void    z_incomp __P((void *state, mblk_t *dmsg));
-static int     z_decompress __P((void *state, mblk_t *cmp,
-                                   mblk_t **dmpp));
-static void    z_comp_reset __P((void *state));
-static void    z_decomp_reset __P((void *state));
-static void    z_comp_stats __P((void *state, struct compstat *stats));
+static void    *z_alloc(void *, u_int items, u_int size);
+static void    *z_alloc_init(void *, u_int items, u_int size);
+static void    z_free(void *, void *ptr);
+static void    *z_comp_alloc(u_char *options, int opt_len);
+static void    *z_decomp_alloc(u_char *options, int opt_len);
+static void    z_comp_free(void *state);
+static void    z_decomp_free(void *state);
+static int     z_comp_init(void *state, u_char *options, int opt_len,
+                           int unit, int hdrlen, int debug);
+static int     z_decomp_init(void *state, u_char *options, int opt_len,
+                             int unit, int hdrlen, int mru, int debug);
+static int     z_compress(void *state, mblk_t **mret,
+                          mblk_t *mp, int slen, int maxolen);
+static void    z_incomp(void *state, mblk_t *dmsg);
+static int     z_decompress(void *state, mblk_t *cmp,
+                                   mblk_t **dmpp);
+static void    z_comp_reset(void *state);
+static void    z_decomp_reset(void *state);
+static void    z_comp_stats(void *state, struct compstat *stats);
 
 /*
  * Procedures exported to ppp_comp.c.