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-i386-user



Hi,


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

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


** CID 274726:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/binutils/dist/gas/config/obj-elf.c: 195 in elf_begin()
/external/gpl3/binutils/dist/gas/config/obj-elf.c: 197 in elf_begin()
/external/gpl3/binutils/dist/gas/config/obj-elf.c: 199 in elf_begin()

** CID 421494:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 273 in 
elf_vxworks_finish_dynamic_entry()
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 278 in 
elf_vxworks_finish_dynamic_entry()
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 290 in 
elf_vxworks_finish_dynamic_entry()
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 295 in 
elf_vxworks_finish_dynamic_entry()
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 283 in 
elf_vxworks_finish_dynamic_entry()

** CID 600626:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/binutils/dist/bfd/coffgen.c: 869 in coff_fix_symbol_name()

** CID 604220:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/gdb/dist/gdb/gnu-v2-abi.c: 255 in gnuv2_value_rtti_type()
/external/gpl3/gdb/dist/gdb/gnu-v2-abi.c: 255 in gnuv2_value_rtti_type()

** CID 610391:  Unused pointer value  (UNUSED_VALUE)
/external/gpl3/gdb/dist/gdb/symfile.c: 3864 in _initialize_symfile()

** CID 1001650:  Logically dead code  (DEADCODE)
/external/bsd/bind/dist/lib/irs/getnameinfo.c: 333 in getnameinfo()

** CID 1140456:  Explicit null dereferenced  (FORWARD_NULL)
/external/gpl3/gdb/dist/libiberty/cp-demangle.c: 3247 in d_expression_1()
/external/gpl3/gdb/dist/libiberty/cp-demangle.c: 3224 in d_expression_1()

** CID 1224963:  Explicit null dereferenced  (FORWARD_NULL)
/sys/net/bpf.c: 1394 in bpf_deliver()

** CID 1224964:  Overflowed array index read  (INTEGER_OVERFLOW)
/sys/ufs/ufs/ufs_quota2.c: 778 in quota2_handle_cmd_del()

** CID 1224966:  Uninitialized pointer read  (UNINIT)
/sys/net/bpf.c: 1391 in bpf_deliver()

** CID 1225009:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/tests/lib/libbpfjit/t_bpfjit.c: 70 in atfu_libbpfjit_empty_body()

** CID 1225010:  Unchecked return value from library  (CHECKED_RETURN)
/external/gpl3/gdb/dist/gdb/common/filestuff.c: 258 in mark_cloexec()

** CID 1225011:  Unchecked return value  (CHECKED_RETURN)
/external/gpl3/gdb/dist/gdb/gcore.c: 97 in write_gcore_file()

** CID 1225012:  Unchecked return value from library  (CHECKED_RETURN)
/external/ibm-public/postfix/dist/src/posttls-finger/posttls-finger.c: 849 in 
connect_sock()

** CID 1225013:  Unchecked return value  (CHECKED_RETURN)
/external/ibm-public/postfix/dist/src/tls/tls_session.c: 105 in 
tls_session_stop()

** CID 1225014:  Unchecked return value  (CHECKED_RETURN)
/lib/libutil/sockaddr_snprintf.c: 215 in sockaddr_snprintf()
/lib/libutil/sockaddr_snprintf.c: 227 in sockaddr_snprintf()

** CID 1225015:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
/external/gpl3/gdb/dist/gdb/frame.c: 594 in frame_id_eq()

** CID 1225016:  Logically dead code  (DEADCODE)
/external/gpl3/gdb/dist/gdb/frame.c: 325 in fprint_frame_id()

** CID 1225017:  Logically dead code  (DEADCODE)
/external/gpl3/gdb/dist/gdb/varobj.c: 2687 in varobj_value_get_print_value()

** CID 1225018:  Logically dead code  (DEADCODE)
/sys/ufs/lfs/ulfs_quota.c: 470 in quota_handle_cmd_del()


