<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 9:31 AM, Markus Neteler <span dir="ltr"><<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I have uploaded the current trunk (r62476), some improvements achieved!<br>
Analysis Summary:<br>
New defects found: 4<br>
Defects eliminated: 19<br>
<br>
Below the 4 newly introduced issues, hoping for comments/fixes.<br>
<br>
Markus<br>
<br>
The results are available at <a href="http://scan.coverity.com/projects/1038" target="_blank">http://scan.coverity.com/projects/1038</a><br>
<span class=""><br>
---------- Forwarded message ----------<br>
From: <<a href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a>><br>
</span><span class="">Date: Wed, Oct 29, 2014 at 2:19 PM<br>
Subject: New Defects reported by Coverity Scan for grass<br>
To: <a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a><br>
<br>
Hi,<br>
<br>
Please find the latest report on new defect(s) introduced to grass<br>
found with Coverity Scan.<br>
<br>
4 new defect(s) introduced to grass found with Coverity Scan.<br>
</span>19 defect(s), reported by Coverity Scan earlier, were marked fixed in<br>
<span class="">the recent build analyzed by Coverity Scan.<br>
<br>
New defect(s) Reported-by: Coverity Scan<br>
</span>Showing 4 of 4 defect(s)<br>
<br>
<br>
** CID 1249942: Resource leak (RESOURCE_LEAK)<br>
/raster/r.viewshed/grass.cpp: 661 in save_grid_to_GRASS(grid_ *, char<br>
*, int, outputMode_)()<br></blockquote><div><br></div><div><br></div><div>should be fixed in r62477,8</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
** CID 1249941: Untrusted value as argument (TAINTED_SCALAR)<br>
<br>
** CID 1249940: Untrusted value as argument (TAINTED_SCALAR)<br>
<br>
** CID 1249939: Uninitialized pointer read (UNINIT)<br>
/ps/ps.map/ps_vpoints.c: 272 in PS_vpoints_plot()<br>
<br></blockquote><div>should be fixed in r62479,r62480</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
________________________________________________________________________________________________________<br>
*** CID 1249942: Resource leak (RESOURCE_LEAK)<br>
/raster/r.viewshed/grass.cpp: 661 in save_grid_to_GRASS(grid_ *, char<br>
*, int, outputMode_)()<br>
655 } /* for j */<br>
656 Rast_put_row(outfd, outrast, type);<br>
657 } /* for i */<br>
658 G_percent(1, 1, 1);<br>
659<br>
660 Rast_close(outfd);<br>
>>> CID 1249942: Resource leak (RESOURCE_LEAK)<br>
>>> Variable "outrast" going out of scope leaks the storage it points to.<br>
661 return;<br>
662 }<br>
663<br>
664<br>
665<br>
666<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1249941: Untrusted value as argument (TAINTED_SCALAR)<br>
/lib/segment/open.c: 89 in Segment_open()<br>
83 close(SEG->fd);<br>
84 if (-1 == (SEG->fd = open(SEG->fname, 2))) {<br>
85 unlink(SEG->fname);<br>
86 G_warning(_("Unable to re-open segment file"));<br>
87 return -4;<br>
88 }<br>
>>> CID 1249941: Untrusted value as argument (TAINTED_SCALAR)<br>
>>> Passing tainted variable "SEG->srows" to a tainted sink.<br>
89 if (0 > (ret = Segment_init(SEG, SEG->fd, nseg))) {<br>
90 close(SEG->fd);<br>
91 unlink(SEG->fname);<br>
92 if (ret == -1) {<br>
93 G_warning(_("Could not read segment file"));<br>
94 return -5;<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1249940: Untrusted value as argument (TAINTED_SCALAR)<br>
/lib/segment/init.c: 78 in Segment_init()<br>
72 || !read_off_t(fd, &SEG->ncols)<br>
73 || !read_int(fd, &SEG->srows)<br>
74 || !read_int(fd, &SEG->scols)<br>
75 || !read_int(fd, &SEG->len))<br>
76 return -1;<br>
77<br>
>>> CID 1249940: Untrusted value as argument (TAINTED_SCALAR)<br>
>>> Passing tainted variable "SEG->srows" to a tainted sink.<br>
78 return seg_setup(SEG);<br>
79 }<br>
80<br>
81<br>
82 static int read_int(int fd, int *n)<br>
83 {<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1249939: Uninitialized pointer read (UNINIT)<br>
/ps/ps.map/ps_vpoints.c: 272 in PS_vpoints_plot()<br>
266 }<br>
267 }<br>
268<br>
269 /* draw the icon */<br>
270 if ((vector.layer[vec].epstype == 0) ||<br>
271 (vector.layer[vec].epstype == 2 && !eps_exist)) {<br>
>>> CID 1249939: Uninitialized pointer read (UNINIT)<br>
>>> Using uninitialized value "Symb".<br>
272 if (Symb != NULL) {<br>
273 symbol_draw(sname, x, y, size, rotate,<br>
274 vector.layer[vec].width);<br>
275 }<br>
276 }<br>
277 } /* for (line) */<br>
278<br>
279 fprintf(PS.fp, "\n");<br>
280 return 0;<br>
<span class="im"><br>
<br>
________________________________________________________________________________________________________<br>
To view the defects in Coverity Scan visit,<br>
<a href="http://scan.coverity.com/projects/1038?tab=overview" target="_blank">http://scan.coverity.com/projects/1038?tab=overview</a><br>
</span><div class=""><div class="h5">_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</div></div></blockquote></div><br></div></div>