/friends input page bug

Discussion in 'Report Bugs' started by TheMint, May 17, 2017.

Thread Status:
Not open for further replies.
  1. TheMint

    TheMint Former Mod+ Donator

    Messages:
    6,175
    Likes Received:
    15,888
    Minecraft:
    TheMint
    Your username: TheMint
    In which minigame/server does the bug occur: Entire network.
    Detailed description of bug: Typing /friends -2147483648 will do this:
    [​IMG]
     
    safoya299 likes this.
  2. ItsHarry

    ItsHarry Owner Staff Member Owner

    Messages:
    9,372
    Likes Received:
    23,362
    Minecraft:
    ItsHarry
    Good job on finding that, not going to fix it though.

    Basically in my code I take the page number and subtract it by 1. Then I check if it's lower than 1.

    However what happens is, because you inputted the lowest possible value for a signed integer in Java, due to the integer overflowing, subtracting -2147483648 by 1 actually gives a positive number 2147483647, meaning it passes the lower than 1 check, and therefore just shows an empty list instead of giving the usual "number must be between 1 and x" error message
     
    Aiqw, Sakujo, ZeusV and 1 other person like this.
Thread Status:
Not open for further replies.