summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-25 20:59:50 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-25 20:59:50 +0000
commit89d56e6b10b96d775ff976744d40e54a99b1a539 (patch)
tree6ae7613931183e09a84ff0e95d662f35accb1240 /src/map
parent11aa057887c73b752e00bdf0f00b0b3f6b6b7f7a (diff)
downloadhercules-89d56e6b10b96d775ff976744d40e54a99b1a539.tar.gz
hercules-89d56e6b10b96d775ff976744d40e54a99b1a539.tar.bz2
hercules-89d56e6b10b96d775ff976744d40e54a99b1a539.tar.xz
hercules-89d56e6b10b96d775ff976744d40e54a99b1a539.zip
* Fixed a crash when an unknown map is encountered during parsing a 'script' npc and the script has mismatched curly braces (bugreport:4423, since r11502).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14502 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/npc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index dcfa52193..9f988df6f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3129,7 +3129,12 @@ void npc_parsesrcfile(const char* filepath)
{// Incorrect map, we must skip the script info...
ShowError("npc_parsesrcfile: Unknown map '%s' in file '%s', line '%d'. Skipping line...\n", mapname, filepath, strline(buffer,p-buffer));
if( strcasecmp(w2,"script") == 0 && count > 3 )
- p = npc_skip_script(p,buffer,filepath);
+ {
+ if((p = npc_skip_script(p,buffer,filepath)) == NULL)
+ {
+ break;
+ }
+ }
p = strchr(p,'\n');// next line
continue;
}
@@ -3137,7 +3142,12 @@ void npc_parsesrcfile(const char* filepath)
if( m < 0 )
{// "mapname" is not assigned to this server, we must skip the script info...
if( strcasecmp(w2,"script") == 0 && count > 3 )
- p = npc_skip_script(p,buffer,filepath);
+ {
+ if((p = npc_skip_script(p,buffer,filepath)) == NULL)
+ {
+ break;
+ }
+ }
p = strchr(p,'\n');// next line
continue;
}