X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bus%2Fdesktop-file.c;h=bfeb72e241befe91ed273a21b564e7a56118fdef;hb=7d9239c9c78cb6d0b9c282376fcf3cda1de23209;hp=2ba77292c47c14d1e488361c4979f3bbea3f3386;hpb=63196f69c420f55fbb1fa76adaa41877f7f06d7b;p=platform%2Fupstream%2Fdbus.git diff --git a/bus/desktop-file.c b/bus/desktop-file.c index 2ba7729..bfeb72e 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -18,9 +18,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ + +#include #include #include #include "desktop-file.h" @@ -330,7 +332,7 @@ new_line (BusDesktopFileParser *parser) line = §ion->lines[section->n_lines++]; - memset (line, 0, sizeof (BusDesktopFileLine)); + _DBUS_ZERO(*line); return line; } @@ -686,6 +688,12 @@ bus_desktop_file_load (DBusString *filename, else if (is_blank_line (&parser) || _dbus_string_get_byte (&parser.data, parser.pos) == '#') parse_comment_or_blank (&parser); + else if (parser.current_section < 0) + { + dbus_set_error(error, DBUS_ERROR_FAILED, + "invalid service file: key=value before [Section]"); + return NULL; + } else { if (!parse_key_value (&parser, error))