Patch 9.0.1638

12 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 17, 2023, 10:01:04 AM6/17/23
to vim...@googlegroups.com

Patch 9.0.1638 (after 9.0.1637)
Problem: crypt tests hang and cause memory errors
Solution: Move variable to start of function.
Files: src/fileio.c


*** ../vim-9.0.1637/src/fileio.c 2023-06-16 21:42:02.380360392 +0100
--- src/fileio.c 2023-06-17 14:56:20.386925633 +0100
***************
*** 218,223 ****
--- 218,224 ----
int using_b_ffname;
int using_b_fname;
static char *msg_is_a_directory = N_("is a directory");
+ int eof = FALSE;
#ifdef FEAT_SODIUM
int may_need_lseek = FALSE;
#endif
***************
*** 1222,1228 ****
size -= conv_restlen;
}

- int eof = FALSE;
if (read_buffer)
{
/*
--- 1223,1228 ----
***************
*** 1306,1313 ****
{
// set size to 8K + Sodium Crypt Metadata
size = WRITEBUFSIZE + crypt_get_max_header_len()
! + crypto_secretstream_xchacha20poly1305_HEADERBYTES
! + crypto_secretstream_xchacha20poly1305_ABYTES;
may_need_lseek = TRUE;
}

--- 1306,1313 ----
{
// set size to 8K + Sodium Crypt Metadata
size = WRITEBUFSIZE + crypt_get_max_header_len()
! + crypto_secretstream_xchacha20poly1305_HEADERBYTES
! + crypto_secretstream_xchacha20poly1305_ABYTES;
may_need_lseek = TRUE;
}

***************
*** 1328,1338 ****
}
}
# endif
! eof = size;
! size = read_eintr(fd, ptr, size);
filesize_count += size;
// hit end of file
! eof = (size < eof || filesize_count == filesize_disk);
}

#ifdef FEAT_CRYPT
--- 1328,1338 ----
}
}
# endif
! long read_size = size;
! size = read_eintr(fd, ptr, read_size);
filesize_count += size;
// hit end of file
! eof = (size < read_size || filesize_count == filesize_disk);
}

#ifdef FEAT_CRYPT
*** ../vim-9.0.1637/src/version.c 2023-06-16 21:42:02.380360392 +0100
--- src/version.c 2023-06-17 14:53:56.447093657 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1638,
/**/

--
hundred-and-one symptoms of being an internet addict:
188. You purchase a laptop so you can surf while sitting on the can.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Tony Mechelynck

unread,
Jun 17, 2023, 10:36:52 AM6/17/23
to Bram Moolenaar, vim...@googlegroups.com
On Sat, Jun 17, 2023 at 4:01 PM Bram Moolenaar <Br...@moolenaar.net> wrote:
>
>
> Patch 9.0.1638 (after 9.0.1637)
> Problem: crypt tests hang and cause memory errors
> Solution: Move variable to start of function.
> Files: src/fileio.c
[...]

This gives me a compiler warning in the Tiny build, as follows:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1 -o objects/fileio.o fileio.c
fileio.c: In function ‘readfile’:
fileio.c:221:17: warning: variable ‘eof’ set but not used
[-Wunused-but-set-variable]
221 | int eof = FALSE;
| ^~~


Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages