/[packages]/cauldron/xsel/current/SOURCES/xsel-1.2.0-do-not-terminate-string.patch
ViewVC logotype

Contents of /cauldron/xsel/current/SOURCES/xsel-1.2.0-do-not-terminate-string.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1549244 - (show annotations) (download)
Sat Feb 22 07:21:07 2020 UTC (3 years, 9 months ago) by daviddavid
File size: 1273 byte(s)
- add fedora patches to fix build

1 From d2e8846d44789844720c967a20a0d3b044dc1bbc Mon Sep 17 00:00:00 2001
2 From: Eric Biggers <ebiggers3@gmail.com>
3 Date: Sun, 6 Mar 2016 11:54:54 -0600
4 Subject: [PATCH 1/2] Do not prematurely terminate string while receiving INCR
5 transfer
6
7 This fixes a bug where xsel would only output the first 3999 characters
8 of the selection.
9 ---
10 xsel.c | 7 ++++---
11 1 file changed, 4 insertions(+), 3 deletions(-)
12
13 diff --git a/xsel.c b/xsel.c
14 index 79cc68b..b131ca6 100644
15 --- a/xsel.c
16 +++ b/xsel.c
17 @@ -516,14 +516,15 @@ get_append_property (XSelectionEvent * xsl, unsigned char ** buffer,
18 print_debug (D_TRACE, "Got zero length property; end of INCR transfer");
19 return False;
20 } else if (format == 8) {
21 - if ((unsigned long)*offset + length > (unsigned long)*alloc) {
22 - *alloc = *offset + length;
23 + if ((unsigned long)*offset + length + 1 > (unsigned long)*alloc) {
24 + *alloc = *offset + length + 1;
25 if ((*buffer = realloc (*buffer, *alloc)) == NULL) {
26 exit_err ("realloc error");
27 }
28 }
29 ptr = *buffer + *offset;
30 - xs_strncpy (ptr, value, length);
31 + memcpy (ptr, value, length);
32 + ptr[length] = '\0';
33 *offset += length;
34 print_debug (D_TRACE, "Appended %d bytes to buffer\n", length);
35 } else {
36 --
37 2.14.3
38

  ViewVC Help
Powered by ViewVC 1.1.28