Coverity-updates archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

New Defects reported by Coverity Scan for NetBSD-amd64-user



Hi,


Please find the latest report on new defect(s) introduced to NetBSD-amd64-user 
found with Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 20 of 277 defect(s)


** CID 33687:  String not null terminated  (STRING_NULL)
/external/gpl3/gcc/dist/lto-plugin/lto-plugin.c: 830 in process_symtab()

** CID 273814:  Dereference null return value  (NULL_RETURNS)
/lib/libc/resolv/herror.c: 110 in _herror()
/lib/libc/resolv/herror.c: 119 in _herror()

** CID 274047:  Dereference null return value  (NULL_RETURNS)
/external/bsd/am-utils/dist/libamu/wire.c: 326 in is_network_member()

** CID 274840:  Dereference null return value  (NULL_RETURNS)
/sys/net/bpf.c: 301 in bpf_movein()

** CID 274841:  Dereference null return value  (NULL_RETURNS)
/sys/kern/uipc_socket.c: 981 in sosend()

** CID 274845:  Dereference null return value  (NULL_RETURNS)
/sys/nfs/nfs_subs.c: 612 in nfsm_rpchead()
/sys/nfs/nfs_subs.c: 617 in nfsm_rpchead()
/sys/nfs/nfs_subs.c: 619 in nfsm_rpchead()

** CID 274846:  Dereference null return value  (NULL_RETURNS)
/sys/nfs/nfs_socket.c: 554 in nfs_rephead()
/sys/nfs/nfs_socket.c: 545 in nfs_rephead()

** CID 460219:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Actions.c: 918 in 
XawDeclareActionVar()

** CID 460238:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/libXt/dist/src/Shell.c: 1429 in 
_popup_set_prop()

** CID 460659:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Pixmap.c: 292 in 
XawLoadPixmap()

** CID 460660:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1559 in 
XawTextSinkConvertPropertyList()
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1559 in 
XawTextSinkConvertPropertyList()

** CID 460662:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1582 in 
XawTextSinkConvertPropertyList()
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1601 in 
XawTextSinkConvertPropertyList()
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1618 in 
XawTextSinkConvertPropertyList()
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1601 in 
XawTextSinkConvertPropertyList()
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1618 in 
XawTextSinkConvertPropertyList()

** CID 460663:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Converters.c: 564 in 
_XawCvtStringToDisplayList()

** CID 461588:  Uninitialized scalar variable  (UNINIT)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Actions.c: 478 in 
XawSetValuesAction()

** CID 721666:  Side effect in assertion  (ASSERT_SIDE_EFFECT)
/external/gpl3/gcc/dist/gcc/genautomata.c: 8356 in output_default_latencies()()

** CID 721667:  Buffer not null terminated  (BUFFER_SIZE_WARNING)
/external/gpl3/gcc/dist/gcc/genrecog.c: 2611 in debug_decision_2(decision_test 
*)()

** CID 721723:  Unchecked return value from library  (CHECKED_RETURN)
/external/gpl3/gcc/dist/gcc/genautomata.c: 9572 in write_automata()()

** CID 721724:  Unchecked return value from library  (CHECKED_RETURN)
/external/gpl3/gcc/dist/gcc/genhooks.c: 140 in emit_documentation(const char 
*)()

** CID 721791:  Operands don't affect result  (CONSTANT_EXPRESSION_RESULT)
/external/gpl3/gcc/dist/gcc/gengtype-state.c: 2467 in read_state_files_list()()

** CID 721807:  Copy-paste error  (COPY_PASTE_ERROR)
/external/gpl3/gcc/dist/gcc/gengtype.c: 3701 in write_types(outf *, type *, 
type *, const write_types_data *)()