________________________________________________________________________________________________________
*** CID 274726:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/binutils/dist/gas/config/obj-elf.c: 195 in elf_begin()
189     void
190     elf_begin (void)
191     {
192       asection *s;
193     
194       /* Add symbols for the known sections to the symbol table.  */
>>>     CID 274726:  Dereference null return value  (NULL_RETURNS)
>>>     Assigning: "s" = null return value from "bfd_get_section_by_name(bfd *, 
>>> char const *)".
195       s = bfd_get_section_by_name (stdoutput, TEXT_SECTION_NAME);
196       symbol_table_insert (section_symbol (s));
197       s = bfd_get_section_by_name (stdoutput, DATA_SECTION_NAME);
198       symbol_table_insert (section_symbol (s));
199       s = bfd_get_section_by_name (stdoutput, BSS_SECTION_NAME);
200       symbol_table_insert (section_symbol (s));
/external/gpl3/binutils/dist/gas/config/obj-elf.c: 197 in elf_begin()
191     {
192       asection *s;
193     
194       /* Add symbols for the known sections to the symbol table.  */
195       s = bfd_get_section_by_name (stdoutput, TEXT_SECTION_NAME);
196       symbol_table_insert (section_symbol (s));
>>>     CID 274726:  Dereference null return value  (NULL_RETURNS)
>>>     Assigning: "s" = null return value from "bfd_get_section_by_name(bfd *, 
>>> char const *)".
197       s = bfd_get_section_by_name (stdoutput, DATA_SECTION_NAME);
198       symbol_table_insert (section_symbol (s));
199       s = bfd_get_section_by_name (stdoutput, BSS_SECTION_NAME);
200       symbol_table_insert (section_symbol (s));
201       elf_com_section_ptr = bfd_com_section_ptr;
202     }
/external/gpl3/binutils/dist/gas/config/obj-elf.c: 199 in elf_begin()
193     
194       /* Add symbols for the known sections to the symbol table.  */
195       s = bfd_get_section_by_name (stdoutput, TEXT_SECTION_NAME);
196       symbol_table_insert (section_symbol (s));
197       s = bfd_get_section_by_name (stdoutput, DATA_SECTION_NAME);
198       symbol_table_insert (section_symbol (s));
>>>     CID 274726:  Dereference null return value  (NULL_RETURNS)
>>>     Assigning: "s" = null return value from "bfd_get_section_by_name(bfd *, 
>>> char const *)".
199       s = bfd_get_section_by_name (stdoutput, BSS_SECTION_NAME);
200       symbol_table_insert (section_symbol (s));
201       elf_com_section_ptr = bfd_com_section_ptr;
202     }
203     
204     void

