From: Grant Erickson Date: Wed, 2 Mar 2011 16:24:32 +0000 (+0100) Subject: profile: Ignore malformed profiles X-Git-Tag: 2.0_alpha~1670 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=672a33a8a96cc0f8dadadd442cb066bcc84be519;p=framework%2Fconnectivity%2Fconnman.git profile: Ignore malformed profiles 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. --- diff --git a/src/profile.c b/src/profile.c index 3018fdc..e6a397b 100644 --- a/src/profile.c +++ b/src/profile.c @@ -462,6 +462,19 @@ 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;