OSDN Git Service

bionic: fix assorted static analyzer warnings
authorGeorge Burgess IV <gbiv@google.com>
Tue, 27 Jun 2017 23:23:45 +0000 (16:23 -0700)
committerGeorge Burgess IV <gbiv@google.com>
Wed, 28 Jun 2017 22:03:15 +0000 (15:03 -0700)
commit705910094d07ddfc5a3b7a4baab58b0a94bcc691
treef503093f7f1675566233ac00bda745b8a9bcf714
parent82d746fb39465e78088aeb11a5dc178cf264d0c0
bionic: fix assorted static analyzer warnings

Warnings:

bionic/libc/bionic/fts.c:722:5: warning: Null passed to a callee that
requires a non-null 1st parameter

bionic/libc/bionic/sched_cpualloc.c:34:25: warning: Result of 'malloc'
is converted to a pointer of type 'cpu_set_t', which is incompatible
with sizeof operand type 'unsigned long'

bionic/linker/linker_main.cpp:315:7: warning: Access to field 'e_type'
results in a dereference of a null pointer (loaded from variable
'elf_hdr')

bionic/linker/linker_main.cpp:493:66: warning: Access to field 'e_phoff'
results in a dereference of a null pointer (loaded from variable
'elf_hdr')

bionic/linker/linker_main.cpp:90:14: warning: Access to field 'next'
results in a dereference of a null pointer (loaded from variable 'prev')

Bug: None
Test: mma; analyzer warnings are gone. CtsBionicTestCases pass.
Change-Id: I699a60c2c6f64c50b9ea06848a680c98a8abb44a
benchmarks/pthread_benchmark.cpp
libc/bionic/fts.c
libc/bionic/sched_cpualloc.c
linker/linker_main.cpp