<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 7: iptc-data.c:607: poor error checking ?</title><link href="https://sourceforge.net/p/libiptcdata/bugs/7/" rel="alternate"/><link href="https://sourceforge.net/p/libiptcdata/bugs/7/feed.atom" rel="self"/><id>https://sourceforge.net/p/libiptcdata/bugs/7/</id><updated>2016-12-22T17:13:38.083000Z</updated><subtitle>Recent changes to 7: iptc-data.c:607: poor error checking ?</subtitle><entry><title>iptc-data.c:607: poor error checking ?</title><link href="https://sourceforge.net/p/libiptcdata/bugs/7/" rel="alternate"/><published>2016-12-22T17:13:38.083000Z</published><updated>2016-12-22T17:13:38.083000Z</updated><author><name>dcb</name><uri>https://sourceforge.net/u/dcb314/</uri></author><id>https://sourceforge.netc8ca8a99c40166faa1f2fa69f46968d8aebd9bfc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;span&gt;[iptc-data.c:607]&lt;/span&gt;: (style) Checking if unsigned variable 'i' is less than zero.&lt;/p&gt;
&lt;p&gt;Source code is&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;i = iptc_data_dataset_index (data, dataset);
if (i &amp;lt; 0) return -1;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;but&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;unsigned int i;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Suggest put return value from function into local variable&lt;br/&gt;
of type int, then sanity check it &amp;gt;= 0, then write it into &lt;br/&gt;
local variable i.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[pyiptcdata.c:172]&lt;/span&gt;: (style) Checking if unsigned variable 'old_ps3_len' is less than zero.&lt;/p&gt;
&lt;p&gt;Probable duplicate.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>