________________________________________________________________________________________________________
*** CID 421494:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 273 in 
elf_vxworks_finish_dynamic_entry()
267         {
268         default:
269           return FALSE;
270           
271         case DT_VX_WRS_TLS_DATA_START:
272           sec = bfd_get_section_by_name (output_bfd, ".tls_data");
>>>     CID 421494:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "sec".
273           dyn->d_un.d_ptr = sec->vma;
274           break;
275           
276         case DT_VX_WRS_TLS_DATA_SIZE:
277           sec = bfd_get_section_by_name (output_bfd, ".tls_data");
278           dyn->d_un.d_val = sec->size;
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 278 in 
elf_vxworks_finish_dynamic_entry()
272           sec = bfd_get_section_by_name (output_bfd, ".tls_data");
273           dyn->d_un.d_ptr = sec->vma;
274           break;
275           
276         case DT_VX_WRS_TLS_DATA_SIZE:
277           sec = bfd_get_section_by_name (output_bfd, ".tls_data");
>>>     CID 421494:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "sec".
278           dyn->d_un.d_val = sec->size;
279           break;
280           
281         case DT_VX_WRS_TLS_DATA_ALIGN:
282           sec = bfd_get_section_by_name (output_bfd, ".tls_data");
283           dyn->d_un.d_val
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 290 in 
elf_vxworks_finish_dynamic_entry()
284             = (bfd_size_type)1 << bfd_get_section_alignment (output_bfd,
285                                                              sec);
286           break;
287           
288         case DT_VX_WRS_TLS_VARS_START:
289           sec = bfd_get_section_by_name (output_bfd, ".tls_vars");
>>>     CID 421494:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "sec".
290           dyn->d_un.d_ptr = sec->vma;
291           break;
292           
293         case DT_VX_WRS_TLS_VARS_SIZE:
294           sec = bfd_get_section_by_name (output_bfd, ".tls_vars");
295           dyn->d_un.d_val = sec->size;
296           break;
297         }
298       return TRUE;
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 295 in 
elf_vxworks_finish_dynamic_entry()
289           sec = bfd_get_section_by_name (output_bfd, ".tls_vars");
290           dyn->d_un.d_ptr = sec->vma;
291           break;
292           
293         case DT_VX_WRS_TLS_VARS_SIZE:
294           sec = bfd_get_section_by_name (output_bfd, ".tls_vars");
>>>     CID 421494:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "sec".
295           dyn->d_un.d_val = sec->size;
296           break;
297         }
298       return TRUE;
/external/gpl3/binutils/dist/bfd/elf-vxworks.c: 283 in 
elf_vxworks_finish_dynamic_entry()
277           sec = bfd_get_section_by_name (output_bfd, ".tls_data");
278           dyn->d_un.d_val = sec->size;
279           break;
280           
281         case DT_VX_WRS_TLS_DATA_ALIGN:
282           sec = bfd_get_section_by_name (output_bfd, ".tls_data");
>>>     CID 421494:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a null pointer "sec".
283           dyn->d_un.d_val
284             = (bfd_size_type)1 << bfd_get_section_alignment (output_bfd,
285                                                              sec);
286           break;
287           
288         case DT_VX_WRS_TLS_VARS_START:

________________________________________________________________________________________________________
*** CID 600626:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/binutils/dist/bfd/coffgen.c: 869 in coff_fix_symbol_name()
863               /* This name should be written into the .debug section.  For
864                  some reason each name is preceded by a two byte length
865                  and also followed by a null byte.  FIXME: We assume that
866                  the .debug section has already been created, and that it
867                  is large enough.  */
868               if (*debug_string_section_p == (asection *) NULL)
>>>     CID 600626:  Dereference null return value  (NULL_RETURNS)
>>>     Assigning: "*debug_string_section_p" = null return value from 
>>> "bfd_get_section_by_name(bfd *, char const *)".
869                 *debug_string_section_p = bfd_get_section_by_name (abfd, 
".debug");
870               filepos = bfd_tell (abfd);
871               if (prefix_len == 4)
872                 bfd_put_32 (abfd, (bfd_vma) (name_length + 1), buf);
873               else
874                 bfd_put_16 (abfd, (bfd_vma) (name_length + 1), buf);

________________________________________________________________________________________________________
*** CID 604220:  Dereference null return value  (NULL_RETURNS)
/external/gpl3/gdb/dist/gdb/gnu-v2-abi.c: 255 in gnuv2_value_rtti_type()
249           || (linkage_name=SYMBOL_LINKAGE_NAME (minsym.minsym))==NULL
250           || !is_vtable_name (linkage_name))
251         return NULL;
252     
253       /* If we just skip the prefix, we get screwed by namespaces.  */
254       demangled_name=cplus_demangle(linkage_name,DMGL_PARAMS|DMGL_ANSI);
>>>     CID 604220:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be null "demangled_name" when 
>>> calling "strchr(char const *, int)".
255       p = strchr (demangled_name, ' ');
256       if (p)
257         *p = '\0';
258     
259       /* Lookup the type for the name.  */
260       /* FIXME: chastain/2003-11-26: block=NULL is bogus.  See pr gdb/1465. 
 */
