diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2017-09-07 15:58:18 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-09-09 19:50:58 +0200 |
commit | 937652c6e43fc74ba969bbace475bdf929cdc5d0 (patch) | |
tree | f2cdea6d59fa9e2f20eafc512fe21203f6acdd6b /lib/stream.c | |
parent | Merge pull request #1118 from opensourcerouting/attr-kill-master (diff) | |
download | frr-937652c6e43fc74ba969bbace475bdf929cdc5d0.tar.xz frr-937652c6e43fc74ba969bbace475bdf929cdc5d0.zip |
*: fix be32 reading / 24-bit left shift
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/stream.c')
-rw-r--r-- | lib/stream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stream.c b/lib/stream.c index 577fa257d..f88689f67 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -394,7 +394,7 @@ u_int32_t stream_getl_from(struct stream *s, size_t from) return 0; } - l = s->data[from++] << 24; + l = (unsigned)(s->data[from++]) << 24; l |= s->data[from++] << 16; l |= s->data[from++] << 8; l |= s->data[from]; @@ -426,7 +426,7 @@ u_int32_t stream_getl(struct stream *s) return 0; } - l = s->data[s->getp++] << 24; + l = (unsigned)(s->data[s->getp++]) << 24; l |= s->data[s->getp++] << 16; l |= s->data[s->getp++] << 8; l |= s->data[s->getp++]; |