The Samba-Bugzilla – Attachment 5612 Details for
Bug 5335
potential infinite loop in x_fwrite
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git am format patch
0001-Fix-bug-5335-potential-infinite-loop-in-x_fwrite.patch (text/plain), 1.37 KB, created by
Volker Lendecke
on 2010-04-08 06:57:55 UTC
(
hide
)
Description:
git am format patch
Filename:
MIME Type:
Creator:
Volker Lendecke
Created:
2010-04-08 06:57:55 UTC
Size:
1.37 KB
patch
obsolete
>From 5c06cadb66008278fdbcd3c25aa1773540d12b19 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 8 Apr 2010 13:56:22 +0200 >Subject: [PATCH] Fix bug 5335: potential infinite loop in x_fwrite > >--- > lib/util/xfile.c | 14 ++++++++++---- > 1 files changed, 10 insertions(+), 4 deletions(-) > >diff --git a/lib/util/xfile.c b/lib/util/xfile.c >index 16499e1..0fcdc59 100644 >--- a/lib/util/xfile.c >+++ b/lib/util/xfile.c >@@ -57,7 +57,9 @@ XFILE *x_stderr = &_x_stderr; > /** simulate setvbuf() */ > int x_setvbuf(XFILE *f, char *buf, int mode, size_t size) > { >- x_fflush(f); >+ if (x_fflush(f) != 0) { >+ return -1; >+ } > if (f->bufused) return -1; > > /* on files being read full buffering is the only option */ >@@ -136,7 +138,7 @@ int x_fclose(XFILE *f) > int ret; > > /* make sure we flush any buffered data */ >- x_fflush(f); >+ (void)x_fflush(f); > > ret = close(f->fd); > f->fd = -1; >@@ -175,7 +177,9 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f) > > if (n == 0) { > /* it's full, flush it */ >- x_fflush(f); >+ if (x_fflush(f) != 0) { >+ return -1; >+ } > continue; > } > >@@ -190,7 +194,9 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f) > int i; > for (i=(size*nmemb)-1; i>=0; i--) { > if (*(i+(const char *)p) == '\n') { >- x_fflush(f); >+ if (x_fflush(f) != 0) { >+ return -1; >+ } > break; > } > } >-- >1.6.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 5335
:
3187
|
3243
| 5612