gcmd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gcmd-dev] Bug 351952 fix: crash when searching for locked files by cont


From: Mike Crash
Subject: [gcmd-dev] Bug 351952 fix: crash when searching for locked files by content
Date: Sat, 27 Jan 2007 17:38:58 +0100
User-agent: Icedove 1.5.0.9 (X11/20061220)

There is bug when searching for files by content and the file has no read permission. The file is found (list permission is set in directory), but the content cannot be read. In file gnome-cmd-search-dialog.c in function content_matches on line 226 there is no check for NULL buffer returned from load_file.

The function should be:

/**
* Determinates if the content of a file matches an regexp
*
*/
static gboolean
content_matches (GnomeCmdFile *finfo, SearchData *data)
{
   static regmatch_t match;
   gint ret = REG_NOMATCH;
   gchar *buf = load_file (finfo);
   if (buf)
   {
       ret = regexec (data->content_regex, buf, 1, &match, 0);
       g_free (buf);
   }
   return (ret == 0);
}

Please update it, it will fix bug 351952 and maybe 399464 too.

Thx

Mike




reply via email to

[Prev in Thread] Current Thread [Next in Thread]