ClipIt-v1.2.1-10112010002

+ Fixed: Fixed OOM bug when copying large chunks of text by limiting
                the history entry to 512KB.
                (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602205)

Changes to be committed:

        modified:   ChangeLog
        modified:   configure.in
        modified:   src/history.c
        modified:   src/history.h
This commit is contained in:
Cristian Henzel 2010-11-10 11:21:03 +02:00
parent 3904959627
commit 196001d0ba
4 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
ClipIt-v1.2.1-10112010002 - 10 Nov. 2010
+ Fixed: Fixed OOM bug when copying large chunks of text by limiting
the history entry to 512KB.
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=602205)
ClipIt-v1.2.0-10112010001 - 10 Nov. 2010 ClipIt-v1.2.0-10112010001 - 10 Nov. 2010
+ Added: Option to save URIs (they were actually saved by default before, but + Added: Option to save URIs (they were actually saved by default before, but
now you have the option to disable this behaviour). now you have the option to disable this behaviour).

View File

@ -2,7 +2,7 @@
# Autoconf/automake. # Autoconf/automake.
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
AC_PREREQ([2.5]) AC_PREREQ([2.5])
AC_INIT([clipit], [1.2.0], [oss@web-tm.com]) AC_INIT([clipit], [1.2.1], [oss@web-tm.com])
AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()]) AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])

View File

@ -107,6 +107,9 @@ check_and_append(gchar* item)
{ {
if (item) if (item)
{ {
/* if item is too big, we don't include it in the history */
if(strlen(item) > ENTRY_MAX_SIZE)
return;
GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
/* Prepend new item */ /* Prepend new item */
/* Check if we have URIs */ /* Check if we have URIs */

View File

@ -25,6 +25,9 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define HISTORY_FILE ".local/share/clipit/history" #define HISTORY_FILE ".local/share/clipit/history"
/* Set maximum size of one clipboard entry to 512KB
* 250 pages × 2000 characters per page - should be more than enough */
#define ENTRY_MAX_SIZE 524288
extern GSList* history; extern GSList* history;