libnm: abort huge read in nm_vpn_service_plugin_read_vpn_details()

There is no need to accept such a huge read. Abort.
This commit is contained in:
Thomas Haller 2021-05-25 14:23:10 +02:00
parent 4a9fcb0fc3
commit 6bf7908d05
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -835,6 +835,10 @@ nm_vpn_service_plugin_read_vpn_details(int fd, GHashTable **out_data, GHashTable
if (!eof && c != '\n') {
g_string_append_c(line, c);
if (line->len > 512 * 1024) {
/* we are about to read a huge line. That is not right, abort. */
break;
}
continue;
}