CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
CVE-2014-9427
https://www.cvedetails.com/cve/CVE-2014-9427/
CWE-119
https://git.php.net/?p=php-src.git;a=commit;h=f9ad3086693fce680fbe246e4a45aa92edd2ac35
f9ad3086693fce680fbe246e4a45aa92edd2ac35
null
static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */ { char *s, *p; int len; ALLOCA_FLAG(use_heap) if (h->header_len > 0) { p = strchr(h->header, ':'); len = p - h->header; if (p && (len > 0)) { while (len > 0 && (h->header[len-1] == ' ' || h->header[len-1] == '\t')) { len--; } if (len) { s = do_alloca(len + 1, use_heap); memcpy(s, h->header, len); s[len] = 0; do { p++; } while (*p == ' ' || *p == '\t'); add_assoc_stringl_ex(return_value, s, len+1, p, h->header_len - (p - h->header), 1); free_alloca(s, use_heap); } } } } /* }}} */
static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */ { char *s, *p; int len; ALLOCA_FLAG(use_heap) if (h->header_len > 0) { p = strchr(h->header, ':'); len = p - h->header; if (p && (len > 0)) { while (len > 0 && (h->header[len-1] == ' ' || h->header[len-1] == '\t')) { len--; } if (len) { s = do_alloca(len + 1, use_heap); memcpy(s, h->header, len); s[len] = 0; do { p++; } while (*p == ' ' || *p == '\t'); add_assoc_stringl_ex(return_value, s, len+1, p, h->header_len - (p - h->header), 1); free_alloca(s, use_heap); } } } } /* }}} */
C
php
0
CVE-2018-6063
https://www.cvedetails.com/cve/CVE-2018-6063/
CWE-787
https://github.com/chromium/chromium/commit/673ce95d481ea9368c4d4d43ac756ba1d6d9e608
673ce95d481ea9368c4d4d43ac756ba1d6d9e608
Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the memory protection applied to a handle when mapped. Where fixing usage is infeasible for this CL, TODOs are added to annotate follow-up work. Also updates the API and documentation to (hopefully) improve clarity and avoid similar mistakes from being made in the future. BUG=792900 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I0578aaa9ca3bfcb01aaf2451315d1ede95458477 Reviewed-on: https://chromium-review.googlesource.com/818282 Reviewed-by: Wei Li <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Reviewed-by: John Abd-El-Malek <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Sadrul Chowdhury <[email protected]> Reviewed-by: Yuzhu Shen <[email protected]> Reviewed-by: Robert Sesek <[email protected]> Commit-Queue: Ken Rockot <[email protected]> Cr-Commit-Position: refs/heads/master@{#530268}
MojoResult Core::SerializeMessage(MojoMessageHandle message_handle) { if (!message_handle) return MOJO_RESULT_INVALID_ARGUMENT; RequestContext request_context; return reinterpret_cast<ports::UserMessageEvent*>(message_handle) ->GetMessage<UserMessageImpl>() ->SerializeIfNecessary(); }
MojoResult Core::SerializeMessage(MojoMessageHandle message_handle) { if (!message_handle) return MOJO_RESULT_INVALID_ARGUMENT; RequestContext request_context; return reinterpret_cast<ports::UserMessageEvent*>(message_handle) ->GetMessage<UserMessageImpl>() ->SerializeIfNecessary(); }
C
Chrome
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#653137}
RenderFrameHostImpl::AccessibilityGetNativeViewAccessibleForWindow() { RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( render_view_host_->GetWidget()->GetView()); if (view) return view->AccessibilityGetNativeViewAccessibleForWindow(); return nullptr; }
RenderFrameHostImpl::AccessibilityGetNativeViewAccessibleForWindow() { RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( render_view_host_->GetWidget()->GetView()); if (view) return view->AccessibilityGetNativeViewAccessibleForWindow(); return nullptr; }
C
Chrome
0
CVE-2018-12714
https://www.cvedetails.com/cve/CVE-2018-12714/
CWE-787
https://github.com/torvalds/linux/commit/81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
81f9c4e4177d31ced6f52a89bb70e93bfb77ca03
Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "This contains a few fixes and a clean up. - a bad merge caused an "endif" to go in the wrong place in scripts/Makefile.build - softirq tracing fix for tracing that corrupts lockdep and causes a false splat - histogram documentation typo fixes - fix a bad memory reference when passing in no filter to the filter code - simplify code by using the swap macro instead of open coding the swap" * tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount tracing: Fix some errors in histogram documentation tracing: Use swap macro in update_max_tr softirq: Reorder trace_softirqs_on to prevent lockdep splat tracing: Check for no filter when processing event filters
static inline __init int register_snapshot_cmd(void) { return 0; }
static inline __init int register_snapshot_cmd(void) { return 0; }
C
linux
0
CVE-2013-0910
https://www.cvedetails.com/cve/CVE-2013-0910/
CWE-287
https://github.com/chromium/chromium/commit/ac8bd041b81e46e4e4fcd5021aaa5499703952e6
ac8bd041b81e46e4e4fcd5021aaa5499703952e6
Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180600 0039d316-1c4b-4281-b951-d872f2087c98
void PluginServiceImpl::AppActivated() { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&NotifyPluginsOfActivation)); }
void PluginServiceImpl::AppActivated() { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&NotifyPluginsOfActivation)); }
C
Chrome
0
CVE-2016-8740
https://www.cvedetails.com/cve/CVE-2016-8740/
CWE-20
https://github.com/apache/httpd/commit/29c63b786ae028d82405421585e91283c8fa0da3
29c63b786ae028d82405421585e91283c8fa0da3
SECURITY: CVE-2016-8740 mod_http2: properly crafted, endless HTTP/2 CONTINUATION frames could be used to exhaust all server's memory. Reported by: Naveen Tiwari <[email protected]> and CDF/SEFCOM at Arizona State University git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1772576 13f79535-47bb-0310-9956-ffa450edef68
static void dispatch_event(h2_session *session, h2_session_event_t ev, int arg, const char *msg) { switch (ev) { case H2_SESSION_EV_INIT: h2_session_ev_init(session, arg, msg); break; case H2_SESSION_EV_LOCAL_GOAWAY: h2_session_ev_local_goaway(session, arg, msg); break; case H2_SESSION_EV_REMOTE_GOAWAY: h2_session_ev_remote_goaway(session, arg, msg); break; case H2_SESSION_EV_CONN_ERROR: h2_session_ev_conn_error(session, arg, msg); break; case H2_SESSION_EV_PROTO_ERROR: h2_session_ev_proto_error(session, arg, msg); break; case H2_SESSION_EV_CONN_TIMEOUT: h2_session_ev_conn_timeout(session, arg, msg); break; case H2_SESSION_EV_NO_IO: h2_session_ev_no_io(session, arg, msg); break; case H2_SESSION_EV_STREAM_READY: h2_session_ev_stream_ready(session, arg, msg); break; case H2_SESSION_EV_DATA_READ: h2_session_ev_data_read(session, arg, msg); break; case H2_SESSION_EV_NGH2_DONE: h2_session_ev_ngh2_done(session, arg, msg); break; case H2_SESSION_EV_MPM_STOPPING: h2_session_ev_mpm_stopping(session, arg, msg); break; case H2_SESSION_EV_PRE_CLOSE: h2_session_ev_pre_close(session, arg, msg); break; case H2_SESSION_EV_STREAM_OPEN: h2_session_ev_stream_open(session, arg, msg); break; case H2_SESSION_EV_STREAM_DONE: h2_session_ev_stream_done(session, arg, msg); break; default: ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, "h2_session(%ld): unknown event %d", session->id, ev); break; } if (session->state == H2_SESSION_ST_DONE) { apr_brigade_cleanup(session->bbtmp); h2_mplx_abort(session->mplx); } }
static void dispatch_event(h2_session *session, h2_session_event_t ev, int arg, const char *msg) { switch (ev) { case H2_SESSION_EV_INIT: h2_session_ev_init(session, arg, msg); break; case H2_SESSION_EV_LOCAL_GOAWAY: h2_session_ev_local_goaway(session, arg, msg); break; case H2_SESSION_EV_REMOTE_GOAWAY: h2_session_ev_remote_goaway(session, arg, msg); break; case H2_SESSION_EV_CONN_ERROR: h2_session_ev_conn_error(session, arg, msg); break; case H2_SESSION_EV_PROTO_ERROR: h2_session_ev_proto_error(session, arg, msg); break; case H2_SESSION_EV_CONN_TIMEOUT: h2_session_ev_conn_timeout(session, arg, msg); break; case H2_SESSION_EV_NO_IO: h2_session_ev_no_io(session, arg, msg); break; case H2_SESSION_EV_STREAM_READY: h2_session_ev_stream_ready(session, arg, msg); break; case H2_SESSION_EV_DATA_READ: h2_session_ev_data_read(session, arg, msg); break; case H2_SESSION_EV_NGH2_DONE: h2_session_ev_ngh2_done(session, arg, msg); break; case H2_SESSION_EV_MPM_STOPPING: h2_session_ev_mpm_stopping(session, arg, msg); break; case H2_SESSION_EV_PRE_CLOSE: h2_session_ev_pre_close(session, arg, msg); break; case H2_SESSION_EV_STREAM_OPEN: h2_session_ev_stream_open(session, arg, msg); break; case H2_SESSION_EV_STREAM_DONE: h2_session_ev_stream_done(session, arg, msg); break; default: ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, "h2_session(%ld): unknown event %d", session->id, ev); break; } if (session->state == H2_SESSION_ST_DONE) { apr_brigade_cleanup(session->bbtmp); h2_mplx_abort(session->mplx); } }
C
httpd
0
CVE-2013-2884
https://www.cvedetails.com/cve/CVE-2013-2884/
CWE-399
https://github.com/chromium/chromium/commit/4ac8bc08e3306f38a5ab3e551aef6ad43753579c
4ac8bc08e3306f38a5ab3e551aef6ad43753579c
Set Attr.ownerDocument in Element#setAttributeNode() Attr objects can move across documents by setAttributeNode(). So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded(). BUG=248950 TEST=set-attribute-node-from-iframe.html Review URL: https://chromiumcodereview.appspot.com/17583003 git-svn-id: svn://svn.chromium.org/blink/trunk@152938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void Element::removedFrom(ContainerNode* insertionPoint) { bool wasInDocument = insertionPoint->document(); if (Element* before = pseudoElement(BEFORE)) before->removedFrom(insertionPoint); if (Element* after = pseudoElement(AFTER)) after->removedFrom(insertionPoint); document()->removeFromTopLayer(this); if (containsFullScreenElement()) setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); if (document()->page()) document()->page()->pointerLockController()->elementRemoved(this); setSavedLayerScrollOffset(IntSize()); if (insertionPoint->isInTreeScope() && treeScope() == document()) { const AtomicString& idValue = getIdAttribute(); if (!idValue.isNull()) updateId(insertionPoint->treeScope(), idValue, nullAtom); const AtomicString& nameValue = getNameAttribute(); if (!nameValue.isNull()) updateName(nameValue, nullAtom); if (hasTagName(labelTag)) { TreeScope* treeScope = insertionPoint->treeScope(); if (treeScope->shouldCacheLabelsByForAttribute()) updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); } } ContainerNode::removedFrom(insertionPoint); if (wasInDocument && hasPendingResources()) document()->accessSVGExtensions()->removeElementFromPendingResources(this); }
void Element::removedFrom(ContainerNode* insertionPoint) { bool wasInDocument = insertionPoint->document(); if (Element* before = pseudoElement(BEFORE)) before->removedFrom(insertionPoint); if (Element* after = pseudoElement(AFTER)) after->removedFrom(insertionPoint); document()->removeFromTopLayer(this); if (containsFullScreenElement()) setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); if (document()->page()) document()->page()->pointerLockController()->elementRemoved(this); setSavedLayerScrollOffset(IntSize()); if (insertionPoint->isInTreeScope() && treeScope() == document()) { const AtomicString& idValue = getIdAttribute(); if (!idValue.isNull()) updateId(insertionPoint->treeScope(), idValue, nullAtom); const AtomicString& nameValue = getNameAttribute(); if (!nameValue.isNull()) updateName(nameValue, nullAtom); if (hasTagName(labelTag)) { TreeScope* treeScope = insertionPoint->treeScope(); if (treeScope->shouldCacheLabelsByForAttribute()) updateLabel(treeScope, fastGetAttribute(forAttr), nullAtom); } } ContainerNode::removedFrom(insertionPoint); if (wasInDocument && hasPendingResources()) document()->accessSVGExtensions()->removeElementFromPendingResources(this); }
C
Chrome
0
CVE-2019-5827
https://www.cvedetails.com/cve/CVE-2019-5827/
CWE-190
https://github.com/chromium/chromium/commit/517ac71c9ee27f856f9becde8abea7d1604af9d4
517ac71c9ee27f856f9becde8abea7d1604af9d4
sqlite: backport bugfixes for dbfuzz2 Bug: 952406 Change-Id: Icbec429742048d6674828726c96d8e265c41b595 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1568152 Reviewed-by: Chris Mumford <[email protected]> Commit-Queue: Darwin Huang <[email protected]> Cr-Commit-Position: refs/heads/master@{#651030}
__declspec(dllexport) #endif SQLITE_API int sqlite3_stmt_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); #ifndef SQLITE_OMIT_VIRTUALTABLE rc = sqlite3StmtVtabInit(db); #endif return rc; }
__declspec(dllexport) #endif SQLITE_API int sqlite3_stmt_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); #ifndef SQLITE_OMIT_VIRTUALTABLE rc = sqlite3StmtVtabInit(db); #endif return rc; }
C
Chrome
0