Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #33  
Old 05-22-2009, 03:53 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Code:
			char* response;
			int sayid = ivrs->item_id - 500000;

			if (sayid && sayid > 0) 
			{
				const char *ERR_MYSQLERROR = "Error in saylink phrase queries after clicking the link";
				char errbuf[MYSQL_ERRMSG_SIZE];
				char *query = 0;
				MYSQL_RES *result;
				MYSQL_ROW row;
				

				if(database.RunQuery(query,MakeAnyLenString(&query,"SELECT `phrase` FROM saylink WHERE `id` = '%i'", sayid),errbuf,&result))
				{
					if (mysql_num_rows(result) == 1)
					{
						row = mysql_fetch_row(result);
						strcpy(response, row[0]);
					}
This is at best a crash and at worse something far more dangerous. You can't simply strcpy to memory that does not exist. While there's a chance because you don't initialize response that the memory does exist you're going to be overwriting random data and it's going to do *bad* things to your server.

Code:
char response[64];
Also it better not be crashing the zone just because of something as trivial as not having a target, there should be sanity checks in place to counter that.
Reply With Quote
 


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 10:40 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3