diff options
| author | Alex Vakulenko <avakulenko@chromium.org> | 2015-06-09 10:09:44 -0700 |
|---|---|---|
| committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-09 20:17:26 +0000 |
| commit | ef31bec13e2e57ee7163b0a68b7a88cae0ee7956 (patch) | |
| tree | c2e4af8aeb298e28297184c420152525b4febcf4 /libcutils/socket_local_server_unix.cpp | |
| parent | ba08992d1e8fce01ebc37518efecfea92d8f44cf (diff) | |
metrics: Add a check for abnormally small messages to prevent crashes
In some situations the |message_size| read from |fd| comes up as 0. In this
case we try to read a negative size for the message body and this leads for
crashes. Add a check to make sure that message_size is at least 4 bytes long
to account for the required 32-bit integer message size field.
BUG=chrome-os-partner:40711
TEST=`FEATURES=test emerge-link metrics`
Change-Id: Ie9adbc8e0e6a9f2c80450bf7ebcb3e05ad1f1f8e
Reviewed-on: https://chromium-review.googlesource.com/276362
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Diffstat (limited to 'libcutils/socket_local_server_unix.cpp')
0 files changed, 0 insertions, 0 deletions
