emacs-diffs
[Top][All Lists]
Advanced

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

feature/android 3f4653400f1: Avoid crashes when the primary clip is empt


From: Po Lu
Subject: feature/android 3f4653400f1: Avoid crashes when the primary clip is empty
Date: Fri, 28 Jul 2023 03:25:43 -0400 (EDT)

branch: feature/android
commit 3f4653400f1ad0ac07d9a4ac905777772494f41d
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Avoid crashes when the primary clip is empty
    
    * src/androidselect.c (Fandroid_get_clipboard): Don't return
    data if clipboard is empty.  Reported by Johan Widén
    <j.e.widen@gmail.com>.
---
 src/androidselect.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/androidselect.c b/src/androidselect.c
index f5371280457..9910e7921de 100644
--- a/src/androidselect.c
+++ b/src/androidselect.c
@@ -194,6 +194,9 @@ Alternatively, return nil if the clipboard is empty.  */)
                                             method);
   android_exception_check ();
 
+  if (!bytes)
+    return Qnil;
+
   length = (*android_java_env)->GetArrayLength (android_java_env,
                                                bytes);
   data = (*android_java_env)->GetByteArrayElements (android_java_env,



reply via email to

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