]> jfr.im git - irc/weechat/weechat.git/commitdiff
core: check that buffer is not NULL in function gui_input_clipboard_copy
authorSébastien Helleu <redacted>
Sun, 1 Jan 2023 13:39:38 +0000 (14:39 +0100)
committerSébastien Helleu <redacted>
Sun, 1 Jan 2023 13:39:38 +0000 (14:39 +0100)
src/gui/gui-input.c

index 387aa72cb30f05dee6439a64a2cfb286f0c6f1e9..1b54dbb6a602192e71ca77763cd9508302be43af 100644 (file)
@@ -283,7 +283,7 @@ gui_input_insert_string (struct t_gui_buffer *buffer, const char *string)
 void
 gui_input_clipboard_copy (const char *buffer, int size)
 {
-    if (size <= 0)
+    if (!buffer || (size <= 0))
         return;
 
     if (gui_input_clipboard != NULL)
@@ -913,7 +913,6 @@ gui_input_delete_next_word (struct t_gui_buffer *buffer)
                                                 1); /* stop completion */
 }
 
-
 /*
  * Deletes all from cursor pos to beginning of line (default key: ctrl-U).
  */