uninitialized var in encnames.c
uninitialized var in encnames.c
От:
ma lz <ma100@hotmail.com>
Дата:
int
pg_char_to_encoding(const char *name)
{
char buff[NAMEDATALEN], // ------------------ UNINITIALIZED
key = clean_encoding_name(name, buff);
}
static char *
clean_encoding_name(const char *key, char *newkey)
{
const char *p;
char *np;
for (p = key, np = newkey; *p != '\0'; p++)
{
if (isalnum((unsigned char) *p))
{
if (*p >= 'A' && *p <= 'Z')
*np++ = *p + 'a' - 'A';
else
*np++ = *p;
}
}
*np = '\0';
return newkey;
}
回复: uninitialized var in encnames.c
От:
ma lz <ma100@hotmail.com>
Дата:
I've made a mistake, please ignore last mail
发件人: ma lz
发送时间: 2026年1月15日 16:00
收件人: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
主题: uninitialized var in encnames.c
发送时间: 2026年1月15日 16:00
收件人: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
主题: uninitialized var in encnames.c
int
pg_char_to_encoding(const char *name)
{
char buff[NAMEDATALEN], // ------------------ UNINITIALIZED
key = clean_encoding_name(name, buff);
}
static char *
clean_encoding_name(const char *key, char *newkey)
{
const char *p;
char *np;
for (p = key, np = newkey; *p != '\0'; p++)
{
if (isalnum((unsigned char) *p))
{
if (*p >= 'A' && *p <= 'Z')
*np++ = *p + 'a' - 'A';
else
*np++ = *p;
}
}
*np = '\0';
return newkey;
}