Announcement

Collapse
No announcement yet.

Possible Bazaar Exploit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Possible Bazaar Exploit

    Just a note about a new possible bazaar exploit (I have not tested it myself). If you are to believe this post on the official forums then selling stacks of items worth more than 4 million pp may result in you losing money on the sale.

    The exploit might be obvious to some people but I won't spoil it until its confirmed and fixed or turns out not to exist. The barter side may well have a similar issue with sales of stacks over 4 million (I'm far too poor to test this unfortunately).

    I'm half-surprised to see this sort of bug still in the game and half wondering how many more similar bugs are out there. Wasn't there a related bug/exploit like this fixed some time ago?
    Reorx Holybeard, 75th Dwarven Cleric of Brell (Tunare), Lord of Unrest, Bane of the Undead, Drinker of Ale...
    Dougann Redhammer, 75th Dwarven Rogue (Tunare)

  • #2
    Here's exactly what happened: they apparently store Bazaar prices as an unsigned long integer (in copper pieces). 17 * 300k plat = 5,100,000,000 copper. The maximum size of an unsigned long integer is 256^4 = 4,294,967,296. So if you try storing 5,100,000,000 in the unsigned long integer, it rolls over and you end up with 5,100,000,000 - 4,294,967,296 = 805,032,704 = 805k plat and change just like the Bazaar guy experienced.

    Moral: don't set up more than 4,294,967 pp in any one stack of Bazaar items.

    If the devs want a quick fix, put some code like this into the Bazzar purchase script:
    double number, price;
    number = get_number_purchased();
    price = get_item_price();
    if ( number * price > 4000000000.0 )
    {
    display_error("You can't purchase more than 4,000,000 platinum in items in one transaction.");
    cancel_purchase();
    }
    Last edited by Zolina; 12-16-2007, 04:49 PM.

    Comment


    • #3
      Without looking at the code, I expect that Zolina is correct.
      Ngreth Thergn

      Ngreth nice Ogre. Ngreth not eat you. Well.... Ngreth not eat you if you still wiggle!
      Grandmaster Smith 250
      Master Tailor 200
      Ogres not dumb - we not lose entire city to froggies

      Comment

      Working...
      X