if (!pkg->version)
{
- pkg->version= malloc(strlen(raw)+1);
+ pkg->version= calloc(1, strlen(raw)+1);
if ( pkg->version == NULL ) {
fprintf(stderr, "%s: out of memory \n", __FUNCTION__);
return ENOMEM;
pkg->priority = parseGenericFieldType("Priority", *lines);
else if(isGenericFieldType("Provides", *lines)){
/* Here we add the internal_use to align the off by one problem between provides_str and provides */
- provide = (char * ) malloc(strlen(*lines)+ 35 ); /* Preparing the space for the new opkg_internal_use_only */
+ provide = (char * ) calloc(1, strlen(*lines)+ 35 ); /* Preparing the space for the new opkg_internal_use_only */
if ( alterProvidesLine(*lines,provide) ){
return EINVAL;
}
case 'S':
if(isGenericFieldType("Section:", *lines))
pkg->section = parseGenericFieldType("Section", *lines);
+#ifdef HAVE_SHA256
+ else if(isGenericFieldType("SHA256sum:", *lines))
+ pkg->sha256sum = parseGenericFieldType("SHA256sum", *lines);
+#endif
else if(isGenericFieldType("Size:", *lines))
pkg->size = parseGenericFieldType("Size", *lines);
else if(isGenericFieldType("Source:", *lines))
out:;
*raw = lines;
-/* If the ipk has not a Provides line, we insert our false line */
+/* If the opk has not a Provides line, we insert our false line */
if ( pkg_false_provides==1)
{
pkg->provides_count = 1;
- pkg->provides_str = malloc (sizeof (char*));
+ pkg->provides_str = calloc (1, sizeof (char*));
pkg->provides_str[0] = strdup ("opkg_internal_use_only");
}