u16 buf16[4], enabled; u32 buf32[7], items, items2, val; 
__le16 buf16[4]; u16 enabled; __le32 buf32[7]; u32 items, items2, val; 
int avtab_read_item(void *fp, u32 vers, struct avtab *a,	            int (*insertf)(struct avtab *a, struct avtab_key *k,				   struct avtab_datum *d, void *p),		    void *p){	u16 buf16[4], enabled;	u32 buf32[7], items, items2, val;	struct avtab_key key;	struct avtab_datum datum;	int i, rc;	memset(&key, 0, sizeof(struct avtab_key));	memset(&datum, 0, sizeof(struct avtab_datum));	if (vers < POLICYDB_VERSION_AVTAB) {		rc = next_entry(buf32, fp, sizeof(u32));		if (rc < 0) {			printk(KERN_ERR "security: avtab: truncated entry\n");			return -1;		}		items2 = le32_to_cpu(buf32[0]);		if (items2 > ARRAY_SIZE(buf32)) {			printk(KERN_ERR "security: avtab: entry overflow\n");			return -1;		}		rc = next_entry(buf32, fp, sizeof(u32)*items2);		if (rc < 0) {			printk(KERN_ERR "security: avtab: truncated entry\n");			return -1;		}		items = 0;		val = le32_to_cpu(buf32[items++]);		key.source_type = (u16)val;		if (key.source_type != val) {			printk("security: avtab: truncated source type\n");			return -1;		}		val = le32_to_cpu(buf32[items++]);		key.target_type = (u16)val;		if (key.target_type != val) {			printk("security: avtab: truncated target type\n");			return -1;		}		val = le32_to_cpu(buf32[items++]);		key.target_class = (u16)val;		if (key.target_class != val) {			printk("security: avtab: truncated target class\n");			return -1;		}		val = le32_to_cpu(buf32[items++]);		enabled = (val & AVTAB_ENABLED_OLD) ? AVTAB_ENABLED : 0;		if (!(val & (AVTAB_AV | AVTAB_TYPE))) {			printk("security: avtab: null entry\n");			return -1;		}		if ((val & AVTAB_AV) &&		    (val & AVTAB_TYPE)) {			printk("security: avtab: entry has both access vectors and types\n");			return -1;		}		for (i = 0; i < sizeof(spec_order)/sizeof(u16); i++) {			if (val & spec_order[i]) {				key.specified = spec_order[i] | enabled;				datum.data = le32_to_cpu(buf32[items++]);				rc = insertf(a, &key, &datum, p);				if (rc) return rc;			}		}		if (items != items2) {			printk("security: avtab: entry only had %d items, expected %d\n", items2, items);			return -1;		}		return 0;	}	rc = next_entry(buf16, fp, sizeof(u16)*4);	if (rc < 0) {		printk("security: avtab: truncated entry\n");		return -1;	}	items = 0;	key.source_type = le16_to_cpu(buf16[items++]);	key.target_type = le16_to_cpu(buf16[items++]);	key.target_class = le16_to_cpu(buf16[items++]);	key.specified = le16_to_cpu(buf16[items++]);	rc = next_entry(buf32, fp, sizeof(u32));	if (rc < 0) {		printk("security: avtab: truncated entry\n");		return -1;	}	datum.data = le32_to_cpu(*buf32);	return insertf(a, &key, &datum, p);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b5bf6c55edf94e9c7fc01724d5b271f78eaf1d3f/avtab.c/clean/security/selinux/ss/avtab.c