Skip to content

Commit b3d1a4b

Browse files
committed
Fix for security warning.
1 parent d6596e0 commit b3d1a4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

maybe.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ func (maybeSelf MaybeDef) ToInt32() (int32, error) {
232232
default:
233233
return int32(0), errors.New("unsupported")
234234
case string:
235-
val, err := maybeSelf.ToInt64()
236-
return int32(val), err
235+
parseInt, err := strconv.ParseInt((ref).(string), 10, 32)
236+
return int32(parseInt), err
237237
case bool:
238238
val, err := maybeSelf.ToBool()
239239
if val {
@@ -274,7 +274,7 @@ func (maybeSelf MaybeDef) ToInt64() (int64, error) {
274274
default:
275275
return int64(0), errors.New("unsupported")
276276
case string:
277-
return strconv.ParseInt(maybeSelf.ToString(), 10, 32)
277+
return strconv.ParseInt((ref).(string), 10, 64)
278278
case bool:
279279
val, err := maybeSelf.ToBool()
280280
if val {

0 commit comments

Comments
 (0)