________________________________________________________________________________________________________
*** CID 33687:  String not null terminated  (STRING_NULL)
/external/gpl3/gcc/dist/lto-plugin/lto-plugin.c: 830 in process_symtab()
824     
825       s = strrchr (name, '.');
826       if (s)
827         sscanf (s, ".%" PRI_LL "x", &obj->out->id);
828       secdata = xmalloc (length);
829       offset += obj->file->offset;
>>>     CID 33687:  String not null terminated  (STRING_NULL)
>>>     Function "read(int, void *, size_t)" does not terminate string 
>>> "*secdata".
830       if (offset != lseek (obj->file->fd, offset, SEEK_SET)
831             || length != read (obj->file->fd, secdata, length))
832         {
833           if (message)
834             message (LDPL_FATAL, "%s: corrupt object file", 
obj->file->name);
835           /* Force claim_file_handler to abandon this file.  */

________________________________________________________________________________________________________
*** CID 273814:  Dereference null return value  (NULL_RETURNS)
/lib/libc/resolv/herror.c: 110 in _herror()
104             struct iovec iov[4], *v = iov;
105             char *t;
106     
107             if (s != NULL && *s != '\0') {
108                     DE_CONST(s, t);
109                     v->iov_base = t;
>>>     CID 273814:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be null "t" when calling 
>>> "strlen(char const *)".
110                     v->iov_len = strlen(t);
111                     v++;
112                     DE_CONST(": ", t);
113                     v->iov_base = t;
114                     v->iov_len = 2;
115                     v++;
/lib/libc/resolv/herror.c: 119 in _herror()
113                     v->iov_base = t;
114                     v->iov_len = 2;
115                     v++;
116             }
117             DE_CONST(hstrerror(*__h_errno()), t);
118             v->iov_base = t;
>>>     CID 273814:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be null "v->iov_base" when calling 
>>> "strlen(char const *)".
119             v->iov_len = strlen(v->iov_base);
120             v++;
121             DE_CONST("\n", t);
122             v->iov_base = t;
123             v->iov_len = 1;
124             (void)writev(STDERR_FILENO, iov, (int)((v - iov) + 1));

________________________________________________________________________________________________________
*** CID 274047:  Dereference null return value  (NULL_RETURNS)
/external/bsd/am-utils/dist/libamu/wire.c: 326 in is_network_member()
320           if (STREQ(net, al->ip_net_name) || STREQ(net, al->ip_net_num))
321             return TRUE;
322       } else {
323         char *netstr = strdup(net), *maskstr;
324         u_long netnum, masknum = 0;
325         maskstr = strchr(netstr, '/');
>>>     CID 274047:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "maskstr".
326         maskstr[0] = '\0';          /* null terminate netstr */
327         maskstr++;
328         if (*maskstr == '\0')       /* if empty string, make it NULL */
329           maskstr = NULL;
330         /* check if netmask uses a dotted-quad or bit-length, or not 
defined at all */
331         if (maskstr) {

________________________________________________________________________________________________________
*** CID 274840:  Dereference null return value  (NULL_RETURNS)
/sys/net/bpf.c: 301 in bpf_movein()
295              * (Take into account possible alignment bytes)
296              */
297             if (len + align > MCLBYTES)
298                     return (EIO);
299     
300             m = m_gethdr(M_WAIT, MT_DATA);
>>>     CID 274840:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "m".
301             m->m_pkthdr.rcvif = 0;
302             m->m_pkthdr.len = (int)(len - hlen);
303             if (len + align > MHLEN) {
304                     m_clget(m, M_WAIT);
305                     if ((m->m_flags & M_EXT) == 0) {
306                             error = ENOBUFS;

________________________________________________________________________________________________________
*** CID 274841:  Dereference null return value  (NULL_RETURNS)
/sys/kern/uipc_socket.c: 981 in sosend()
975                             } else do {
976                                     sounlock(so);
977                                     splx(s);
978                                     if (top == NULL) {
979                                             m = m_gethdr(M_WAIT, MT_DATA);
980                                             mlen = MHLEN;
>>>     CID 274841:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "m".
981                                             m->m_pkthdr.len = 0;
982                                             m->m_pkthdr.rcvif = NULL;
983                                     } else {
984                                             m = m_get(M_WAIT, MT_DATA);
985                                             mlen = MLEN;
986                                     }

________________________________________________________________________________________________________
*** CID 274845:  Dereference null return value  (NULL_RETURNS)
/sys/nfs/nfs_subs.c: 612 in nfsm_rpchead()
606             char *bpos;
607             int i;
608             struct mbuf *mreq;
609             int siz, grpsiz, authsiz;
610     
611             authsiz = nfsm_rndup(auth_len);
>>>     CID 274845:  Dereference null return value  (NULL_RETURNS)
>>>     Assigning: "mb" = null return value from "m_gethdr(int, int)".
612             mb = m_gethdr(M_WAIT, MT_DATA);
613             MCLAIM(mb, &nfs_mowner);
614             if ((authsiz + 10 * NFSX_UNSIGNED) >= MINCLSIZE) {
615                     m_clget(mb, M_WAIT);
616             } else if ((authsiz + 10 * NFSX_UNSIGNED) < MHLEN) {
617                     MH_ALIGN(mb, authsiz + 10 * NFSX_UNSIGNED);
/sys/nfs/nfs_subs.c: 617 in nfsm_rpchead()
611             authsiz = nfsm_rndup(auth_len);
612             mb = m_gethdr(M_WAIT, MT_DATA);
613             MCLAIM(mb, &nfs_mowner);
614             if ((authsiz + 10 * NFSX_UNSIGNED) >= MINCLSIZE) {
615                     m_clget(mb, M_WAIT);
616             } else if ((authsiz + 10 * NFSX_UNSIGNED) < MHLEN) {
>>>     CID 274845:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "mb".
617                     MH_ALIGN(mb, authsiz + 10 * NFSX_UNSIGNED);
618             } else {
619                     MH_ALIGN(mb, 8 * NFSX_UNSIGNED);
620             }
621             mb->m_len = 0;
622             mreq = mb;
/sys/nfs/nfs_subs.c: 619 in nfsm_rpchead()
613             MCLAIM(mb, &nfs_mowner);
614             if ((authsiz + 10 * NFSX_UNSIGNED) >= MINCLSIZE) {
615                     m_clget(mb, M_WAIT);
616             } else if ((authsiz + 10 * NFSX_UNSIGNED) < MHLEN) {
617                     MH_ALIGN(mb, authsiz + 10 * NFSX_UNSIGNED);
618             } else {
>>>     CID 274845:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "mb".
619                     MH_ALIGN(mb, 8 * NFSX_UNSIGNED);
620             }
621             mb->m_len = 0;
622             mreq = mb;
623             bpos = mtod(mb, void *);
624     

________________________________________________________________________________________________________
*** CID 274846:  Dereference null return value  (NULL_RETURNS)
/sys/nfs/nfs_socket.c: 554 in nfs_rephead()
548              * try and leave leading space for the lower level headers.
549              */
550             siz += RPC_REPLYSIZ;
551             if (siz >= max_datalen) {
552                     m_clget(mreq, M_WAIT);
553             } else
>>>     CID 274846:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "mreq".
554                     mreq->m_data += max_hdr;
555             tl = mtod(mreq, u_int32_t *);
556             mreq->m_len = 6 * NFSX_UNSIGNED;
557             bpos = ((char *)tl) + mreq->m_len;
558             *tl++ = txdr_unsigned(nd->nd_retxid);
559             *tl++ = rpc_reply;
/sys/nfs/nfs_socket.c: 545 in nfs_rephead()
539             struct mbuf *mreq;
540             char *bpos;
541             struct mbuf *mb;
542     
543             mreq = m_gethdr(M_WAIT, MT_DATA);
544             MCLAIM(mreq, &nfs_mowner);
>>>     CID 274846:  Dereference null return value  (NULL_RETURNS)
>>>     Assigning: "mb" = "mreq".  Both pointers are now null.
545             mb = mreq;
546             /*
547              * If this is a big reply, use a cluster else
548              * try and leave leading space for the lower level headers.
549              */
550             siz += RPC_REPLYSIZ;

________________________________________________________________________________________________________
*** CID 460219:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Actions.c: 918 in 
XawDeclareActionVar()
912         escape = _XawEscapeActionVarValue(value);
913     
914       if (variable->qvalue)
915         {
916           String val = escape ? escape : value;
917     
>>>     CID 460219:  Dereference after null check  (FORWARD_NULL)
>>>     Passing null pointer "val" to function "strcmp(char const *, char const 
>>> *)", which dereferences it.
918           if (strcmp(XrmQuarkToString(variable->qvalue), val) == 0)
919             {
920               if (escape)
921                 XtFree(escape);
922               return;
923             }

________________________________________________________________________________________________________
*** CID 460238:  Dereference after null check  (FORWARD_NULL)
/home/phil/cov/xsrc/external/mit/libXt/dist/src/Shell.c: 1429 in 
_popup_set_prop()
1423            Window window_group;
1424            XClassHint classhint;
1425            Boolean copied_iname, copied_wname;
1426     
1427            if (!XtIsWMShell((Widget)w) || w->shell.override_redirect) 
return;
1428     
>>>     CID 460238:  Dereference after null check  (FORWARD_NULL)
>>>     Comparing "size_hints" to null implies that "size_hints" might be null.
1429            if ((size_hints = XAllocSizeHints()) == NULL)
1430                _XtAllocError("XAllocSizeHints");
1431     
1432            copied_iname = copied_wname = False;
1433             if (wmshell->wm.title_encoding == None &&
1434                XmbTextListToTextProperty(XtDisplay((Widget)w),

________________________________________________________________________________________________________
*** CID 460659:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Pixmap.c: 292 in 
XawLoadPixmap()
286     
287       if ((xaw_params = XawParseParamsString(name)) == NULL)
288         return (NULL);
289     
290       idx = _XawFindPixmapLoaderIndex(xaw_params->type, xaw_params->ext);
291       if (idx < 0)
>>>     CID 460659:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "xaw_params" going out of scope leaks the storage it points to.
292         return (NULL);
293     
294     #ifdef DIAGNOSTIC
295       fprintf(stderr, "(*) Loading pixmap \"%s\": ", name);
296     #endif
297     

________________________________________________________________________________________________________
*** CID 460660:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1559 in 
XawTextSinkConvertPropertyList()
1553                XtAppWarning(XtDisplayToApplicationContext
1554                             (DisplayOfScreen(screen)), buffer);
1555                DestroyTextPropertyList(propl);
1556                if (prev)
1557                    prev->next = NULL;
1558                XawFreeParamsStruct(params);
>>>     CID 460660:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "str" going out of scope leaks the storage it points to.
1559                return (NULL);
1560            }
1561            else if (_XawTextSinkGetProperty(propl, ident) != NULL) {
1562                XawFreeParamsStruct(params);
1563                continue;
1564            }
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1559 in 
XawTextSinkConvertPropertyList()
1553                XtAppWarning(XtDisplayToApplicationContext
1554                             (DisplayOfScreen(screen)), buffer);
1555                DestroyTextPropertyList(propl);
1556                if (prev)
1557                    prev->next = NULL;
1558                XawFreeParamsStruct(params);
>>>     CID 460660:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "str" going out of scope leaks the storage it points to.
1559                return (NULL);
1560            }
1561            else if (_XawTextSinkGetProperty(propl, ident) != NULL) {
1562                XawFreeParamsStruct(params);
1563                continue;
1564            }

________________________________________________________________________________________________________
*** CID 460662:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1582 in 
XawTextSinkConvertPropertyList()
1576                    XtAppWarning(XtDisplayToApplicationContext
1577                                 (DisplayOfScreen(screen)), buffer);
1578                    DestroyTextPropertyList(propl);
1579                    if (prev)
1580                        prev->next = NULL;
1581                    XawFreeParamsStruct(params);
>>>     CID 460662:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "prop" going out of scope leaks the storage it points to.
1582                    return (NULL);
1583                }
1584                prop->mask |= XAW_TPROP_FONT;
1585                SetXlfdDefaults(DisplayOfScreen(screen), prop);
1586            }
1587            /* fontset processing here */
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1601 in 
XawTextSinkConvertPropertyList()
1595                    XtAppWarning(XtDisplayToApplicationContext
1596                                 (DisplayOfScreen(screen)), buffer);
1597                    DestroyTextPropertyList(propl);
1598                    if (prev)
1599                        prev->next = NULL;
1600                    XawFreeParamsStruct(params);
>>>     CID 460662:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "prop" going out of scope leaks the storage it points to.
1601                    return (NULL);
1602                }
1603                prop->foreground = color.pixel;
1604                prop->mask |= XAW_TPROP_FOREGROUND;
1605            }
1606            if ((argval = XawFindArgVal(params, "background")) != NULL &&
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1618 in 
XawTextSinkConvertPropertyList()
1612                    XtAppWarning(XtDisplayToApplicationContext
1613                                 (DisplayOfScreen(screen)), buffer);
1614                    DestroyTextPropertyList(propl);
1615                    if (prev)
1616                        prev->next = NULL;
1617                    XawFreeParamsStruct(params);
>>>     CID 460662:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "prop" going out of scope leaks the storage it points to.
1618                    return (NULL);
1619                }
1620                prop->background = color.pixel;
1621                prop->mask |= XAW_TPROP_BACKGROUND;
1622            }
1623            /* foreground_pixmap and background_pixmap processing here */
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1601 in 
XawTextSinkConvertPropertyList()
1595                    XtAppWarning(XtDisplayToApplicationContext
1596                                 (DisplayOfScreen(screen)), buffer);
1597                    DestroyTextPropertyList(propl);
1598                    if (prev)
1599                        prev->next = NULL;
1600                    XawFreeParamsStruct(params);
>>>     CID 460662:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "prop" going out of scope leaks the storage it points to.
1601                    return (NULL);
1602                }
1603                prop->foreground = color.pixel;
1604                prop->mask |= XAW_TPROP_FOREGROUND;
1605            }
1606            if ((argval = XawFindArgVal(params, "background")) != NULL &&
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/TextSink.c: 1618 in 
XawTextSinkConvertPropertyList()
1612                    XtAppWarning(XtDisplayToApplicationContext
1613                                 (DisplayOfScreen(screen)), buffer);
1614                    DestroyTextPropertyList(propl);
1615                    if (prev)
1616                        prev->next = NULL;
1617                    XawFreeParamsStruct(params);
>>>     CID 460662:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "prop" going out of scope leaks the storage it points to.
1618                    return (NULL);
1619                }
1620                prop->background = color.pixel;
1621                prop->mask |= XAW_TPROP_BACKGROUND;
1622            }
1623            /* foreground_pixmap and background_pixmap processing here */

