]> arthur.barton.de Git - netatalk.git/commitdiff
More tests for broken resource forks.
authordidg <didg>
Sat, 10 Jul 2004 02:15:29 +0000 (02:15 +0000)
committerdidg <didg>
Sat, 10 Jul 2004 02:15:29 +0000 (02:15 +0000)
libatalk/adouble/ad_open.c

index 44aeb5efe2ce0337cd6450a9016d1bc2ea6e33e5..9c6d2398839f4d5143f38722a77bbc7c4c3735b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_open.c,v 1.30.6.14 2004-05-11 08:28:33 didg Exp $
+ * $Id: ad_open.c,v 1.30.6.15 2004-07-10 02:15:29 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -516,7 +516,7 @@ static void parse_entries(struct adouble *ad, char *buf,
        len = ntohl( len );
        buf += sizeof( len );
 
-       if ( 0 < eid && eid < ADEID_MAX ) {
+       if ( 0 < eid && eid < ADEID_MAX && off < sizeof(ad->ad_data) && off +len <= sizeof(ad->ad_data)) {
            ad->ad_eid[ eid ].ade_off = off;
            ad->ad_eid[ eid ].ade_len = len;
        } else if (!warning) {