uint64 overflow #1801

Closed
opened 2020-09-25 14:22:34 +00:00 by youxq · 1 comment

version: v0.8.1

# session_convert.go
...
		return nil, ErrUnSupportedType
	case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
		return int64(fieldValue.Uint()), nil
	default:
		return fieldValue.Interface(), nil
	}
    
# statement.go
...
		case reflect.Uint8, reflect.Uint16, reflect.Uint, reflect.Uint32, reflect.Uint64:
			if !requiredField && fieldValue.Uint() == 0 {
				continue
			}
			t := int64(fieldValue.Uint())
			val = reflect.ValueOf(&t).Interface()
		case reflect.Struct:

If the value of insert is uint64, it will be cast to int64, resulting in overflow

version: v0.8.1 ``` # session_convert.go ... return nil, ErrUnSupportedType case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: return int64(fieldValue.Uint()), nil default: return fieldValue.Interface(), nil } # statement.go ... case reflect.Uint8, reflect.Uint16, reflect.Uint, reflect.Uint32, reflect.Uint64: if !requiredField && fieldValue.Uint() == 0 { continue } t := int64(fieldValue.Uint()) val = reflect.ValueOf(&t).Interface() case reflect.Struct: ``` If the value of insert is uint64, it will be cast to int64, resulting in overflow
Owner

Please try to upgrade to latest version.

Please try to upgrade to latest version.
lunny added the
need
feedback
label 2021-06-12 08:41:00 +00:00
lunny closed this issue 2021-07-11 13:49:15 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1801
No description provided.