-
If the user passes -1 length to g_io_channel_set_line_term() along with a nul-terminated string, then calls g_io_channel_get_line_term() and decides to treat the result as nul-terminated rather than checking the length parameter, then the application will have a problem, because it's not nul-terminated. That's weird, since the input string was. Let's ensure the result is consistent: if you pass a nul-terminated string, the result is nul-terminated. If not, it's not. Also add a warning to g_io_channel_get_line_term(), since it's very strange for a gchar * return value to be anything other than a nul-terminated UTF-8 string. This is an API design bug, but we cannot fix it.
7c6b11dfIf the user passes -1 length to g_io_channel_set_line_term() along with a nul-terminated string, then calls g_io_channel_get_line_term() and decides to treat the result as nul-terminated rather than checking the length parameter, then the application will have a problem, because it's not nul-terminated. That's weird, since the input string was. Let's ensure the result is consistent: if you pass a nul-terminated string, the result is nul-terminated. If not, it's not. Also add a warning to g_io_channel_get_line_term(), since it's very strange for a gchar * return value to be anything other than a nul-terminated UTF-8 string. This is an API design bug, but we cannot fix it.
Loading