From 2434c180f26194b078ca25b6f228f033a9605bf1 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Tue, 2 Jan 2007 01:07:57 +0200 Subject: [PATCH] Make no_str in charsets.c an array rather than a pointer variable. This ensures that no other string can have the same address. It probably never was a problem though, because the strings to which it can be compared either are allocated from the heap or are in strings[][] which already has unshared storage. --- src/intl/charsets.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intl/charsets.c b/src/intl/charsets.c index 0255f066a..d08c575dc 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -118,8 +118,11 @@ free_translation_table(struct conv_table *p) } /* A string used in conversion tables when there is no correct - * conversion. */ -static unsigned char *no_str = "*"; + * conversion. This is compared by address and therefore should be a + * named array rather than a pointer so that it won't share storage + * with any other string literal that happens to have the same + * characters. */ +static unsigned char no_str[] = "*"; static void new_translation_table(struct conv_table *p)