diff options
| author | Rafael Zalamena <rzalamena@users.noreply.github.com> | 2018-04-18 14:22:08 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-18 14:22:08 -0300 |
| commit | d61a30687b6a414a347d851f474348b5129033d2 (patch) | |
| tree | dd42269a330b9bcdcc57431da26bb4769f7ba09e /lib/buffer.c | |
| parent | c477dd0e7c5b38920cd0f79a2a08b0277270bbe9 (diff) | |
| parent | 6612590d9a22ffe4e461178d1f9248d7c9840332 (diff) | |
Merge pull request #2082 from qlyoung/sa-fixes
Even more static analysis fixes
Diffstat (limited to 'lib/buffer.c')
| -rw-r--r-- | lib/buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/buffer.c b/lib/buffer.c index 03202f1253..b573981c1b 100644 --- a/lib/buffer.c +++ b/lib/buffer.c @@ -429,6 +429,9 @@ in one shot. */ size_t iovcnt = 0; size_t nbyte = 0; + if (fd < 0) + return BUFFER_ERROR; + for (d = b->head; d && (iovcnt < MAX_CHUNKS) && (nbyte < MAX_FLUSH); d = d->next, iovcnt++) { iov[iovcnt].iov_base = d->data + d->sp; |
