diff --git a/ChangeLog b/ChangeLog index c65c92a..856b9e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 + Added: Option to save URIs (they were actually saved by default before, but now you have the option to disable this behaviour). diff --git a/configure.in b/configure.in index 92d51ab..ca86281 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ # Autoconf/automake. # ------------------------------------------------------------------------------- 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()]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/history.c b/src/history.c index 9491ed3..47f24ac 100644 --- a/src/history.c +++ b/src/history.c @@ -107,6 +107,9 @@ check_and_append(gchar* 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); /* Prepend new item */ /* Check if we have URIs */ diff --git a/src/history.h b/src/history.h index 01b0fc3..30e1db6 100644 --- a/src/history.h +++ b/src/history.h @@ -25,6 +25,9 @@ G_BEGIN_DECLS #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;