Issue information

Issue ID
#1223
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Mar 19, 2008 13:20
Last Post
Hercules Elf Bot
Mar 19, 2008 13:20
Confirmation
N/A

Hercules Elf Bot - Mar 19, 2008 13:20

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=1223

In npc_parse_shop(), there is code that reacts incorrectly to invalid items.

The function uses itemdb_search() to look up the item id. If the ID does not exist, itemdb_ensure() uses a dummy data structure. Which means this function never returns NULL - but code in trunk assumes it does.

The dummy data is initialized this way: buy price = 0, sell price = 1. The code never checks whether the item is invalid, and instead prints the "buy price is less than sell price, warning eploit!" message and continues.