/external/gpl3/gdb/dist/gdb/gnu-v2-abi.c: 255 in gnuv2_value_rtti_type()
249           || (linkage_name=SYMBOL_LINKAGE_NAME (minsym.minsym))==NULL
250           || !is_vtable_name (linkage_name))
251         return NULL;
252     
253       /* If we just skip the prefix, we get screwed by namespaces.  */
254       demangled_name=cplus_demangle(linkage_name,DMGL_PARAMS|DMGL_ANSI);
>>>     CID 604220:  Dereference null return value  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be null "demangled_name" when 
>>> calling "strchr(char const *, int)".
255       p = strchr (demangled_name, ' ');
256       if (p)
257         *p = '\0';
258     
259       /* Lookup the type for the name.  */
260       /* FIXME: chastain/2003-11-26: block=NULL is bogus.  See pr gdb/1465. 
 */

________________________________________________________________________________________________________
*** CID 610391:  Unused pointer value  (UNUSED_VALUE)
/external/gpl3/gdb/dist/gdb/symfile.c: 3864 in _initialize_symfile()
3858     The optional arguments are section-name section-address pairs and\n\
3859     should be specified if the data and bss segments are not contiguous\n\
3860     with the text.  SECT is a section name to be loaded at SECT_ADDR."),
3861                   &cmdlist);
3862       set_cmd_completer (c, filename_completer);
3863     
>>>     CID 610391:  Unused pointer value  (UNUSED_VALUE)
>>>     Pointer "c" returned by "add_cmd("remove-symbol-file", class_files, 
>>> remove_symbol_file_command(char *, int), gettext("Remove a symbol file 
>>> added via the add-symbol-file command.\nUsage: remove-symbol-file 
>>> FILENAME\n       remove-symbol-file -a ADDRESS\nThe file to remove can be 
>>> identified by its filename or by an address\nthat lies within the 
>>> boundaries of this symbol file in memory."), &cmdlist)" is never used.
3864       c = add_cmd ("remove-symbol-file", class_files,
3865                   remove_symbol_file_command, _("\
3866     Remove a symbol file added via the add-symbol-file command.\n\
3867     Usage: remove-symbol-file FILENAME\n\
3868            remove-symbol-file -a ADDRESS\n\
3869     The file to remove can be identified by its filename or by an 
address\n\

________________________________________________________________________________________________________
*** CID 1001650:  Logically dead code  (DEADCODE)
/external/bsd/bind/dist/lib/irs/getnameinfo.c: 333 in getnameinfo()
327                     case DNS_R_COVERINGNSEC:
328                     case DNS_R_NOTAUTHORITATIVE:
329                     case DNS_R_NOVALIDKEY:
330                     case DNS_R_NOVALIDDS:
331                     case DNS_R_NOVALIDSIG:
332                             ERR(EAI_INSECUREDATA);
>>>     CID 1001650:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this statement "break;".
333                             break;
334                     default:
335                             ERR(EAI_FAIL);
336                     }
337     
338                     /* Parse the answer for the hostname */

________________________________________________________________________________________________________
*** CID 1140456:  Explicit null dereferenced  (FORWARD_NULL)
/external/gpl3/gdb/dist/libiberty/cp-demangle.c: 3247 in d_expression_1()
3241            case 3:
3242              {
3243                struct demangle_component *first;
3244                struct demangle_component *second;
3245                struct demangle_component *third;
3246     
>>>     CID 1140456:  Explicit null dereferenced  (FORWARD_NULL)
>>>     Passing null pointer "code" to function "strcmp(char const *, char 
>>> const *)", which dereferences it.
3247                if (!strcmp (code, "qu"))
3248                  {
3249                    /* ?: expression.  */
3250                    first = d_expression_1 (di);
3251                    second = d_expression_1 (di);
3252                    third = d_expression_1 (di);
/external/gpl3/gdb/dist/libiberty/cp-demangle.c: 3224 in d_expression_1()
3218                struct demangle_component *right;
3219     
3220                if (op_is_new_cast (op))
3221                  left = cplus_demangle_type (di);
3222                else
3223                  left = d_expression_1 (di);
>>>     CID 1140456:  Explicit null dereferenced  (FORWARD_NULL)
>>>     Passing null pointer "code" to function "strcmp(char const *, char 
>>> const *)", which dereferences it.
3224                if (!strcmp (code, "cl"))
3225                  right = d_exprlist (di, 'E');
3226                else if (!strcmp (code, "dt") || !strcmp (code, "pt"))
3227                  {
3228                    right = d_unqualified_name (di);
3229                    if (d_peek_char (di) == 'I')

________________________________________________________________________________________________________
*** CID 1224963:  Explicit null dereferenced  (FORWARD_NULL)
/sys/net/bpf.c: 1394 in bpf_deliver()
1388         void *pkt, u_int pktlen, u_int buflen, const bool rcv)
1389     {
1390            struct timespec ts;
1391            bpf_args_t args;
1392            struct bpf_d *d;
1393     
>>>     CID 1224963:  Explicit null dereferenced  (FORWARD_NULL)
>>>     Assigning: "bc" = "NULL".
1394            const bpf_ctx_t *bc = NULL;
1395            bool gottime = false;
1396     
1397            args.pkt = (const uint8_t *)pkt;
1398            args.wirelen = pktlen;
1399            args.buflen = buflen;

________________________________________________________________________________________________________
*** CID 1224964:  Overflowed array index read  (INTEGER_OVERFLOW)
/sys/ufs/ufs/ufs_quota2.c: 778 in quota2_handle_cmd_del()
772                     goto out_dqlock;
773     
774             hash_mask = ((1 << q2h->q2h_hash_shift) - 1);
775             c.dq = dq;
776             c.id = id;
777             c.q2h = q2h;
>>>     CID 1224964:  Overflowed array index read  (INTEGER_OVERFLOW)
>>>     Overflowed or truncated value (or a value computed from an overflowed 
>>> or truncated value) "id & hash_mask" used as array index.
778             error = quota2_walk_list(ump, hbp, idtype,
779                 &q2h->q2h_entries[id & hash_mask], B_MODIFY, &c,
780                 dq2clear_callback);
781     
782             bwrite(hbp);
783     

________________________________________________________________________________________________________
*** CID 1224966:  Uninitialized pointer read  (UNINIT)
/sys/net/bpf.c: 1391 in bpf_deliver()
1385      */
1386     static inline void
1387     bpf_deliver(struct bpf_if *bp, void *(*cpfn)(void *, const void *, 
size_t),
1388         void *pkt, u_int pktlen, u_int buflen, const bool rcv)
1389     {
1390            struct timespec ts;
>>>     CID 1224966:  Uninitialized pointer read  (UNINIT)
>>>     Declaring variable "args" without initializer.
1391            bpf_args_t args;
1392            struct bpf_d *d;
1393     
1394            const bpf_ctx_t *bc = NULL;
1395            bool gottime = false;
1396     

________________________________________________________________________________________________________
*** CID 1225009:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
/tests/lib/libbpfjit/t_bpfjit.c: 70 in atfu_libbpfjit_empty_body()
64     }
65     
66     ATF_TC_BODY(libbpfjit_empty, tc)
67     {
68      struct bpf_insn dummy;
69     
>>>     CID 1225009:  Out-of-bounds access  (ARRAY_VS_SINGLETON)
>>>     Taking address with "&dummy" yields a singleton pointer.
70      ATF_CHECK(bpfjit_generate_code(NULL, &dummy, 0) == NULL);
71     }
72     
73     ATF_TC(libbpfjit_alu_add_k);
74     ATF_TC_HEAD(libbpfjit_alu_add_k, tc)
75     {

________________________________________________________________________________________________________
*** CID 1225010:  Unchecked return value from library  (CHECKED_RETURN)
/external/gpl3/gdb/dist/gdb/common/filestuff.c: 258 in mark_cloexec()
252     {
253     #ifdef HAVE_F_GETFD
254       int old = fcntl (fd, F_GETFD, 0);
255     
256       if (old != -1)
257         {
>>>     CID 1225010:  Unchecked return value from library  (CHECKED_RETURN)
>>>     No check of the return value of "fcntl(fd, 2, old | 1)".
258           fcntl (fd, F_SETFD, old | FD_CLOEXEC);
259     
260           if (trust_o_cloexec == 0)
261             {
262               if ((old & FD_CLOEXEC) != 0)
263                 trust_o_cloexec = 1;

________________________________________________________________________________________________________
*** CID 1225011:  Unchecked return value  (CHECKED_RETURN)
/external/gpl3/gdb/dist/gdb/gcore.c: 97 in write_gcore_file()
91                                               | SEC_ALLOC);
92       if (note_sec == NULL)
93         error (_("Failed to create 'note' section for corefile: %s"),
94         bfd_errmsg (bfd_get_error ()));
95     
96       bfd_set_section_vma (obfd, note_sec, 0);
>>>     CID 1225011:  Unchecked return value  (CHECKED_RETURN)
>>>     No check of the return value of "bfd_set_section_alignment(obfd, 
>>> note_sec, 0U)".
97       bfd_set_section_alignment (obfd, note_sec, 0);
98       bfd_set_section_size (obfd, note_sec, note_size);
99     
100       /* Now create the memory/load sections.  */
101       if (gcore_memory_sections (obfd) == 0)
102         error (_("gcore: failed to get corefile memory sections from 
target."));

________________________________________________________________________________________________________
*** CID 1225012:  Unchecked return value from library  (CHECKED_RETURN)
/external/ibm-public/postfix/dist/src/posttls-finger/posttls-finger.c: 849 in 
connect_sock()
843          */
844         if (sa->sa_family == AF_INET
845     #ifdef AF_INET6
846             || sa->sa_family == AF_INET6
847     #endif
848             )
>>>     CID 1225012:  Unchecked return value from library  (CHECKED_RETURN)
>>>     No check of the return value of "vstream_tweak_tcp(stream)".
849             vstream_tweak_tcp(stream);
850     
851         return (stream);
852     }
853     
854     /* connect_unix - connect to a unix-domain socket */

________________________________________________________________________________________________________
*** CID 1225013:  Unchecked return value  (CHECKED_RETURN)
/external/ibm-public/postfix/dist/src/tls/tls_session.c: 105 in 
tls_session_stop()
99          * so we will not perform SSL_shutdown() and the session will be 
removed
100          * as being bad.
101          */
102         if (!failure) {
103             retval = tls_bio_shutdown(vstream_fileno(stream), timeout, 
TLScontext);
104             if (retval == 0)
>>>     CID 1225013:  Unchecked return value  (CHECKED_RETURN)
>>>     No check of the return value of "tls_bio(stream->fd, timeout, 
>>> TLScontext, SSL_shutdown(SSL *), NULL, NULL, NULL, 0)".
105                 tls_bio_shutdown(vstream_fileno(stream), timeout, 
TLScontext);
106         }
107         tls_free_context(TLScontext);
108         tls_stream_stop(stream);
109     }
110     

________________________________________________________________________________________________________
*** CID 1225014:  Unchecked return value  (CHECKED_RETURN)
/lib/libutil/sockaddr_snprintf.c: 215 in sockaddr_snprintf()
209                     case 'A':
210                             if (name)
211                                     ADDS(name);
212                             else if (!a)
213                                     ADDNA();
214                             else {
>>>     CID 1225014:  Unchecked return value  (CHECKED_RETURN)
>>>     No check of the return value of "getnameinfo(sa, 
>>> (__socklen_t)sa->sa_len, name = Abuf, 1024U, NULL, 0U, 0)".
215                                     getnameinfo(sa, (socklen_t)sa->sa_len,
216                                             name = Abuf,
217                                             (unsigned int)sizeof(nbuf), 
NULL, 0, 0);
218                                     ADDS(name);
219                             }
220                             break;
/lib/libutil/sockaddr_snprintf.c: 227 in sockaddr_snprintf()
221                     case 'P':
222                             if (port)
223                                     ADDS(port);
224                             else if (p == -1)
225                                     ADDNA();
226                             else {
>>>     CID 1225014:  Unchecked return value  (CHECKED_RETURN)
>>>     No check of the return value of "getnameinfo(sa, 
>>> (__socklen_t)sa->sa_len, NULL, 0U, port = pbuf, 32U, 0)".
227                                     getnameinfo(sa, (socklen_t)sa->sa_len, 
NULL, 0,
228                                             port = pbuf,
229                                             (unsigned int)sizeof(pbuf), 0);
230                                     ADDS(port);
231                             }
232                             break;

________________________________________________________________________________________________________
*** CID 1225015:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
/external/gpl3/gdb/dist/gdb/frame.c: 594 in frame_id_eq()
588         /* The outermost frame marker is equal to itself.  This is the
589            dodgy thing about outer_frame_id, since between execution steps
590            we might step into another function - from which we can't
591            unwind either.  More thought required to get rid of
592            outer_frame_id.  */
593         eq = 1;
>>>     CID 1225015:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
>>>     The expression "l.stack_status == FID_STACK_INVALID || l.stack_status 
>>> == FID_STACK_INVALID" does not accomplish anything because it evaluates to 
>>> either of its identical operands, "l.stack_status == FID_STACK_INVALID".  
>>> Did you intend the operands to be different?
594       else if (l.stack_status == FID_STACK_INVALID
595                || l.stack_status == FID_STACK_INVALID)
596         /* Like a NaN, if either ID is invalid, the result is false.
597            Note that a frame ID is invalid iff it is the null frame ID.  */
598         eq = 0;
599       else if (l.stack_status != r.stack_status || l.stack_addr != 
r.stack_addr)

________________________________________________________________________________________________________
*** CID 1225016:  Logically dead code  (DEADCODE)
/external/gpl3/gdb/dist/gdb/frame.c: 325 in fprint_frame_id()
319     {
320       fprintf_unfiltered (file, "{");
321     
322       if (id.stack_status == FID_STACK_INVALID)
323         fprintf_unfiltered (file, "!stack");
324       else if (id.stack_status == FID_STACK_UNAVAILABLE)
>>>     CID 1225016:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this statement "fprintf_unfiltered(file, "s...".
325         fprintf_unfiltered (file, "stack=<unavailable>");
326       else
327         fprintf_unfiltered (file, "stack=%s", hex_string (id.stack_addr));
328       fprintf_unfiltered (file, ",");
329     
330       fprint_field (file, "code", id.code_addr_p, id.code_addr);

________________________________________________________________________________________________________
*** CID 1225017:  Logically dead code  (DEADCODE)
/external/gpl3/gdb/dist/gdb/varobj.c: 2687 in varobj_value_get_print_value()
2681       /* If the THEVALUE has contents, it is a regular string.  */
2682       if (thevalue)
2683         LA_PRINT_STRING (stb, type, (gdb_byte *) thevalue, len, encoding, 
0, &opts);
2684       else if (string_print)
2685         /* Otherwise, if string_print is set, and it is not a regular
2686            string, it is a lazy string.  */
>>>     CID 1225017:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this statement "val_print_string(type, enco...".
2687         val_print_string (type, encoding, str_addr, len, stb, &opts);
2688       else
2689         /* All other cases.  */
2690         common_val_print (value, stb, 0, &opts, current_language);
2691     
2692       thevalue = ui_file_xstrdup (stb, NULL);

________________________________________________________________________________________________________
*** CID 1225018:  Logically dead code  (DEADCODE)
/sys/ufs/lfs/ulfs_quota.c: 470 in quota_handle_cmd_del()
464                     if (fs->um_flags & ULFS_QUOTA2) {
465                             error = lfsquota2_handle_cmd_del(ump, qk);
466                     } else
467     #endif
468                             panic("quota_handle_cmd_get: no support ?");
469                     
>>>     CID 1225018:  Logically dead code  (DEADCODE)
>>>     Execution cannot reach this expression "error != 2" inside statement 
>>> "if (error && error != 2){
 ...".
470                     if (error && error != ENOENT)
471                             goto err;
472             }
473     
474             return 0;
475      err:


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
http://scan.coverity.com/projects/1448?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