uint64 overflow #1800

Closed
opened 2020-09-25 14:22:23 +00:00 by youxq · 0 comments

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
lunny closed this issue 2020-10-17 15:55:21 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 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#1800
No description provided.