diff --git a/inc/scanoss.h b/inc/scanoss.h index 3f21c1b..86552f1 100644 --- a/inc/scanoss.h +++ b/inc/scanoss.h @@ -44,7 +44,7 @@ #define WFP_REC_LN 18 /* Log files */ -#define SCANOSS_VERSION "5.3.4" +#define SCANOSS_VERSION "5.3.5" #define SCAN_LOG "/tmp/scanoss_scan.log" #define MAP_DUMP "/tmp/scanoss_map.dump" #define SLOW_QUERY_LOG "/tmp/scanoss_slow_query.log" diff --git a/src/report.c b/src/report.c index 7eef44d..8d724b4 100644 --- a/src/report.c +++ b/src/report.c @@ -245,7 +245,7 @@ bool print_json_component(component_data_t * component) free(version_clean); char * lastest_clean = version_cleanup(component->latest_version, component->component); - printf("\"latest\": \"%s\",", version_clean ? version_clean : ""); + printf("\"latest\": \"%s\",", lastest_clean ? lastest_clean : ""); free(lastest_clean); printf("\"url\": \"%s\",", component->main_url ? component->main_url : component->url); diff --git a/src/scan.c b/src/scan.c index 494349f..0a4ac23 100644 --- a/src/scan.c +++ b/src/scan.c @@ -265,6 +265,12 @@ int wfp_scan(char * path, int scan_max_snippets, int scan_max_components) /* Get file MD5 */ char * hexmd5 = strndup(line + tagln, MD5_LEN * 2); + if (strlen(hexmd5) < MD5_LEN * 2) + { + scanlog("Incorrect md5 len in line %s. Skipping\n", line); + free(hexmd5); + continue; + } rec = (uint8_t*) strdup(line + tagln + (MD5_LEN * 2) + 1); char * target = field_n(2, (char *)rec);