summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-02-14 20:25:19 -0800
committerBill Richardson <wfrichar@chromium.org>2014-02-17 17:35:43 +0000
commitd778fabaaa143580f582c184eba0ef348a22a8d2 (patch)
tree685ef39ccbb3ff8beb75960290d239c095dda172
parent33e967eee16ee94e10868ef5a9f49d869f37d0d9 (diff)
downloadchrome-ec-d778fabaaa143580f582c184eba0ef348a22a8d2.tar.gz
Off-by-one error in read() call. BUG=chromium:239205 BRANCH=none TEST=none Change-Id: Ifec3dacfa07e83d70b2582036cab0cfc1ee9e8f7 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/186738 Reviewed-by: Dave Parker <dparker@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--util/lbplay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/lbplay.c b/util/lbplay.c
index d4a57e0567..455befdb80 100644
--- a/util/lbplay.c
+++ b/util/lbplay.c
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
perror("can't open version file");
goto out;
}
- ret = read(fd_v, buf, sizeof(buf));
+ ret = read(fd_v, buf, sizeof(buf) - 1);
if (ret <= 0) {
perror("can't read version");
close(fd_v);