Page MenuHomeFreeBSD

D31383.diff
No OneTemporary

D31383.diff

Index: lib/libc/stdio/fread.c
===================================================================
--- lib/libc/stdio/fread.c
+++ lib/libc/stdio/fread.c
@@ -39,6 +39,7 @@
__FBSDID("$FreeBSD$");
#include "namespace.h"
+#include <assert.h>
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
@@ -129,8 +130,12 @@
}
while (resid > (r = fp->_r)) {
- (void)memcpy((void *)p, (void *)fp->_p, (size_t)r);
- fp->_p += r;
+ if (fp->_p) {
+ (void)memcpy((void *)p, (void *)fp->_p, (size_t)r);
+ fp->_p += r;
+ } else {
+ assert(r == 0);
+ }
/* fp->_r = 0 ... done in __srefill */
p += r;
resid -= r;

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 4:26 AM (21 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14730208
Default Alt Text
D31383.diff (628 B)

Event Timeline