Ignore malformed profiles. That is, if there is no non-extension portion to the file (i.e. it is precisely named .profile), then ignore it. Passing such files to create_profile will result in a SIGABRT.
Signed-off-by: Grant Erickson <maratho...@gmail.com> diff --git a/src/profile.c b/src/profile.c index 3018fdc..d690dd7 100644 --- a/src/profile.c +++ b/src/profile.c @@ -462,6 +462,17 @@ static int profile_init(void) if (ident == NULL) continue; + /* If there is no non-extension portion to the file + * (i.e. it is precisely named ".profile"), then ignore + * it. Passing such files to create_profile will result in + * a SIGABRT. + */ + + if (file == ident) { + connman_info("Ignoring malformed profile '%s'\n", file); + continue; + } + str = g_string_new_len(file, ident - file); if (str == NULL) continue; -- 1.7.3.4 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman