render / rpms / edk2

Forked from rpms/edk2 3 months ago
Clone

Blame openssl-1.1.0-bio-fd-preserve-nl.patch

Paolo Bonzini 91c79a
diff -up a/CryptoPkg/Library/OpensslLib/openssl/crypto/bio/bss_fd.c.preserve-nl a/CryptoPkg/Library/OpensslLib/openssl/crypto/bio/bss_fd.c
Paolo Bonzini 91c79a
--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/bio/bss_fd.c.preserve-nl	2016-11-10 15:03:44.000000000 +0100
Paolo Bonzini 91c79a
+++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/bio/bss_fd.c	2016-12-22 14:36:16.730740423 +0100
Paolo Bonzini 91c79a
@@ -202,8 +202,10 @@ static int fd_gets(BIO *bp, char *buf, i
Paolo Bonzini 91c79a
     char *ptr = buf;
Paolo Bonzini 91c79a
     char *end = buf + size - 1;
Paolo Bonzini 91c79a
 
Paolo Bonzini 91c79a
-    while ((ptr < end) && (fd_read(bp, ptr, 1) > 0) && (ptr[0] != '\n'))
Paolo Bonzini 91c79a
-        ptr++;
Paolo Bonzini 91c79a
+    while (ptr < end && fd_read(bp, ptr, 1) > 0) {
Paolo Bonzini 91c79a
+        if (*ptr++ == '\n')
Paolo Bonzini 91c79a
+           break;
Paolo Bonzini 91c79a
+    }
Paolo Bonzini 91c79a
 
Paolo Bonzini 91c79a
     ptr[0] = '\0';
Paolo Bonzini 91c79a
 
Paolo Bonzini 91c79a
diff -up a/CryptoPkg/Library/OpensslLib/openssl/doc/crypto/BIO_read.pod.preserve-nl a/CryptoPkg/Library/OpensslLib/openssl/doc/crypto/BIO_read.pod
Paolo Bonzini 91c79a
--- a/CryptoPkg/Library/OpensslLib/openssl/doc/crypto/BIO_read.pod.preserve-nl	2016-11-10 15:03:45.000000000 +0100
Paolo Bonzini 91c79a
+++ b/CryptoPkg/Library/OpensslLib/openssl/doc/crypto/BIO_read.pod	2016-12-22 14:37:22.731245197 +0100
Paolo Bonzini 91c79a
@@ -23,7 +23,8 @@ in B<buf>. Usually this operation will a
Paolo Bonzini 91c79a
 from the BIO of maximum length B<len-1>. There are exceptions to this,
Paolo Bonzini 91c79a
 however; for example, BIO_gets() on a digest BIO will calculate and
Paolo Bonzini 91c79a
 return the digest and other BIOs may not support BIO_gets() at all.
Paolo Bonzini 91c79a
-The returned string is always NUL-terminated.
Paolo Bonzini 91c79a
+The returned string is always NUL-terminated and the '\n' is preserved
Paolo Bonzini 91c79a
+if present in the input data.
Paolo Bonzini 91c79a
 
Paolo Bonzini 91c79a
 BIO_write() attempts to write B<len> bytes from B<buf> to BIO B.
Paolo Bonzini 91c79a