1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 12:15:32 +03:00
aports/community/msitools/fix-segfault.patch
2018-07-16 13:21:13 +00:00

44 lines
1.5 KiB
Diff

diff --git a/tools/msiinfo.c b/tools/msiinfo.c
index ac299fd..e695f14 100644
--- a/tools/msiinfo.c
+++ b/tools/msiinfo.c
@@ -420,7 +420,7 @@ static gboolean export_create_table(const char *table,
guint num_columns = libmsi_record_get_field_count(names);
guint num_keys = libmsi_record_get_field_count(keys);
guint i, len;
- char size[20], extra[30];
+ char size[20], extra[30], typestr[20];
gchar *name, *type;
if (!strcmp(table, "_Tables") ||
@@ -455,25 +455,25 @@ static gboolean export_create_table(const char *table,
/* fall through */
case 's': case 'S':
strcpy(size, type+1);
- sprintf(type, "CHAR(%s)", size);
+ sprintf(typestr, "CHAR(%s)", size);
break;
case 'i': case 'I':
len = atol(type + 1);
if (len <= 2)
- strcpy(type, "INT");
+ strcpy(typestr, "INT");
else if (len == 4)
- strcpy(type, "LONG");
+ strcpy(typestr, "LONG");
else
abort();
break;
case 'v': case 'V':
- strcpy(type, "OBJECT");
+ strcpy(typestr, "OBJECT");
break;
default:
abort();
}
- printf("`%s` %s%s", name, type, extra);
+ printf("`%s` %s%s", name, typestr, extra);
g_free(name);
g_free(type);
}