GNOME Bugzilla – Bug 640695
g_key_file_load_from_file() mishandles a CR-LF that spans a 4 KB boundary
Last modified: 2011-01-28 04:08:29 UTC
Created attachment 179414 [details] Test case Overview: If g_key_file_load_from_file() is given a key file with CR-LF line endings, and a CR-LF sequence in the file straddles a 4096-byte boundary, the CR will not be properly stripped from the line it terminates. Steps to Reproduce: 1. Create a key file with the properties described above, where each key contains an integer value. 2. Load the key file with g_key_file_load_from_file(). 3. Use g_key_file_get_integer() to get each integer from the GKeyFile. Actual results: g_key_file_get_integer() produces an error when reading a key whose CR-LF terminator spans a 4 KB boundary. Expected results: All values should be read successfully. Additional info: Test case and patch attached.
Created attachment 179415 [details] [review] Patch
Thanks. Added with a testcase