* lib/af_alg.c (afalg_stream): Ignore the kernel's result if the input
stream is empty.
+2018-05-05 Bruno Haible <bruno@clisp.org>
+
+ af_alg: Fix bug on empty files.
+ * lib/af_alg.c (afalg_stream): Ignore the kernel's result if the input
+ stream is empty.
+
2018-05-05 Paul Eggert <eggert@cs.ucla.edu>
sys-limits.h: new file for crypto and safe I/O
else
{
/* sendfile not possible, do a classic read-write loop. */
+ int non_empty = 0;
ssize_t size;
char buf[BLOCKSIZE];
while ((size = fread (buf, 1, sizeof buf, stream)))
{
+ non_empty = 1;
if (send (ofd, buf, size, MSG_MORE) != size)
{
ret = -EIO;
ret = -EIO;
goto out_ofd;
}
+ /* On Linux 4.4.0 at least, the value for an empty stream is wrong
+ (all zeroes). */
+ if (!non_empty)
+ {
+ ret = -EAFNOSUPPORT;
+ goto out_ofd;
+ }
}
if (read (ofd, resblock, hashlen) != hashlen)