summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2018-11-06 17:22:06 -0500
committerJason Woodward2018-11-06 17:22:06 -0500
commit775669f1dcc52581c552cb0805c33f3ba9e2af62 (patch)
tree43ff87a7b3532653cfcb1c16b6d25421ac833cc6
parentbaa6fff0c032017ec95ba59b1fcef75153f677b8 (diff)
downloadslapt-get-775669f1dcc52581c552cb0805c33f3ba9e2af62.tar.gz
skip empty strcopy
-rw-r--r--src/package.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/package.c b/src/package.c
index a77881f..6ffe8bb 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1482,8 +1482,10 @@ static slapt_pkg_info_t *parse_meta_entry(slapt_pkg_list_t *avail_pkgs,
return NULL;
}
- strcpy(tmp_pkg_cond, dep_entry + parse_dep_regex->pmatch[2].rm_so);
- tmp_pkg_cond[tmp_cond_len] = '\0';
+ if (tmp_cond_len != 0) {
+ strcpy(tmp_pkg_cond, dep_entry + parse_dep_regex->pmatch[2].rm_so);
+ tmp_pkg_cond[tmp_cond_len] = '\0';
+ }
tmp_pkg_ver = slapt_regex_extract_match(parse_dep_regex, dep_entry, 3);