- Timestamp:
- 02/09/09 14:53:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/regfi.c
r139 r140 200 200 if(fo != ret_val) 201 201 fo[-1] = '\0'; 202 203 /* XXX: what was this old VI flag for??204 XXX: Is this check right? 0xF == 1|2|4|8, which makes it redundant...205 if (flags == 0xF) {206 if (some) strcat(flg_output, " ");207 some = 1;208 strcat(flg_output, "VI");209 }210 */211 202 212 203 return ret_val; … … 814 805 ret_val->magic[1] = sk_header[1]; 815 806 816 /* XXX: Can additional validation be added here? */817 807 ret_val->unknown_tag = SVAL(sk_header, 0x2); 818 808 ret_val->prev_sk_off = IVAL(sk_header, 0x4); … … 821 811 ret_val->desc_size = IVAL(sk_header, 0x10); 822 812 813 if(ret_val->prev_sk_off != (ret_val->prev_sk_off & 0xFFFFFFF8) 814 || ret_val->next_sk_off != (ret_val->next_sk_off & 0xFFFFFFF8)) 815 { 816 regfi_add_message(file, REGFI_MSG_WARN, "SK record's next/previous offsets" 817 " are not a multiple of 8 while parsing SK record at" 818 " offset 0x%.8X.", offset); 819 free(ret_val); 820 return NULL; 821 } 822 823 823 if(ret_val->desc_size + REGFI_SK_MIN_LENGTH > ret_val->cell_size) 824 824 { 825 regfi_add_message(file, REGFI_MSG_ ERROR, "Security descriptor too large for"825 regfi_add_message(file, REGFI_MSG_WARN, "Security descriptor too large for" 826 826 " cell while parsing SK record at offset 0x%.8X.", 827 827 offset); … … 886 886 if((num_values * sizeof(uint32)) > cell_length-sizeof(uint32)) 887 887 { 888 regfi_add_message(file, REGFI_MSG_ ERROR, "Too many values found"888 regfi_add_message(file, REGFI_MSG_WARN, "Too many values found" 889 889 " while parsing value list at offset 0x%.8X.", offset); 890 /* XXX: During non-strict, should reduce num_values appropriately and 891 * continue instead of bailing out. 892 */ 890 893 return NULL; 891 894 } … … 1080 1083 if(nk->subkeys == NULL) 1081 1084 { 1082 /* XXX: Should we free the key and bail out here instead? 1083 * During nonstrict? 1084 */ 1085 regfi_add_message(file, REGFI_MSG_WARN, "Could not load subkey list" 1086 " while parsing NK record at offset 0x%.8X.", offset); 1085 1087 nk->num_subkeys = 0; 1086 1088 } … … 1843 1845 || (strict && ret_val->cell_size != (ret_val->cell_size & 0xFFFFFFF8))) 1844 1846 { 1845 regfi_add_message(file, REGFI_MSG_ ERROR, "A length check failed while"1847 regfi_add_message(file, REGFI_MSG_WARN, "A length check failed while" 1846 1848 " parsing NK record at offset 0x%.8X.", offset); 1847 1849 free(ret_val); … … 1961 1963 offset); 1962 1964 } 1963 /* XXX: Should add this back and make it more strict? 1964 if(strict && ret_val->classname == NULL) 1965 return NULL; 1966 */ 1965 1966 if(ret_val->classname == NULL) 1967 { 1968 regfi_add_message(file, REGFI_MSG_WARN, "Could not parse class" 1969 " name while parsing NK record at offset 0x%.8X.", 1970 offset); 1971 return NULL; 1972 } 1967 1973 } 1968 1974 … … 2303 2309 2304 2310 if((cell_len == 0) || ((cell_len & 0xFFFFFFF8) != cell_len)) 2305 /* XXX: should report an error here. */ 2311 { 2312 regfi_add_message(file, REGFI_MSG_ERROR, "Bad cell length encountered" 2313 " while parsing unallocated cells at offset 0x%.8X.", 2314 hbin->file_off+curr_off); 2306 2315 break; 2307 2316 } 2317 2308 2318 /* for some reason the record_size of the last record in 2309 2319 an hbin block can extend past the end of the block
Note: See TracChangeset
for help on using the changeset viewer.