View Issue Details

IDProjectCategoryView StatusLast Update
0006941Multi Theft Auto : San AndreasClientpublic2012-04-19 10:07
ReporterMX_MasterAssigned Toccw 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformwindowsOSwindows xpOS Versionsp3
Product Version 
Target Version1.3.1Fixed in Version1.3.1 
Summary0006941: guiComboBoxGetItemText crashes when using indexes >= combobox's items count
Description

When using unknown index in guiComboBoxGetItemText, client is crashes

Steps To Reproduce

?ombo = guiCreateComboBox( 300,300, 100,80, "test", false )

guiComboBoxAddItem( ?ombo, '0' ) -- index of this item is 0
guiComboBoxAddItem( ?ombo, '1' ) -- index of this item is 1
guiComboBoxAddItem( ?ombo, '2' ) -- index of this item is 2

-- requesting text of item with unknown index 3
text = guiComboBoxGetItemText( combo, 3 ) -- CRASH!

-- here variable text must contains false
outputChatBox( 'text of unknown item 3 = '..tostring(text) )

Additional Information

may be needs some checks here:
http://code.google.com/p/mtasa-blue/source/browse/trunk/MTA10/gui/CGUIComboBox_Impl.cpp?spec=svn2939&r=2939#160

TagsNo tags attached.

Relationships

related to 0006942 resolvedccw Source patches Patch for #0006941: guiComboBoxGetItemText crashes when using unknown indexes 

Activities

MX_Master

2012-03-13 06:13

viewer   ~~0016284

Last edited: 2012-03-13 06:27

correct steps to reproduce for indexes >= combobox's items count:

combo = guiCreateComboBox( 300,300, 100,80, "test", false )

guiComboBoxAddItem( combo, '0' ) -- index of this item is 0
guiComboBoxAddItem( combo, '1' ) -- index of this item is 1
guiComboBoxAddItem( combo, '2' ) -- index of this item is 2

-- requesting text of item with unknown index 3
text = guiComboBoxGetItemText( combo, 3 ) -- CRASH!

-- here variable text must contains false
outputChatBox( 'text of unknown item 3 = '..tostring(text) )

MX_Master

2012-03-13 06:26

viewer   ~~0016285

steps tp reproduce for negative indexes (< -1):

combo = guiCreateComboBox( 300,300, 100,80, "test1", false )

guiComboBoxAddItem( combo, '0' ) -- index of this item is 0
guiComboBoxAddItem( combo, '1' ) -- index of this item is 1
guiComboBoxAddItem( combo, '2' ) -- index of this item is 2

-- requesting text of item with unknown index
text = guiComboBoxGetItemText( combo, -2 ) -- CRASH!

-- here variable text must contains false
outputChatBox( 'text of unknown item -2 = '..tostring(text) )

MX_Master

2012-03-13 07:00

viewer   ~~0016286

here is possible fix - #0006942

ccw

2012-04-16 06:58

administrator   ~~0016476

Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=3997

Issue History

Date Modified Username Field Change