matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Integer underflow in email offset calculation

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug Integer underflow at fetcher/fetcher.go:400 when offset > limit. uint32 subtraction without bounds check creates large positive value.

To reproduce

  1. Call FetchMailboxEmails with offset=100, limit=50
  2. Subtraction (selectData.NumMessages - offset) underflows
  3. Wrong cursor position, fetches incorrect emails

Expected behavior Validate offset <= limit before subtraction

Matcha version master

OS All

Additional context File: fetcher/fetcher.go line 400 uint32 arithmetic can underflow

andrinoff avatar Apr 21 '26 14:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 22 '26 06:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar Jun 04 '26 19:06 floatpanebot