# HG changeset patch # User Daniel Atallah # Date 1186875680 0 # Node ID 33fed83f56c83fb4bffdf4cb936b640fc4ff6119 # Parent 0ac6c0fbc102e8b42978bcddd7e83e843f614e4f malloc(0) returns a null pointer. Fixes #2472. diff -r 0ac6c0fbc102 -r 33fed83f56c8 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Sat Aug 11 21:26:43 2007 +0000 +++ b/pidgin/gtkimhtml.c Sat Aug 11 23:41:20 2007 +0000 @@ -1037,7 +1037,7 @@ { char *tmp; - if (text == NULL) + if (text == NULL || !(*text)) return; tmp = g_markup_escape_text(text, -1); @@ -1053,7 +1053,7 @@ if (!gtk_text_view_get_editable(GTK_TEXT_VIEW(imhtml))) return; - if (imhtml->wbfo || selection_data->length < 0) { + if (imhtml->wbfo || selection_data->length <= 0) { gtk_clipboard_request_text(clipboard, paste_plaintext_received_cb, imhtml); return; } else {