________________________________________________________________________________________________________
*** CID 460663:  Resource leak  (RESOURCE_LEAK)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Converters.c: 564 in 
_XawCvtStringToDisplayList()
558                                            XawRDisplayList);
559           toVal->addr = NULL;
560           toVal->size = sizeof(XawDisplayList*);
561           return (False);
562         }
563     
>>>     CID 460663:  Resource leak  (RESOURCE_LEAK)
>>>     Variable "dlist" going out of scope leaks the storage it points to.
564       done(XawDisplayList*, dlist);
565     }
566     
567     /*ARGSUSED*/
568     static Boolean
569     _XawCvtDisplayListToString(Display *dpy, XrmValue *args, Cardinal 
*num_args,

________________________________________________________________________________________________________
*** CID 461588:  Uninitialized scalar variable  (UNINIT)
/home/phil/cov/xsrc/external/mit/libXaw/dist/src/Actions.c: 478 in 
XawSetValuesAction()
472           switch (to.size)
473             {
474             case 1:
475               XtSetArg(arglist[num_args], 
XrmQuarkToString(resource->qname), c_1);
476               break;
477             case 2:
>>>     CID 461588:  Uninitialized scalar variable  (UNINIT)
>>>     Using uninitialized value "c_2".
478               XtSetArg(arglist[num_args], 
XrmQuarkToString(resource->qname), c_2);
479               break;
480             case 4:
481               XtSetArg(arglist[num_args], 
XrmQuarkToString(resource->qname), c_4);
482               break;
483     #ifdef LONG64

________________________________________________________________________________________________________
*** CID 721666:  Side effect in assertion  (ASSERT_SIDE_EFFECT)
/external/gpl3/gcc/dist/gcc/genautomata.c: 8356 in output_default_latencies()()
8350       for (i = 0, j = 0, col = 7; i < description->normal_decls_num; i++)
8351         if (description->decls[i]->mode == dm_insn_reserv)
8352           {
8353            if ((col = (col+1) % 8) == 0)
8354              fputs ("\n     ", output_file);
8355            decl = description->decls[i];
>>>     CID 721666:  Side effect in assertion  (ASSERT_SIDE_EFFECT)
>>>     Argument "j++" of gcc_assert() has a side effect.  The containing 
>>> function might work differently in a non-debug build.
8356            gcc_assert (j++ == DECL_INSN_RESERV (decl)->insn_num);
8357            fprintf (output_file, "% 4d,",
8358                     DECL_INSN_RESERV (decl)->default_latency);
8359           }
8360       gcc_assert (j == description->insns_num - (collapse_flag ? 2 : 1));
8361       fputs ("\n    };\n", output_file);

________________________________________________________________________________________________________
*** CID 721667:  Buffer not null terminated  (BUFFER_SIZE_WARNING)
/external/gpl3/gcc/dist/gcc/genrecog.c: 2611 in debug_decision_2(decision_test 
*)()
2605           fprintf (stderr, "pred=(%s,%s)",
2606                   test->u.pred.name, GET_MODE_NAME(test->u.pred.mode));
2607           break;
2608         case DT_c_test:
2609           {
2610            char sub[16+4];
>>>     CID 721667:  Buffer not null terminated  (BUFFER_SIZE_WARNING)
>>>     Calling strncpy with a maximum size argument of 20 bytes on destination 
>>> array "sub" of size 20 bytes might leave the destination string 
>>> unterminated.
2611            strncpy (sub, test->u.c_test, sizeof(sub));
2612            memcpy (sub+16, "...", 4);
2613            fprintf (stderr, "c_test=\"%s\"", sub);
2614           }
2615           break;
2616         case DT_accept_op:

________________________________________________________________________________________________________
*** CID 721723:  Unchecked return value from library  (CHECKED_RETURN)
/external/gpl3/gcc/dist/gcc/genautomata.c: 9572 in write_automata()()
9566         }
9567       finish_automaton_decl_table ();
9568       finish_insn_decl_table ();
9569       finish_decl_table ();
9570       obstack_free (&irp, NULL);
9571       if (have_error && output_description_file != NULL)
>>>     CID 721723:  Unchecked return value from library  (CHECKED_RETURN)
>>>     No check of the return value of "remove(output_description_file_name)".
9572         remove (output_description_file_name);
9573     }
9574     
9575     int
9576     main (int argc, char **argv)
9577     {

________________________________________________________________________________________________________
*** CID 721724:  Unchecked return value from library  (CHECKED_RETURN)
/external/gpl3/gcc/dist/gcc/genhooks.c: 140 in emit_documentation(const char 
*)()
134           void **p;
135           struct s_hook *shp;
136     
137           if (strcmp (buf, "hook") != 0)
138             continue;
139           buf[0] = '\0';
>>>     CID 721724:  Unchecked return value from library  (CHECKED_RETURN)
>>>     No check of the return value of "fscanf(f, "%999s", buf)".
140           fscanf (f, "%999s", buf);
141           shp = XNEW (struct s_hook);
142           shp->name = upstrdup (buf);
143           shp->pos = -1;
144           p = htab_find_slot (start_hooks, shp, INSERT);
145           if (*p != HTAB_EMPTY_ENTRY)

________________________________________________________________________________________________________
*** CID 721791:  Operands don't affect result  (CONSTANT_EXPRESSION_RESULT)
/external/gpl3/gcc/dist/gcc/gengtype-state.c: 2467 in read_state_files_list()()
2461                }
2462              else
2463                fatal_reading_state (t0,
2464                                     "expecting file in !fileslist of state 
file");
2465            };
2466           t0 = peek_state_token (0);
>>>     CID 721791:  Operands don't affect result  (CONSTANT_EXPRESSION_RESULT)
>>>     "!state_token_kind(t0) == STOK_RIGHTPAR" is always false regardless of 
>>> the values of its operands. This occurs as the logical operand of if.
2467           if (!state_token_kind (t0) == STOK_RIGHTPAR)
2468            fatal_reading_state (t0, "missing ) for !fileslist in state 
file");
2469           next_state_tokens (1);
2470         }
2471       else
2472         fatal_reading_state (t0, "missing !fileslist in state file");

________________________________________________________________________________________________________
*** CID 721807:  Copy-paste error  (COPY_PASTE_ERROR)
/external/gpl3/gcc/dist/gcc/gengtype.c: 3701 in write_types(outf *, type *, 
type *, const write_types_data *)()
3695                type_p ss;
3696                for (ss = s->u.s.lang_struct; ss; ss = ss->next)
3697                  {
3698                    nbfun++;
3699                    DBGPRINTF ("writing func #%d lang_struct ss @ %p '%s'",
3700                               nbfun, (void*) ss, ss->u.s.tag);
>>>     CID 721807:  Copy-paste error  (COPY_PASTE_ERROR)
>>>     "s" in "write_func_for_structure(s, ss, NULL, wtd)" looks like a 
>>> copy-paste error.  Should it say "ss" instead?
3701                    write_func_for_structure (s, ss, NULL, wtd);
3702                  }
3703              }
3704            else
3705              {
3706                nbfun++;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
http://scan.coverity.com/projects/1449?tab=Overview

To unsubscribe from the email notification for new defects, 
http://scan5.coverity.com/cgi-bin/unsubscribe.py




Home | Main Index | Thread Index | Old Index