Commit 412c01b6 authored by Chong Yidong's avatar Chong Yidong

Fix use of unitialized memory.

* charset.c (load_charset_map_from_file)
(load_charset_map_from_vector): Zero out allocated
charset_map_entries before using them.
parent 00cffdeb
2010-02-28 Chong Yidong <cyd@stupidchicken.com>
* charset.c (load_charset_map_from_file)
(load_charset_map_from_vector): Zero out allocated
charset_map_entries before using them.
2010-02-27 Andreas Schwab <schwab@linux-m68k.org>
* w32uniscribe.c (uniscribe_check_otf): Fix length check.
......
......@@ -531,6 +531,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
SAFE_ALLOCA (head, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = head;
bzero (entries, sizeof (struct charset_map_entries));
n_entries = 0;
eof = 0;
......@@ -557,6 +558,7 @@ load_charset_map_from_file (charset, mapfile, control_flag)
SAFE_ALLOCA (entries->next, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = entries->next;
bzero (entries, sizeof (struct charset_map_entries));
}
idx = n_entries % 0x10000;
entries->entry[idx].from = from;
......@@ -596,6 +598,7 @@ load_charset_map_from_vector (charset, vec, control_flag)
SAFE_ALLOCA (head, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = head;
bzero (entries, sizeof (struct charset_map_entries));
n_entries = 0;
for (i = 0; i < len; i += 2)
......@@ -632,6 +635,7 @@ load_charset_map_from_vector (charset, vec, control_flag)
SAFE_ALLOCA (entries->next, struct charset_map_entries *,
sizeof (struct charset_map_entries));
entries = entries->next;
bzero (entries, sizeof (struct charset_map_entries));
}
idx = n_entries % 0x10000;
entries->entry[idx].from = from;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment