Raised This Month: $ Target: $400
 0% 

Solved Indexing a string while copying by reference


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-16-2022 , 03:28   Re: Indexing a string inside a native will cause outbounds?
Reply With Quote #3

Nah its just a question out of curiosity.

Can you explain how does it make sense?


For example lets say this is the body function of

PHP Code:
get_user_name(idname[], len)
{
   for(new 
i; <= leni++)
   {
      
name[i] = g_PlayerName[i];
      
// Since we passed 10 to the array cell in the second parameter we advanced 10x4bytes, now we're accessing memory not allocated to us, which will probably cause a crash.

   
}

Yeah so it seems it might cause index out of bounds but also memory access error.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-16-2022 at 03:44.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode