<div class="markdown_content"><ul>
<li><strong>status</strong>: open --&gt; closed-fixed</li>
<li><strong>Comment</strong>:</li>
</ul>
<p>Fixed as of v 3.4.12; API changed as noted.</p>
<hr/>
<p><strong> <a class="alink strikethrough" href="https://sourceforge.net/p/cwb/bugs/41/">[bugs:#41]</a> cl_string_canonical: risk of buffer overflow</strong></p>
<p><strong>Status:</strong> closed-fixed<br/>
<strong>Group:</strong> TODO-4.0<br/>
<strong>Labels:</strong> CL low-level library <br/>
<strong>Created:</strong> Fri Sep 03, 2010 11:00 AM UTC by Andrew Hardie<br/>
<strong>Last Updated:</strong> Sun Jun 15, 2014 11:39 PM UTC<br/>
<strong>Owner:</strong> Andrew Hardie</p>
<p>cl_string_canonical currently modifies strings in situ. It will be more convenient for it to always return a newly allocated string unless specifically instructed.</p>
<p>char * <br/>
cl_string_canonical(char *s, CorpusCharset charset, int flags, size_t inplace_bufsize)</p>
<p>If inplace_bufsize == 0 (or negative), a newly allocated string is returned.</p>
<p>If inplace_bufsize &gt; 0, s is modified in-place up to a maximum size of inplace_bufsize-1 characters (plus NUL terminator).  If the normalised string doesn't fit into the buffer, the extra characters are dropped silently.  For UTF-8 strings, the result allocated by Glib is copied to s (dropping characters that don't fit) and then free'd, as in the current implementation.</p>
<p>This will break backwards compartibiltiy of the CL.</p>
<hr/>
<p>Sent from sourceforge.net because cwb@sslmit.unibo.it is subscribed to <a href="https://sourceforge.net/p/cwb/bugs/">https://sourceforge.net/p/cwb/bugs/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/cwb/admin/bugs/options.">https://sourceforge.net/p/cwb/admin/bugs/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>