View Issue Details

IDProjectCategoryView StatusLast Update
0001927SOGoSOPEpublic2012-08-28 08:12
Reporterbuzzdee Assigned Toludovic  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.16 
Fixed in Version1.3.18 
Summary0001927: PATCH: Searching for Umlauts in OGo contacts interface, and other search interfaces throws an exception
Description

When searching for Umlauts in OGo webinterface, I get an exception about an unterminated character string.

Attached patch fixes the problem for me, and I verified with SOGo, and it doesn't break it. As far as I can see, SOGo doesn't even seem to use that method.
Patch is against SOPE 1.3.17.

Additional Information

Could this patch be considered to be added to the next SOPE release please.

TagsNo tags attached.

Activities

2012-08-10 08:24

 

patch-sope-gdl1_GDLAccess_EOExpressionArray_m (1,045 bytes)   
$OpenBSD$

Fix crasher in OGo when running OGo with LC_CTYPE='de_DE.UTF-8' and searching
with Umlauts.

--- sope-gdl1/GDLAccess/EOExpressionArray.m.orig	Tue Jul 31 17:37:56 2012
+++ sope-gdl1/GDLAccess/EOExpressionArray.m	Tue Jul 31 17:38:31 2012
@@ -140,14 +140,16 @@
   relationshipPaths:(NSMutableArray *)relationshipPaths  
 {
     EOExpressionArray *exprArray;
-    unsigned char buf[[expression cStringLength] + 4]; // TODO: not too good
+    unsigned char buf[[expression lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 4]; // TODO: not too good
     const unsigned char *s, *start;
     id objectToken;
     NSAutoreleasePool *pool;
     
     exprArray = [[EOExpressionArray new] autorelease];
     pool = [[NSAutoreleasePool alloc] init];
-    [expression getCString:(char *)buf];
+    [expression getCString:(char *)buf 
+		maxLength:[expression lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 4
+		encoding:NSUTF8StringEncoding];
     s = buf;
     
     /* Divide the expression string in alternating substrings that obey the
buzzdee

buzzdee

2012-08-28 07:31

reporter   ~0004392

can this patch be considered for SOPE 1.3.18 please.

thanks,
Sebastian

ludovic

ludovic

2012-08-28 08:12

administrator   ~0004393

Fix pushed:

http://mtn.inverse.ca/revision/diff/511791fc5bfb5cf1f56266a5c55753aa26f958b8/with/a548133128c8f057cf55481568691064bdebd5f8

Thanks!

Issue History

Date Modified Username Field Change
2012-08-10 08:24 buzzdee New Issue
2012-08-10 08:24 buzzdee File Added: patch-sope-gdl1_GDLAccess_EOExpressionArray_m
2012-08-28 07:31 buzzdee Note Added: 0004392
2012-08-28 08:12 ludovic Note Added: 0004393
2012-08-28 08:12 ludovic Status new => resolved
2012-08-28 08:12 ludovic Fixed in Version => 1.3.18
2012-08-28 08:12 ludovic Resolution open => fixed
2012-08-28 08:12 ludovic Assigned To => ludovic
2012-08-28 08:12 ludovic Status resolved => closed