Prevent dice overflow #27

Merged
pratyush merged 1 commits from overflow into master 2024-10-12 20:05:22 +02:00
Owner

rand.Int() would panic when the max value is <= 0, which happens when big.NewInt() was fed with a too large number. Avoid this by validating the big.NewInt() return beforehand. Add error handling to all callers to both gracefully return to IRC and to log an error message.

Signed-off-by: Georg Pfuetzenreuter mail@georg-pfuetzenreuter.net

rand.Int() would panic when the max value is <= 0, which happens when big.NewInt() was fed with a too large number. Avoid this by validating the big.NewInt() return beforehand. Add error handling to all callers to both gracefully return to IRC and to log an error message. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Georg added 1 commit 2024-10-10 02:36:59 +02:00
rand.Int() would panic when the max value is <= 0, which happens when
big.NewInt() was fed with a too large number. Avoid this by validating
the big.NewInt() return beforehand. Add error handling to all callers to
both gracefully return to IRC and to log an error message.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Georg force-pushed overflow from 94d31e829e to 5560c59614 2024-10-10 02:42:11 +02:00 Compare
Georg force-pushed overflow from 5560c59614 to 4dc94dc0cf 2024-10-10 02:46:52 +02:00 Compare
Georg changed title from WIP: Prevent dice overflow to Prevent dice overflow 2024-10-10 02:46:56 +02:00
Georg force-pushed overflow from 4dc94dc0cf to 930839ab58 2024-10-10 18:43:51 +02:00 Compare
pratyush merged commit 67ef6fec1b into master 2024-10-12 20:05:22 +02:00
pratyush deleted branch overflow 2024-10-12 20:05:22 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
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: LibertaCasa/watbot#27
No description provided.