summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2021-02-23 13:51:04 -0600
committerRichard Lowe <richlowe@richlowe.net>2021-03-10 13:27:22 -0600
commit431a74760e42d5af1054ef3d5de0e389ea277476 (patch)
tree7abb38cc418d0d2914c48f1816846f7929b88609
parentc45618a5778581b6ec976bf7c034fd7afaa757d7 (diff)
downloadillumos-joyent-431a74760e42d5af1054ef3d5de0e389ea277476.tar.gz
13580 cpcgen frees bad buffer
Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
-rw-r--r--usr/src/tools/cpcgen/cpcgen.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr/src/tools/cpcgen/cpcgen.c b/usr/src/tools/cpcgen/cpcgen.c
index bbc1126610..779a782cc6 100644
--- a/usr/src/tools/cpcgen/cpcgen.c
+++ b/usr/src/tools/cpcgen/cpcgen.c
@@ -1442,7 +1442,7 @@ cpcgen_manual_amd_file_before(FILE *f, cpc_map_t *map)
return (B_FALSE);
}
- if ((desc = strdup(map->cmap_name)) == NULL) {
+ if ((desc = strdup(map->cmap_name + 1)) == NULL) {
warn("failed to duplicate manual name for %s", map->cmap_name);
free(upper);
return (B_FALSE);
@@ -1452,7 +1452,6 @@ cpcgen_manual_amd_file_before(FILE *f, cpc_map_t *map)
upper[i] = toupper(upper[i]);
}
- desc++;
c = strchr(desc, '_');
if (c != NULL) {
*c = ' ';