summaryrefslogtreecommitdiff
path: root/lib/stream.c
diff options
context:
space:
mode:
authorDaniel Walton <dwalton76@gmail.com>2017-09-12 17:48:03 -0400
committerGitHub <noreply@github.com>2017-09-12 17:48:03 -0400
commite775854d9c87fc3dd163559b344f50b2acf4d562 (patch)
tree72b04b908620fcd1fd70ac849558c353c32b2be9 /lib/stream.c
parent016bded5d504dec6af791cb468e7b316a52af05a (diff)
parent937652c6e43fc74ba969bbace475bdf929cdc5d0 (diff)
Merge pull request #1133 from opensourcerouting/shift-sign
*: fix be32 reading / 24-bit left shift
Diffstat (limited to 'lib/stream.c')
-rw-r--r--lib/stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stream.c b/lib/stream.c
index 577fa257df..f88689f677 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++];