[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensuse-packaging
Subject:    Re: [opensuse-packaging] Function returning random data : build failed,
From:       Bruno Friedmann <bruno () ioda-net ! ch>
Date:       2011-07-27 9:44:36
Message-ID: 4E2FDE04.3020200 () ioda-net ! ch
[Download RAW message or body]

See inside ...

On 07/27/2011 11:06 AM, Marcus Meissner wrote:
> On Wed, Jul 27, 2011 at 10:52:57AM +0200, Bruno Friedmann wrote:
> > Hi,
> > I'm building a mapserver5 version in
> > 
> > With the latest version which contain security bug fixes I'm now getting a build \
> > failed 
> > I: Program returns random data in a function
> > E: mapserver5 no-return-in-nonvoid-function mapogr.cpp:3500
> > 
> > Here the function
> > /************************************************************************/
> > /*                           msOGREscapeSQLParam                        */
> > /************************************************************************/
> > char *msOGREscapeSQLParam(layerObj *layer, const char *pszString)
> > {
> > char* pszEscapedStr =NULL;
> > #ifdef USE_OGR
> > if(layer && pszString && strlen(pszString) > 0)
> > {
> > char* pszEscapedOGRStr =  CPLEscapeString(pszString, strlen(pszString),
> > CPLES_SQL );
> > pszEscapedStr = strdup(pszEscapedOGRStr);
> > CPLFree(pszEscapedOGRStr);
> > return pszEscapedStr;
> > }
> 
> 
> <<<<<<<<< Here should be a return too. Perhaps a return NULL;? z

In fact by moving the return pszEscapedStr; outside the if it simply work
if we don't go inside the if, so pszEscapedStr is NULL and this this what returned.


Once that pushed by a patch, the osc build success now .

It's exactly what they do inside the original code one function below
see
http://trac.osgeo.org/mapserver/browser/branches/branch-5-6/mapserver/mapogr.cpp?rev=11922
 around line 3498

> 
Once I will have tested my build, and use that functions, it seems I've to create a \
patch for upstream :-) (the easiest and safest, is renaming the comment :D)



> > #else
> > /* ------------------------------------------------------------------
> > * OGR Support not included...
> > * ------------------------------------------------------------------ */
> > 
> > msSetError(MS_MISCERR, "OGR support is not available.",
> > "msOGREscapeSQLParam()");
> > return NULL;
> > 
> > #endif /* USE_OGR */
> > }
> > 
> > How can I ride off of the error ?
> > return pszString
> > (string untouched ?)
> > 
> > sorry my c/c++ knowledge are very limited.
> 
> See insert above.
> 
> Ciao, Marcus


Thanks for your precious advices ...


-- 

Bruno Friedmann
Ioda-Net SÃ rl www.ioda-net.ch

openSUSE Member & Ambassador
GPG KEY : D5C9B751C4653227
irc: tigerfoot
-- 
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-packaging+help@opensuse.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic