Skip to content

Commit

Permalink
Merge pull request #11 from Stapelzeiger/master
Browse files Browse the repository at this point in the history
Don't allow negative fixnums in unsigned integer read
  • Loading branch information
camgunz committed Nov 19, 2014
2 parents 337c49b + 59625d7 commit 2a67060
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,6 @@ bool cmp_read_uint(cmp_ctx_t *ctx, uint32_t *i) {

switch (obj.type) {
case CMP_TYPE_POSITIVE_FIXNUM:
case CMP_TYPE_NEGATIVE_FIXNUM:
case CMP_TYPE_UINT8:
*i = obj.as.u8;
return true;
Expand All @@ -1423,7 +1422,6 @@ bool cmp_read_ulong(cmp_ctx_t *ctx, uint64_t *u) {

switch (obj.type) {
case CMP_TYPE_POSITIVE_FIXNUM:
case CMP_TYPE_NEGATIVE_FIXNUM:
case CMP_TYPE_UINT8:
*u = obj.as.u8;
return true;
Expand Down Expand Up @@ -2512,7 +2510,6 @@ bool cmp_object_as_ushort(cmp_object_t *obj, uint16_t *s) {
bool cmp_object_as_uint(cmp_object_t *obj, uint32_t *i) {
switch (obj->type) {
case CMP_TYPE_POSITIVE_FIXNUM:
case CMP_TYPE_NEGATIVE_FIXNUM:
case CMP_TYPE_UINT8:
*i = obj->as.u8;
return true;
Expand All @@ -2530,7 +2527,6 @@ bool cmp_object_as_uint(cmp_object_t *obj, uint32_t *i) {
bool cmp_object_as_ulong(cmp_object_t *obj, uint64_t *u) {
switch (obj->type) {
case CMP_TYPE_POSITIVE_FIXNUM:
case CMP_TYPE_NEGATIVE_FIXNUM:
case CMP_TYPE_UINT8:
*u = obj->as.u8;
return true;
Expand Down

0 comments on commit 2a67060

Please sign in to comment.