Skip to content

Commit 2a67060

Browse files
committed
Merge pull request #11 from Stapelzeiger/master
Don't allow negative fixnums in unsigned integer read
2 parents 337c49b + 59625d7 commit 2a67060

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

cmp.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,6 @@ bool cmp_read_uint(cmp_ctx_t *ctx, uint32_t *i) {
13991399

14001400
switch (obj.type) {
14011401
case CMP_TYPE_POSITIVE_FIXNUM:
1402-
case CMP_TYPE_NEGATIVE_FIXNUM:
14031402
case CMP_TYPE_UINT8:
14041403
*i = obj.as.u8;
14051404
return true;
@@ -1423,7 +1422,6 @@ bool cmp_read_ulong(cmp_ctx_t *ctx, uint64_t *u) {
14231422

14241423
switch (obj.type) {
14251424
case CMP_TYPE_POSITIVE_FIXNUM:
1426-
case CMP_TYPE_NEGATIVE_FIXNUM:
14271425
case CMP_TYPE_UINT8:
14281426
*u = obj.as.u8;
14291427
return true;
@@ -2512,7 +2510,6 @@ bool cmp_object_as_ushort(cmp_object_t *obj, uint16_t *s) {
25122510
bool cmp_object_as_uint(cmp_object_t *obj, uint32_t *i) {
25132511
switch (obj->type) {
25142512
case CMP_TYPE_POSITIVE_FIXNUM:
2515-
case CMP_TYPE_NEGATIVE_FIXNUM:
25162513
case CMP_TYPE_UINT8:
25172514
*i = obj->as.u8;
25182515
return true;
@@ -2530,7 +2527,6 @@ bool cmp_object_as_uint(cmp_object_t *obj, uint32_t *i) {
25302527
bool cmp_object_as_ulong(cmp_object_t *obj, uint64_t *u) {
25312528
switch (obj->type) {
25322529
case CMP_TYPE_POSITIVE_FIXNUM:
2533-
case CMP_TYPE_NEGATIVE_FIXNUM:
25342530
case CMP_TYPE_UINT8:
25352531
*u = obj->as.u8;
25362532
return true;

0 commit comments

Comments
 (0)