View Issue Details

IDProjectCategoryView StatusLast Update
0000084Volume 2Bugpublic2019-06-06 18:30
ReporteranonymousAssigned To 
PrioritylowSeveritycrashReproducibilityalways
Status newResolutionopen 
PlatformWin32OSOS Version
Product Version 
Target VersionIssue 2Fixed in Version 
Summary0000084: Mapserver crashes when attempting html export with -charinfo option (non-critical, resolution not needed for issue 1)
DescriptionDuring html exporting, a blank string is fed to a function which is not expecting one, which then crashes attempting to create a buffer
Steps To ReproduceStart a server, make sure at least one mapserver is running
Create a csv file under 'c:\charinfo\req\shard' (any filename so long as it is .csv)
Inside the csv file, put the name of a valid character (in quotes if a space is in the name) as the only entry
Run a new mapserver with the -charinfo command line option
This mapserver will crash
Additional InformationNeeds a one line fix as per attached diff to reject a string if the buffer size would be negative
TagsNo tags attached.
subsystem

Activities

anonymous

2019-05-13 16:48

viewer  

CharInfo.diff (642 bytes)
 Common/container/dbcontainerpack.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Common/container/dbcontainerpack.c b/Common/container/dbcontainerpack.c
index 70178e23..ea2fbb55 100644
--- a/Common/container/dbcontainerpack.c
+++ b/Common/container/dbcontainerpack.c
@@ -87,6 +87,7 @@ int decodeLine(char **buffptr,char *table,char *field,char **val_ptr,int *idx_pt
 
 	// Copy a single line into a seperate buffer.
 	end = strpbrk(buff, "\n\r" );
+	if (end <= buff) { return 0; } // BW: Prevents a crash when charinfo passes us an empty string
 	estrConcatFixedWidth(&local_buff, buff, end-buff);
 	if (*end == '\r')
 		end++;
CharInfo.diff (642 bytes)

Issue History

Date Modified Username Field Change
2019-05-13 16:48 anonymous New Issue
2019-05-13 16:48 anonymous File Added: CharInfo.diff
2019-06-06 18:30 Chet Target Version => Issue 2