am_add_feature(f, fe_program_dump);
am_add_feature(f, fe_program_gnutar);
- am_add_feature(f, fe_program_backup_api);
+ am_add_feature(f, fe_program_application_api);
am_add_feature(f, fe_options_compress_fast);
am_add_feature(f, fe_options_compress_best);
am_add_feature(f, fe_req_options_config);
am_add_feature(f, fe_rep_sendsize_quoted_error);
+ am_add_feature(f, fe_req_xml);
+ am_add_feature(f, fe_pp_script);
+ am_add_feature(f, fe_amindexd_DLE);
+ am_add_feature(f, fe_amrecover_dle_in_header);
+ am_add_feature(f, fe_xml_estimate);
+ am_add_feature(f, fe_xml_property_priority);
+ am_add_feature(f, fe_sendsize_rep_warning);
}
return f;
}
am_feature_t *f = NULL;
size_t i;
int ch1, ch2;
+ char * orig = s;
if (s != NULL && strcmp(s,"UNKNOWNFEATURE") != 0) {
f = am_allocate_feature_set();
ch1 -= 'a';
ch1 += 10;
} else if (ch1 >= 'A' && ch1 <= 'F') {
- ch1 -= 'a';
+ ch1 -= 'A';
ch1 += 10;
} else {
- break;
+ goto bad;
}
ch2 = *s++;
if (isdigit(ch2)) {
ch2 -= 'a';
ch2 += 10;
} else if (ch2 >= 'A' && ch2 <= 'F') {
- ch2 -= 'a';
+ ch2 -= 'A';
ch2 += 10;
- } else {
- amfree(f); /* bad conversion */
+ } else if (ch2 == '\0') {
+ g_warning("odd number of digits in amfeature string; truncating");
break;
+ } else {
+ goto bad;
}
f->bytes[i] = (unsigned char)((ch1 << 4) | ch2);
}
}
return f;
+
+bad:
+ g_warning("Bad feature string '%s'", orig);
+ am_release_feature_set(f);
+ return NULL;
}
#if defined(TEST)