WebKit Bugzilla
Attachment 343022 Details for
Bug 186763
: bmalloc: Coverity scan issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186763-20180619075452.patch (text/plain), 2.61 KB, created by
Tomas Popela
on 2018-06-18 22:54:53 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tomas Popela
Created:
2018-06-18 22:54:53 PDT
Size:
2.61 KB
patch
obsolete
>Subversion Revision: 232929 >diff --git a/Source/bmalloc/ChangeLog b/Source/bmalloc/ChangeLog >index 8b6caf2c57f800cd0f3572235b59b90a6b21e31b..985660293d6c98b99b4acf37bbbc5be4bfda63ec 100644 >--- a/Source/bmalloc/ChangeLog >+++ b/Source/bmalloc/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-19 Tomas Popela <tpopela@redhat.com> >+ >+ bmalloc: Coverity scan issues >+ https://bugs.webkit.org/show_bug.cgi?id=186763 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * bmalloc/DebugHeap.h: Initialize the m_pageSize variable. >+ * bmalloc/IsoTLS.cpp: >+ (bmalloc::IsoTLS::ensureEntries): Check the return value of >+ pthread_key_create return(). >+ * bmalloc/VMAllocate.h: >+ (bmalloc::vmPageSize): Correctly check the return value of sysconf(). >+ > 2018-06-09 Dan Bernstein <mitz@apple.com> > > [Xcode] Clean up and modernize some build setting definitions >diff --git a/Source/bmalloc/bmalloc/DebugHeap.h b/Source/bmalloc/bmalloc/DebugHeap.h >index 314b9c3d92d06cc0fc908947eccbecc912972d3b..0b16c3fde8bfdec0748f680ba86c74d3f819c6b8 100644 >--- a/Source/bmalloc/bmalloc/DebugHeap.h >+++ b/Source/bmalloc/bmalloc/DebugHeap.h >@@ -53,7 +53,7 @@ private: > #endif > > // This is the debug heap. We can use whatever data structures we like. It doesn't matter. >- size_t m_pageSize; >+ size_t m_pageSize { 0 }; > std::mutex m_lock; > std::unordered_map<void*, size_t> m_sizeMap; > }; >diff --git a/Source/bmalloc/bmalloc/IsoTLS.cpp b/Source/bmalloc/bmalloc/IsoTLS.cpp >index aca5bf0c9a84bf16b8740fe8c4f4b574d406b18b..c8173b03764164ebba8a9c8ecc95c6ca9ddb79c1 100644 >--- a/Source/bmalloc/bmalloc/IsoTLS.cpp >+++ b/Source/bmalloc/bmalloc/IsoTLS.cpp >@@ -68,7 +68,9 @@ IsoTLS* IsoTLS::ensureEntries(unsigned offset) > #if HAVE_PTHREAD_MACHDEP_H > pthread_key_init_np(tlsKey, destructor); > #else >- pthread_key_create(&s_tlsKey, destructor); >+ int error = pthread_key_create(&s_tlsKey, destructor); >+ if (error) >+ BCRASH(); > s_didInitialize = true; > #endif > }); >diff --git a/Source/bmalloc/bmalloc/VMAllocate.h b/Source/bmalloc/bmalloc/VMAllocate.h >index eb72f054cb9d9dc92458c31fc7220cf03ef7c727..40e2f8a4d7e354415000d763590511c6da7f0161 100644 >--- a/Source/bmalloc/bmalloc/VMAllocate.h >+++ b/Source/bmalloc/bmalloc/VMAllocate.h >@@ -56,8 +56,12 @@ namespace bmalloc { > inline size_t vmPageSize() > { > static size_t cached; >- if (!cached) >- cached = sysconf(_SC_PAGESIZE); >+ if (!cached) { >+ long pageSize = sysconf(_SC_PAGESIZE); >+ if (pageSize < 0) >+ BCRASH(); >+ cached = pageSize; >+ } > return cached; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186763
:
342932
|
342942
| 343022 |
343032