Thread: Web Shortcuts
View Single Post
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 08-06-2012 , 16:41   Re: Web Shortcuts
Reply With Quote #284

Quote:
Originally Posted by deathkilla View Post
Code:
L 08/02/2012 - 141:59: [SM] Plugin encountered error 15: Array index is out of bounds
L 08/02/2012 - 141:59: [SM] Displaying call stack trace for plugin "webshortcuts.smx":
L 08/02/2012 - 141:59: [SM] [0] Line 57, webshortcuts.sp::OnSay()
Quote:
Originally Posted by deathkilla View Post
It was a general question, which could be answered by others. It was not directly towards sslice who has been offline for ages. There is more than 1 coder out there...
It's kind of obvious what the problem is - the array is being accessed out of bounds. More specifically if no arguments are given in the say command callback then, in the code:

Code:
GetCmdArgString(text, sizeof(text));
new len = strlen(text);
len will equal zero, so text[len-1], on line 57, will try to access text[-1] which is out of bounds. To fix this the callback needs to bug out if GetCmdArgString returns less than one.
__________________

Last edited by 11530; 08-06-2012 at 16:43.
11530 is offline