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-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/0e9e87823285d504a210dcce2eabdc847f230f09
0e9e87823285d504a210dcce2eabdc847f230f09
Adds per-provider information to omnibox UMA logs. Adds a fairly general structure to omnibox logs that can be used to pass information (that's not per-result information) from providers to the UMA logs. Right now it's only used to pass whether the asynchronous pass of a provider has finished, but it will probably be used for other things in the future. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10380007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137288 0039d316-1c4b-4281-b951-d872f2087c98
void AutocompleteEditModel::StopAutocomplete() { if (popup_->IsOpen() && !in_revert_) { InstantController* instant = controller_->GetInstant(); if (instant && !instant->commit_on_mouse_up()) instant->DestroyPreviewContents(); } autocomplete_controller_->Stop(true); }
void AutocompleteEditModel::StopAutocomplete() { if (popup_->IsOpen() && !in_revert_) { InstantController* instant = controller_->GetInstant(); if (instant && !instant->commit_on_mouse_up()) instant->DestroyPreviewContents(); } autocomplete_controller_->Stop(true); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/59f5e0204cbc0e524b2687fb1beddda82047d16d
59f5e0204cbc0e524b2687fb1beddda82047d16d
AutoFill: Record whether the user initiated the form submission and don't save form data if the form was not user-submitted. BUG=48225 TEST=none Review URL: http://codereview.chromium.org/2842062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53350 0039d316-1c4b-4281-b951-d872f2087c98
void AutoFillManager::FormsSeen(const std::vector<FormData>& forms) { if (!IsAutoFillEnabled()) return; if (personal_data_->profiles().empty() && personal_data_->credit_cards().empty()) return; ParseForms(forms); }
void AutoFillManager::FormsSeen(const std::vector<FormData>& forms) { if (!IsAutoFillEnabled()) return; if (personal_data_->profiles().empty() && personal_data_->credit_cards().empty()) return; ParseForms(forms); }
C
Chrome
0
CVE-2014-2669
https://www.cvedetails.com/cve/CVE-2014-2669/
CWE-189
https://github.com/postgres/postgres/commit/31400a673325147e1205326008e32135a78b4d8a
31400a673325147e1205326008e32135a78b4d8a
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small allocation followed shortly thereafter. Coverity identified the path_in() vulnerability; code inspection led to the rest. In passing, add check_stack_depth() to prevent stack overflow in related functions. Back-patch to 8.4 (all supported versions). The non-comment hstore changes touch code that did not exist in 8.4, so that part stops at 9.0. Noah Misch and Heikki Linnakangas, reviewed by Tom Lane. Security: CVE-2014-0064
dist_ppath(PG_FUNCTION_ARGS) { Point *pt = PG_GETARG_POINT_P(0); PATH *path = PG_GETARG_PATH_P(1); float8 result = 0.0; /* keep compiler quiet */ bool have_min = false; float8 tmp; int i; LSEG lseg; switch (path->npts) { case 0: /* no points in path? then result is undefined... */ PG_RETURN_NULL(); case 1: /* one point in path? then get distance between two points... */ result = point_dt(pt, &path->p[0]); break; default: /* make sure the path makes sense... */ Assert(path->npts > 1); /* * the distance from a point to a path is the smallest distance * from the point to any of its constituent segments. */ for (i = 0; i < path->npts; i++) { int iprev; if (i > 0) iprev = i - 1; else { if (!path->closed) continue; iprev = path->npts - 1; /* include the closure segment */ } statlseg_construct(&lseg, &path->p[iprev], &path->p[i]); tmp = dist_ps_internal(pt, &lseg); if (!have_min || tmp < result) { result = tmp; have_min = true; } } break; } PG_RETURN_FLOAT8(result); }
dist_ppath(PG_FUNCTION_ARGS) { Point *pt = PG_GETARG_POINT_P(0); PATH *path = PG_GETARG_PATH_P(1); float8 result = 0.0; /* keep compiler quiet */ bool have_min = false; float8 tmp; int i; LSEG lseg; switch (path->npts) { case 0: /* no points in path? then result is undefined... */ PG_RETURN_NULL(); case 1: /* one point in path? then get distance between two points... */ result = point_dt(pt, &path->p[0]); break; default: /* make sure the path makes sense... */ Assert(path->npts > 1); /* * the distance from a point to a path is the smallest distance * from the point to any of its constituent segments. */ for (i = 0; i < path->npts; i++) { int iprev; if (i > 0) iprev = i - 1; else { if (!path->closed) continue; iprev = path->npts - 1; /* include the closure segment */ } statlseg_construct(&lseg, &path->p[iprev], &path->p[i]); tmp = dist_ps_internal(pt, &lseg); if (!have_min || tmp < result) { result = tmp; have_min = true; } } break; } PG_RETURN_FLOAT8(result); }
C
postgres
0
CVE-2010-1166
https://www.cvedetails.com/cve/CVE-2010-1166/
CWE-189
https://cgit.freedesktop.org/xorg/xserver/commit/?id=d2f813f7db
d2f813f7db157fc83abc4b3726821c36ee7e40b1
null
static void fbFetchSolid(PicturePtr pict, int x, int y, int width, CARD32 *buffer, CARD32 *mask, CARD32 maskBits) { FbBits *bits; FbStride stride; int bpp; int xoff, yoff; CARD32 color; CARD32 *end; fetchPixelProc fetch = fetchPixelProcForPicture(pict); miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate; fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff); bits += yoff*stride + (xoff*bpp >> FB_SHIFT); color = fetch(bits, 0, indexed); end = buffer + width; while (buffer < end) WRITE(buffer++, color); fbFinishAccess (pict->pDrawable); }
static void fbFetchSolid(PicturePtr pict, int x, int y, int width, CARD32 *buffer, CARD32 *mask, CARD32 maskBits) { FbBits *bits; FbStride stride; int bpp; int xoff, yoff; CARD32 color; CARD32 *end; fetchPixelProc fetch = fetchPixelProcForPicture(pict); miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate; fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff); bits += yoff*stride + (xoff*bpp >> FB_SHIFT); color = fetch(bits, 0, indexed); end = buffer + width; while (buffer < end) WRITE(buffer++, color); fbFinishAccess (pict->pDrawable); }
C
xserver
0
CVE-2015-1265
https://www.cvedetails.com/cve/CVE-2015-1265/
null
https://github.com/chromium/chromium/commit/04ff52bb66284467ccb43d90800013b89ee8db75
04ff52bb66284467ccb43d90800013b89ee8db75
Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one. BUG=672468 CQ_INCLUDE_TRYBOTS=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 Review-Url: https://codereview.chromium.org/2692203003 Cr-Commit-Position: refs/heads/master@{#450939}
void AudioRendererHost::AuthorizationCompleted( int stream_id, const url::Origin& security_origin, base::TimeTicks auth_start_time, media::OutputDeviceStatus status, bool should_send_id, const media::AudioParameters& params, const std::string& raw_device_id) { DCHECK_CURRENTLY_ON(BrowserThread::IO); auto auth_data = authorizations_.find(stream_id); if (auth_data == authorizations_.end()) return; // Stream was closed before finishing authorization UMALogDeviceAuthorizationTime(auth_start_time); if (status == media::OUTPUT_DEVICE_STATUS_OK) { auth_data->second.first = true; auth_data->second.second = raw_device_id; if (should_send_id) { std::string hashed_id = MediaStreamManager::GetHMACForMediaDeviceID( salt_, security_origin, raw_device_id); Send(new AudioMsg_NotifyDeviceAuthorized(stream_id, status, params, hashed_id)); } else { Send(new AudioMsg_NotifyDeviceAuthorized(stream_id, status, params, std::string())); } } else { authorizations_.erase(auth_data); Send(new AudioMsg_NotifyDeviceAuthorized( stream_id, status, media::AudioParameters::UnavailableDeviceParams(), std::string())); } }
void AudioRendererHost::AuthorizationCompleted( int stream_id, const url::Origin& security_origin, base::TimeTicks auth_start_time, media::OutputDeviceStatus status, bool should_send_id, const media::AudioParameters& params, const std::string& raw_device_id) { DCHECK_CURRENTLY_ON(BrowserThread::IO); auto auth_data = authorizations_.find(stream_id); if (auth_data == authorizations_.end()) return; // Stream was closed before finishing authorization UMALogDeviceAuthorizationTime(auth_start_time); if (status == media::OUTPUT_DEVICE_STATUS_OK) { auth_data->second.first = true; auth_data->second.second = raw_device_id; if (should_send_id) { std::string hashed_id = MediaStreamManager::GetHMACForMediaDeviceID( salt_, security_origin, raw_device_id); Send(new AudioMsg_NotifyDeviceAuthorized(stream_id, status, params, hashed_id)); } else { Send(new AudioMsg_NotifyDeviceAuthorized(stream_id, status, params, std::string())); } } else { authorizations_.erase(auth_data); Send(new AudioMsg_NotifyDeviceAuthorized( stream_id, status, media::AudioParameters::UnavailableDeviceParams(), std::string())); } }
C
Chrome
0
CVE-2016-4356
https://www.cvedetails.com/cve/CVE-2016-4356/
CWE-119
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libksba.git;a=commit;h=243d12fdec66a4360fbb3e307a046b39b5b4ffc3
243d12fdec66a4360fbb3e307a046b39b5b4ffc3
null
put_stringbuf_mem (struct stringbuf *sb, const char *text, size_t n) { if (sb->out_of_core) return; if (sb->len + n >= sb->size) { char *p; sb->size += n + 100; p = xtryrealloc (sb->buf, sb->size); if ( !p) { sb->out_of_core = 1; return; } sb->buf = p; } memcpy (sb->buf+sb->len, text, n); sb->len += n; }
put_stringbuf_mem (struct stringbuf *sb, const char *text, size_t n) { if (sb->out_of_core) return; if (sb->len + n >= sb->size) { char *p; sb->size += n + 100; p = xtryrealloc (sb->buf, sb->size); if ( !p) { sb->out_of_core = 1; return; } sb->buf = p; } memcpy (sb->buf+sb->len, text, n); sb->len += n; }
C
gnupg
0
CVE-2017-5061
https://www.cvedetails.com/cve/CVE-2017-5061/
CWE-362
https://github.com/chromium/chromium/commit/5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
5d78b84d39bd34bc9fce9d01c0dcd5a22a330d34
(Reland) Discard compositor frames from unloaded web content This is a reland of https://codereview.chromium.org/2707243005/ with a small change to fix an uninitialized memory error that fails on MSAN bots. BUG=672847 [email protected], [email protected] CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2731283003 Cr-Commit-Position: refs/heads/master@{#454954}
bool LayerTreeHost::IsVisible() const { return visible_; }
bool LayerTreeHost::IsVisible() const { return visible_; }
C
Chrome
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_setclientid_confirm *setclientid_confirm) { struct nfs4_client *conf, *unconf; struct nfs4_client *old = NULL; nfs4_verifier confirm = setclientid_confirm->sc_confirm; clientid_t * clid = &setclientid_confirm->sc_clientid; __be32 status; struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); if (STALE_CLIENTID(clid, nn)) return nfserr_stale_clientid; spin_lock(&nn->client_lock); conf = find_confirmed_client(clid, false, nn); unconf = find_unconfirmed_client(clid, false, nn); /* * We try hard to give out unique clientid's, so if we get an * attempt to confirm the same clientid with a different cred, * the client may be buggy; this should never happen. * * Nevertheless, RFC 7530 recommends INUSE for this case: */ status = nfserr_clid_inuse; if (unconf && !same_creds(&unconf->cl_cred, &rqstp->rq_cred)) goto out; if (conf && !same_creds(&conf->cl_cred, &rqstp->rq_cred)) goto out; /* cases below refer to rfc 3530 section 14.2.34: */ if (!unconf || !same_verf(&confirm, &unconf->cl_confirm)) { if (conf && same_verf(&confirm, &conf->cl_confirm)) { /* case 2: probable retransmit */ status = nfs_ok; } else /* case 4: client hasn't noticed we rebooted yet? */ status = nfserr_stale_clientid; goto out; } status = nfs_ok; if (conf) { /* case 1: callback update */ old = unconf; unhash_client_locked(old); nfsd4_change_callback(conf, &unconf->cl_cb_conn); } else { /* case 3: normal case; new or rebooted client */ old = find_confirmed_client_by_name(&unconf->cl_name, nn); if (old) { status = nfserr_clid_inuse; if (client_has_state(old) && !same_creds(&unconf->cl_cred, &old->cl_cred)) goto out; status = mark_client_expired_locked(old); if (status) { old = NULL; goto out; } } move_to_confirmed(unconf); conf = unconf; } get_client_locked(conf); spin_unlock(&nn->client_lock); nfsd4_probe_callback(conf); spin_lock(&nn->client_lock); put_client_renew_locked(conf); out: spin_unlock(&nn->client_lock); if (old) expire_client(old); return status; }
nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_setclientid_confirm *setclientid_confirm) { struct nfs4_client *conf, *unconf; struct nfs4_client *old = NULL; nfs4_verifier confirm = setclientid_confirm->sc_confirm; clientid_t * clid = &setclientid_confirm->sc_clientid; __be32 status; struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); if (STALE_CLIENTID(clid, nn)) return nfserr_stale_clientid; spin_lock(&nn->client_lock); conf = find_confirmed_client(clid, false, nn); unconf = find_unconfirmed_client(clid, false, nn); /* * We try hard to give out unique clientid's, so if we get an * attempt to confirm the same clientid with a different cred, * the client may be buggy; this should never happen. * * Nevertheless, RFC 7530 recommends INUSE for this case: */ status = nfserr_clid_inuse; if (unconf && !same_creds(&unconf->cl_cred, &rqstp->rq_cred)) goto out; if (conf && !same_creds(&conf->cl_cred, &rqstp->rq_cred)) goto out; /* cases below refer to rfc 3530 section 14.2.34: */ if (!unconf || !same_verf(&confirm, &unconf->cl_confirm)) { if (conf && same_verf(&confirm, &conf->cl_confirm)) { /* case 2: probable retransmit */ status = nfs_ok; } else /* case 4: client hasn't noticed we rebooted yet? */ status = nfserr_stale_clientid; goto out; } status = nfs_ok; if (conf) { /* case 1: callback update */ old = unconf; unhash_client_locked(old); nfsd4_change_callback(conf, &unconf->cl_cb_conn); } else { /* case 3: normal case; new or rebooted client */ old = find_confirmed_client_by_name(&unconf->cl_name, nn); if (old) { status = nfserr_clid_inuse; if (client_has_state(old) && !same_creds(&unconf->cl_cred, &old->cl_cred)) goto out; status = mark_client_expired_locked(old); if (status) { old = NULL; goto out; } } move_to_confirmed(unconf); conf = unconf; } get_client_locked(conf); spin_unlock(&nn->client_lock); nfsd4_probe_callback(conf); spin_lock(&nn->client_lock); put_client_renew_locked(conf); out: spin_unlock(&nn->client_lock); if (old) expire_client(old); return status; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/3a353ebdb7753a3fbeb401c4c0e0f3358ccbb90b
3a353ebdb7753a3fbeb401c4c0e0f3358ccbb90b
Support pausing media when a context is frozen. Media is resumed when the context is unpaused. This feature will be used for bfcache and pausing iframes feature policy. BUG=907125 Change-Id: Ic3925ea1a4544242b7bf0b9ad8c9cb9f63976bbd Reviewed-on: https://chromium-review.googlesource.com/c/1410126 Commit-Queue: Dave Tapuska <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Mounir Lamouri <[email protected]> Cr-Commit-Position: refs/heads/master@{#623319}
void HTMLMediaElement::RemotePlaybackStarted() { if (RemotePlaybackClient()) RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnected); }
void HTMLMediaElement::RemotePlaybackStarted() { if (RemotePlaybackClient()) RemotePlaybackClient()->StateChanged(WebRemotePlaybackState::kConnected); }
C
Chrome
0
CVE-2011-4930
https://www.cvedetails.com/cve/CVE-2011-4930/
CWE-134
https://htcondor-git.cs.wisc.edu/?p=condor.git;a=commitdiff;h=5e5571d1a431eb3c61977b6dd6ec90186ef79867
5e5571d1a431eb3c61977b6dd6ec90186ef79867
null
CronTab::initRegexObject() { if ( ! CronTab::regex.isInitialized() ) { const char *errptr; int erroffset; MyString pattern( CRONTAB_PARAMETER_PATTERN ) ; if ( ! CronTab::regex.compile( pattern, &errptr, &erroffset )) { MyString error = "CronTab: Failed to compile Regex - "; error += pattern; EXCEPT( "%s", const_cast<char*>(error.Value()) ); } } }
CronTab::initRegexObject() { if ( ! CronTab::regex.isInitialized() ) { const char *errptr; int erroffset; MyString pattern( CRONTAB_PARAMETER_PATTERN ) ; if ( ! CronTab::regex.compile( pattern, &errptr, &erroffset )) { MyString error = "CronTab: Failed to compile Regex - "; error += pattern; EXCEPT( const_cast<char*>(error.Value())); } } }
CPP
htcondor
1
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
void V8TestObject::VoidMethodDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDictionaryArg"); test_object_v8_internal::VoidMethodDictionaryArgMethod(info); }
void V8TestObject::VoidMethodDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodDictionaryArg"); test_object_v8_internal::VoidMethodDictionaryArgMethod(info); }
C
Chrome
0
CVE-2017-14604
https://www.cvedetails.com/cve/CVE-2017-14604/
CWE-20
https://github.com/GNOME/nautilus/commit/1630f53481f445ada0a455e9979236d31a8d3bb0
1630f53481f445ada0a455e9979236d31a8d3bb0
mime-actions: use file metadata for trusting desktop files Currently we only trust desktop files that have the executable bit set, and don't replace the displayed icon or the displayed name until it's trusted, which prevents for running random programs by a malicious desktop file. However, the executable permission is preserved if the desktop file comes from a compressed file. To prevent this, add a metadata::trusted metadata to the file once the user acknowledges the file as trusted. This adds metadata to the file, which cannot be added unless it has access to the computer. Also remove the SHEBANG "trusted" content we were putting inside the desktop file, since that doesn't add more security since it can come with the file itself. https://bugzilla.gnome.org/show_bug.cgi?id=777991
extension_info_start (NautilusDirectory *directory, NautilusFile *file, gboolean *doing_io) { NautilusInfoProvider *provider; NautilusOperationResult result; NautilusOperationHandle *handle; GClosure *update_complete; if (directory->details->extension_info_in_progress != NULL) { *doing_io = TRUE; return; } if (!is_needy (file, lacks_extension_info, REQUEST_EXTENSION_INFO)) { return; } *doing_io = TRUE; if (!async_job_start (directory, "extension info")) { return; } provider = file->details->pending_info_providers->data; update_complete = g_cclosure_new (G_CALLBACK (info_provider_callback), directory, NULL); g_closure_set_marshal (update_complete, g_cclosure_marshal_generic); result = nautilus_info_provider_update_file_info (provider, NAUTILUS_FILE_INFO (file), update_complete, &handle); g_closure_unref (update_complete); if (result == NAUTILUS_OPERATION_COMPLETE || result == NAUTILUS_OPERATION_FAILED) { finish_info_provider (directory, file, provider); async_job_end (directory, "extension info"); } else { directory->details->extension_info_in_progress = handle; directory->details->extension_info_provider = provider; directory->details->extension_info_file = file; } }
extension_info_start (NautilusDirectory *directory, NautilusFile *file, gboolean *doing_io) { NautilusInfoProvider *provider; NautilusOperationResult result; NautilusOperationHandle *handle; GClosure *update_complete; if (directory->details->extension_info_in_progress != NULL) { *doing_io = TRUE; return; } if (!is_needy (file, lacks_extension_info, REQUEST_EXTENSION_INFO)) { return; } *doing_io = TRUE; if (!async_job_start (directory, "extension info")) { return; } provider = file->details->pending_info_providers->data; update_complete = g_cclosure_new (G_CALLBACK (info_provider_callback), directory, NULL); g_closure_set_marshal (update_complete, g_cclosure_marshal_generic); result = nautilus_info_provider_update_file_info (provider, NAUTILUS_FILE_INFO (file), update_complete, &handle); g_closure_unref (update_complete); if (result == NAUTILUS_OPERATION_COMPLETE || result == NAUTILUS_OPERATION_FAILED) { finish_info_provider (directory, file, provider); async_job_end (directory, "extension info"); } else { directory->details->extension_info_in_progress = handle; directory->details->extension_info_provider = provider; directory->details->extension_info_file = file; } }
C
nautilus
0
CVE-2011-3209
https://www.cvedetails.com/cve/CVE-2011-3209/
CWE-189
https://github.com/torvalds/linux/commit/f8bd2258e2d520dff28c855658bd24bdafb5102d
f8bd2258e2d520dff28c855658bd24bdafb5102d
remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflow. The API is a little akward, as the arguments for the unsigned divide are signed. The signed version also doesn't handle a negative divisor and produces worse code on 64bit archs. There is little incentive to keep this API alive, so this converts the few users to the new API. Signed-off-by: Roman Zippel <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: john stultz <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static struct page *get_object_page(const void *x) { struct page *page = virt_to_head_page(x); if (!PageSlab(page)) return NULL; return page; }
static struct page *get_object_page(const void *x) { struct page *page = virt_to_head_page(x); if (!PageSlab(page)) return NULL; return page; }
C
linux
0
CVE-2013-6371
https://www.cvedetails.com/cve/CVE-2013-6371/
CWE-310
https://github.com/json-c/json-c/commit/64e36901a0614bf64a19bc3396469c66dcd0b015
64e36901a0614bf64a19bc3396469c66dcd0b015
Patch to address the following issues: * CVE-2013-6371: hash collision denial of service * CVE-2013-6370: buffer overflow if size_t is larger than int
void lh_abort(const char *msg, ...) { va_list ap; va_start(ap, msg); vprintf(msg, ap); va_end(ap); exit(1); }
void lh_abort(const char *msg, ...) { va_list ap; va_start(ap, msg); vprintf(msg, ap); va_end(ap); exit(1); }
C
json-c
0
CVE-2016-10267
https://www.cvedetails.com/cve/CVE-2016-10267/
CWE-369
https://github.com/vadz/libtiff/commit/43bc256d8ae44b92d2734a3c5bc73957a4d7c1ec
43bc256d8ae44b92d2734a3c5bc73957a4d7c1ec
* libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues. Reported by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611
OJPEGReadHeaderInfoSecStreamSos(TIFF* tif) { /* this marker needs to be checked, and part of its data needs to be saved for regeneration later on */ static const char module[]="OJPEGReadHeaderInfoSecStreamSos"; OJPEGState* sp=(OJPEGState*)tif->tif_data; uint16 m; uint8 n; uint8 o; assert(sp->subsamplingcorrect==0); if (sp->sof_log==0) { TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); return(0); } /* Ls */ if (OJPEGReadWord(sp,&m)==0) return(0); if (m!=6+sp->samples_per_pixel_per_plane*2) { TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); return(0); } /* Ns */ if (OJPEGReadByte(sp,&n)==0) return(0); if (n!=sp->samples_per_pixel_per_plane) { TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); return(0); } /* Cs, Td, and Ta */ for (o=0; o<sp->samples_per_pixel_per_plane; o++) { /* Cs */ if (OJPEGReadByte(sp,&n)==0) return(0); sp->sos_cs[sp->plane_sample_offset+o]=n; /* Td and Ta */ if (OJPEGReadByte(sp,&n)==0) return(0); sp->sos_tda[sp->plane_sample_offset+o]=n; } /* skip Ss, Se, Ah, en Al -> no check, as per Tom Lane recommendation, as per LibJpeg source */ OJPEGReadSkip(sp,3); return(1); }
OJPEGReadHeaderInfoSecStreamSos(TIFF* tif) { /* this marker needs to be checked, and part of its data needs to be saved for regeneration later on */ static const char module[]="OJPEGReadHeaderInfoSecStreamSos"; OJPEGState* sp=(OJPEGState*)tif->tif_data; uint16 m; uint8 n; uint8 o; assert(sp->subsamplingcorrect==0); if (sp->sof_log==0) { TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); return(0); } /* Ls */ if (OJPEGReadWord(sp,&m)==0) return(0); if (m!=6+sp->samples_per_pixel_per_plane*2) { TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); return(0); } /* Ns */ if (OJPEGReadByte(sp,&n)==0) return(0); if (n!=sp->samples_per_pixel_per_plane) { TIFFErrorExt(tif->tif_clientdata,module,"Corrupt SOS marker in JPEG data"); return(0); } /* Cs, Td, and Ta */ for (o=0; o<sp->samples_per_pixel_per_plane; o++) { /* Cs */ if (OJPEGReadByte(sp,&n)==0) return(0); sp->sos_cs[sp->plane_sample_offset+o]=n; /* Td and Ta */ if (OJPEGReadByte(sp,&n)==0) return(0); sp->sos_tda[sp->plane_sample_offset+o]=n; } /* skip Ss, Se, Ah, en Al -> no check, as per Tom Lane recommendation, as per LibJpeg source */ OJPEGReadSkip(sp,3); return(1); }
C
libtiff
0
CVE-2016-3751
https://www.cvedetails.com/cve/CVE-2016-3751/
null
https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca
9d4853418ab2f754c2b63e091c29c5529b8b86ca
DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
void usage() { fprintf (stderr, "PNM2PNG\n"); fprintf (stderr, " by Willem van Schaik, 1999\n"); #ifdef __TURBOC__ fprintf (stderr, " for Turbo-C and Borland-C compilers\n"); #else fprintf (stderr, " for Linux (and Unix) compilers\n"); #endif fprintf (stderr, "Usage: pnm2png [options] <file>.<pnm> [<file>.png]\n"); fprintf (stderr, " or: ... | pnm2png [options]\n"); fprintf (stderr, "Options:\n"); fprintf (stderr, " -i[nterlace] write png-file with interlacing on\n"); fprintf (stderr, " -a[lpha] <file>.pgm read PNG alpha channel as pgm-file\n"); fprintf (stderr, " -h | -? print this help-information\n"); }
void usage() { fprintf (stderr, "PNM2PNG\n"); fprintf (stderr, " by Willem van Schaik, 1999\n"); #ifdef __TURBOC__ fprintf (stderr, " for Turbo-C and Borland-C compilers\n"); #else fprintf (stderr, " for Linux (and Unix) compilers\n"); #endif fprintf (stderr, "Usage: pnm2png [options] <file>.<pnm> [<file>.png]\n"); fprintf (stderr, " or: ... | pnm2png [options]\n"); fprintf (stderr, "Options:\n"); fprintf (stderr, " -i[nterlace] write png-file with interlacing on\n"); fprintf (stderr, " -a[lpha] <file>.pgm read PNG alpha channel as pgm-file\n"); fprintf (stderr, " -h | -? print this help-information\n"); }
C
Android
1
CVE-2017-0812
https://www.cvedetails.com/cve/CVE-2017-0812/
CWE-125
https://android.googlesource.com/device/google/dragon/+/7df7ec13b1d222ac3a66797fbe432605ea8f973f
7df7ec13b1d222ac3a66797fbe432605ea8f973f
Fix audio record pre-processing proc_buf_out consistently initialized. intermediate scratch buffers consistently initialized. prevent read failure from overwriting memory. Test: POC, CTS, camera record Bug: 62873231 Change-Id: Ie26e12a419a5819c1c5c3a0bcf1876d6d7aca686 (cherry picked from commit 6d7b330c27efba944817e647955da48e54fd74eb)
static ssize_t read_bytes_from_dsp(struct stream_in *in, void* buffer, size_t bytes) { struct pcm_device *pcm_device; struct audio_device *adev = in->dev; pcm_device = node_to_item(list_head(&in->pcm_dev_list), struct pcm_device, stream_list_node); if (pcm_device->sound_trigger_handle > 0) return adev->sound_trigger_read_samples( pcm_device->sound_trigger_handle, buffer, bytes); else return 0; }
static ssize_t read_bytes_from_dsp(struct stream_in *in, void* buffer, size_t bytes) { struct pcm_device *pcm_device; struct audio_device *adev = in->dev; pcm_device = node_to_item(list_head(&in->pcm_dev_list), struct pcm_device, stream_list_node); if (pcm_device->sound_trigger_handle > 0) return adev->sound_trigger_read_samples( pcm_device->sound_trigger_handle, buffer, bytes); else return 0; }
C
Android
0
CVE-2019-3817
https://www.cvedetails.com/cve/CVE-2019-3817/
CWE-416
https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046
e3a5d056633677959ad924a51758876d415e7046
Fix UAF in comps_objmrtree_unite function The added field is not used at all in many places and it is probably the left-over of some copy-paste.
void comps_mrtree_data_destroy(COMPS_MRTreeData * rtd) { free(rtd->key); comps_hslist_destroy(&rtd->data); comps_hslist_destroy(&rtd->subnodes); free(rtd); }
void comps_mrtree_data_destroy(COMPS_MRTreeData * rtd) { free(rtd->key); comps_hslist_destroy(&rtd->data); comps_hslist_destroy(&rtd->subnodes); free(rtd); }
C
libcomps
0
CVE-2011-3106
https://www.cvedetails.com/cve/CVE-2011-3106/
CWE-119
https://github.com/chromium/chromium/commit/5385c44d9634d00b1cec2abf0fe7290d4205c7b0
5385c44d9634d00b1cec2abf0fe7290d4205c7b0
Inherits SupportsWeakPtr<T> instead of having WeakPtrFactory<T> This change refines r137676. BUG=122654 TEST=browser_test Review URL: https://chromiumcodereview.appspot.com/10332233 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139771 0039d316-1c4b-4281-b951-d872f2087c98
void ResourceDispatcherHostImpl::StartDeferredRequest(int child_id, int request_id) { GlobalRequestID global_id(child_id, request_id); PendingRequestList::iterator i = pending_requests_.find(global_id); if (i == pending_requests_.end()) { LOG(WARNING) << "Trying to resume a non-existent request (" << child_id << ", " << request_id << ")"; return; } StartRequest(i->second); }
void ResourceDispatcherHostImpl::StartDeferredRequest(int child_id, int request_id) { GlobalRequestID global_id(child_id, request_id); PendingRequestList::iterator i = pending_requests_.find(global_id); if (i == pending_requests_.end()) { LOG(WARNING) << "Trying to resume a non-existent request (" << child_id << ", " << request_id << ")"; return; } StartRequest(i->second); }
C
Chrome
0
CVE-2013-6621
https://www.cvedetails.com/cve/CVE-2013-6621/
CWE-399
https://github.com/chromium/chromium/commit/4039d2fcaab746b6c20017ba9bb51c3a2403a76c
4039d2fcaab746b6c20017ba9bb51c3a2403a76c
Add logging to figure out which IPC we're failing to deserialize in RenderFrame. BUG=369553 [email protected] Review URL: https://codereview.chromium.org/263833020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268565 0039d316-1c4b-4281-b951-d872f2087c98
void RenderFrameImpl::PepperCancelComposition( PepperPluginInstanceImpl* instance) { if (instance != render_view_->focused_pepper_plugin()) return; Send(new ViewHostMsg_ImeCancelComposition(render_view_->GetRoutingID()));; #if defined(OS_MACOSX) || defined(USE_AURA) GetRenderWidget()->UpdateCompositionInfo(true); #endif }
void RenderFrameImpl::PepperCancelComposition( PepperPluginInstanceImpl* instance) { if (instance != render_view_->focused_pepper_plugin()) return; Send(new ViewHostMsg_ImeCancelComposition(render_view_->GetRoutingID()));; #if defined(OS_MACOSX) || defined(USE_AURA) GetRenderWidget()->UpdateCompositionInfo(true); #endif }
C
Chrome
0
CVE-2016-3074
https://www.cvedetails.com/cve/CVE-2016-3074/
CWE-189
https://github.com/libgd/libgd/commit/2bb97f407c1145c850416a3bfbcc8cf124e68a19
2bb97f407c1145c850416a3bfbcc8cf124e68a19
gd2: handle corrupt images better (CVE-2016-3074) Make sure we do some range checking on corrupted chunks. Thanks to Hans Jerry Illikainen <[email protected]> for indepth report and reproducer information. Made for easy test case writing :).
static void _noLibzError (void) { gd_error("GD2 support is not available - no libz\n"); }
static void _noLibzError (void) { gd_error("GD2 support is not available - no libz\n"); }
C
libgd
0
null
null
null
https://github.com/chromium/chromium/commit/3eb1f512d8646db3a70aaef108a8f5ad8b3f013d
3eb1f512d8646db3a70aaef108a8f5ad8b3f013d
2010-06-18 Adam Barth <[email protected]> Reviewed by Darin Adler. noAccess url schemes block access to inline stylesheets https://bugs.webkit.org/show_bug.cgi?id=32309 Test that data URLs can access their inline style sheets. * http/tests/security/data-url-inline.css-expected.txt: Added. * http/tests/security/data-url-inline.css.html: Added. 2010-06-18 Adam Barth <[email protected]> Reviewed by Darin Adler. noAccess url schemes block access to inline stylesheets https://bugs.webkit.org/show_bug.cgi?id=32309 Instead of using baseURL() to grab the security context we should just use finalURL directly. When I wrote the original patch that added this security check, finalURL didn't exist yet. If finalURL is an empty URL, that means we generated the style sheet from text that didn't have a URL. It would be slightly safer to store a bit on CSSStyleSheet indicating whether it came from an inline style sheet, but I think this check is fairly accurate. Test: http/tests/security/data-url-inline.css.html * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::cssRules): git-svn-id: svn://svn.chromium.org/blink/trunk@61391 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void CSSStyleSheet::checkLoaded() { if (isLoading()) return; if (parent()) parent()->checkLoaded(); RefPtr<CSSStyleSheet> protector(this); m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; }
void CSSStyleSheet::checkLoaded() { if (isLoading()) return; if (parent()) parent()->checkLoaded(); RefPtr<CSSStyleSheet> protector(this); m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true; }
C
Chrome
0
CVE-2014-2739
https://www.cvedetails.com/cve/CVE-2014-2739/
CWE-20
https://github.com/torvalds/linux/commit/b2853fd6c2d0f383dbdf7427e263eb576a633867
b2853fd6c2d0f383dbdf7427e263eb576a633867
IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler The code that resolves the passive side source MAC within the rdma_cm connection request handler was both redundant and buggy, so remove it. It was redundant since later, when an RC QP is modified to RTR state, the resolution will take place in the ib_core module. It was buggy because this callback also deals with UD SIDR exchange, for which we incorrectly looked at the REQ member of the CM event and dereferenced a random value. Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures") Signed-off-by: Moni Shoua <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
static int cm_dreq_handler(struct cm_work *work) { struct cm_id_private *cm_id_priv; struct cm_dreq_msg *dreq_msg; struct ib_mad_send_buf *msg = NULL; int ret; dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad; cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, dreq_msg->local_comm_id); if (!cm_id_priv) { atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_DREQ_COUNTER]); cm_issue_drep(work->port, work->mad_recv_wc); return -EINVAL; } work->cm_event.private_data = &dreq_msg->private_data; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->local_qpn != cm_dreq_get_remote_qpn(dreq_msg)) goto unlock; switch (cm_id_priv->id.state) { case IB_CM_REP_SENT: case IB_CM_DREQ_SENT: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); break; case IB_CM_ESTABLISHED: if (cm_id_priv->id.lap_state == IB_CM_LAP_SENT || cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD) ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); break; case IB_CM_MRA_REP_RCVD: break; case IB_CM_TIMEWAIT: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_DREQ_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; cm_format_drep((struct cm_drep_msg *) msg->mad, cm_id_priv, cm_id_priv->private_data, cm_id_priv->private_data_len); spin_unlock_irq(&cm_id_priv->lock); if (ib_post_send_mad(msg, NULL)) cm_free_msg(msg); goto deref; case IB_CM_DREQ_RCVD: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_DREQ_COUNTER]); goto unlock; default: goto unlock; } cm_id_priv->id.state = IB_CM_DREQ_RCVD; cm_id_priv->tid = dreq_msg->hdr.tid; ret = atomic_inc_and_test(&cm_id_priv->work_count); if (!ret) list_add_tail(&work->list, &cm_id_priv->work_list); spin_unlock_irq(&cm_id_priv->lock); if (ret) cm_process_work(cm_id_priv, work); else cm_deref_id(cm_id_priv); return 0; unlock: spin_unlock_irq(&cm_id_priv->lock); deref: cm_deref_id(cm_id_priv); return -EINVAL; }
static int cm_dreq_handler(struct cm_work *work) { struct cm_id_private *cm_id_priv; struct cm_dreq_msg *dreq_msg; struct ib_mad_send_buf *msg = NULL; int ret; dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad; cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, dreq_msg->local_comm_id); if (!cm_id_priv) { atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_DREQ_COUNTER]); cm_issue_drep(work->port, work->mad_recv_wc); return -EINVAL; } work->cm_event.private_data = &dreq_msg->private_data; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->local_qpn != cm_dreq_get_remote_qpn(dreq_msg)) goto unlock; switch (cm_id_priv->id.state) { case IB_CM_REP_SENT: case IB_CM_DREQ_SENT: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); break; case IB_CM_ESTABLISHED: if (cm_id_priv->id.lap_state == IB_CM_LAP_SENT || cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD) ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); break; case IB_CM_MRA_REP_RCVD: break; case IB_CM_TIMEWAIT: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_DREQ_COUNTER]); if (cm_alloc_response_msg(work->port, work->mad_recv_wc, &msg)) goto unlock; cm_format_drep((struct cm_drep_msg *) msg->mad, cm_id_priv, cm_id_priv->private_data, cm_id_priv->private_data_len); spin_unlock_irq(&cm_id_priv->lock); if (ib_post_send_mad(msg, NULL)) cm_free_msg(msg); goto deref; case IB_CM_DREQ_RCVD: atomic_long_inc(&work->port->counter_group[CM_RECV_DUPLICATES]. counter[CM_DREQ_COUNTER]); goto unlock; default: goto unlock; } cm_id_priv->id.state = IB_CM_DREQ_RCVD; cm_id_priv->tid = dreq_msg->hdr.tid; ret = atomic_inc_and_test(&cm_id_priv->work_count); if (!ret) list_add_tail(&work->list, &cm_id_priv->work_list); spin_unlock_irq(&cm_id_priv->lock); if (ret) cm_process_work(cm_id_priv, work); else cm_deref_id(cm_id_priv); return 0; unlock: spin_unlock_irq(&cm_id_priv->lock); deref: cm_deref_id(cm_id_priv); return -EINVAL; }
C
linux
0
CVE-2017-15415
https://www.cvedetails.com/cve/CVE-2017-15415/
CWE-119
https://github.com/chromium/chromium/commit/dc5edc9c05901feeac616c075d0337e634f3a02a
dc5edc9c05901feeac616c075d0337e634f3a02a
Serialize struct tm in a safe way. BUG=765512 Change-Id: If235b8677eb527be2ac0fe621fc210e4116a7566 Reviewed-on: https://chromium-review.googlesource.com/679441 Commit-Queue: Chris Palmer <[email protected]> Reviewed-by: Julien Tinnes <[email protected]> Cr-Commit-Position: refs/heads/master@{#503948}
void SandboxIPCHandler::SetObserverForTests( SandboxIPCHandler::TestObserver* observer) { g_test_observer = observer; }
void SandboxIPCHandler::SetObserverForTests( SandboxIPCHandler::TestObserver* observer) { g_test_observer = observer; }
C
Chrome
0
CVE-2018-6140
https://www.cvedetails.com/cve/CVE-2018-6140/
CWE-20
https://github.com/chromium/chromium/commit/2aec794f26098c7a361c27d7c8f57119631cca8a
2aec794f26098c7a361c27d7c8f57119631cca8a
[DevTools] Do not allow chrome.debugger to attach to web ui pages If the page navigates to web ui, we force detach the debugger extension. [email protected] Bug: 798222 Change-Id: Idb46c2f59e839388397a8dfa6ce2e2a897698df3 Reviewed-on: https://chromium-review.googlesource.com/935961 Commit-Queue: Dmitry Gozman <[email protected]> Reviewed-by: Devlin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Nasko Oskov <[email protected]> Cr-Commit-Position: refs/heads/master@{#540916}
scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::Forward( const std::string& id, std::unique_ptr<DevToolsExternalAgentProxyDelegate> delegate) { scoped_refptr<DevToolsAgentHost> result = DevToolsAgentHost::GetForId(id); if (result) return result; return new ForwardingAgentHost(id, std::move(delegate)); }
scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::Forward( const std::string& id, std::unique_ptr<DevToolsExternalAgentProxyDelegate> delegate) { scoped_refptr<DevToolsAgentHost> result = DevToolsAgentHost::GetForId(id); if (result) return result; return new ForwardingAgentHost(id, std::move(delegate)); }
C
Chrome
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void Stop() { animation_.Stop(); }
void Stop() { animation_.Stop(); }
C
Chrome
0
CVE-2017-9501
https://www.cvedetails.com/cve/CVE-2017-9501/
CWE-617
https://github.com/ImageMagick/ImageMagick/commit/01843366d6a7b96e22ad7bb67f3df7d9fd4d5d74
01843366d6a7b96e22ad7bb67f3df7d9fd4d5d74
Fixed incorrect call to DestroyImage reported in #491.
MagickExport ImageInfo *DestroyImageInfo(ImageInfo *image_info) { assert(image_info != (ImageInfo *) NULL); assert(image_info->signature == MagickSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); if (image_info->size != (char *) NULL) image_info->size=DestroyString(image_info->size); if (image_info->extract != (char *) NULL) image_info->extract=DestroyString(image_info->extract); if (image_info->scenes != (char *) NULL) image_info->scenes=DestroyString(image_info->scenes); if (image_info->page != (char *) NULL) image_info->page=DestroyString(image_info->page); if (image_info->sampling_factor != (char *) NULL) image_info->sampling_factor=DestroyString( image_info->sampling_factor); if (image_info->server_name != (char *) NULL) image_info->server_name=DestroyString( image_info->server_name); if (image_info->font != (char *) NULL) image_info->font=DestroyString(image_info->font); if (image_info->texture != (char *) NULL) image_info->texture=DestroyString(image_info->texture); if (image_info->density != (char *) NULL) image_info->density=DestroyString(image_info->density); if (image_info->view != (char *) NULL) image_info->view=DestroyString(image_info->view); if (image_info->authenticate != (char *) NULL) image_info->authenticate=DestroyString( image_info->authenticate); DestroyImageOptions(image_info); if (image_info->cache != (void *) NULL) image_info->cache=DestroyPixelCache(image_info->cache); if (image_info->profile != (StringInfo *) NULL) image_info->profile=(void *) DestroyStringInfo((StringInfo *) image_info->profile); image_info->signature=(~MagickSignature); image_info=(ImageInfo *) RelinquishMagickMemory(image_info); return(image_info); }
MagickExport ImageInfo *DestroyImageInfo(ImageInfo *image_info) { assert(image_info != (ImageInfo *) NULL); assert(image_info->signature == MagickSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); if (image_info->size != (char *) NULL) image_info->size=DestroyString(image_info->size); if (image_info->extract != (char *) NULL) image_info->extract=DestroyString(image_info->extract); if (image_info->scenes != (char *) NULL) image_info->scenes=DestroyString(image_info->scenes); if (image_info->page != (char *) NULL) image_info->page=DestroyString(image_info->page); if (image_info->sampling_factor != (char *) NULL) image_info->sampling_factor=DestroyString( image_info->sampling_factor); if (image_info->server_name != (char *) NULL) image_info->server_name=DestroyString( image_info->server_name); if (image_info->font != (char *) NULL) image_info->font=DestroyString(image_info->font); if (image_info->texture != (char *) NULL) image_info->texture=DestroyString(image_info->texture); if (image_info->density != (char *) NULL) image_info->density=DestroyString(image_info->density); if (image_info->view != (char *) NULL) image_info->view=DestroyString(image_info->view); if (image_info->authenticate != (char *) NULL) image_info->authenticate=DestroyString( image_info->authenticate); DestroyImageOptions(image_info); if (image_info->cache != (void *) NULL) image_info->cache=DestroyPixelCache(image_info->cache); if (image_info->profile != (StringInfo *) NULL) image_info->profile=(void *) DestroyStringInfo((StringInfo *) image_info->profile); image_info->signature=(~MagickSignature); image_info=(ImageInfo *) RelinquishMagickMemory(image_info); return(image_info); }
C
ImageMagick
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void TabStripGtk::StartInsertTabAnimation(int index) { available_width_for_tabs_ = -1; StopAnimation(); active_animation_.reset(new InsertTabAnimation(this, index)); active_animation_->Start(); }
void TabStripGtk::StartInsertTabAnimation(int index) { available_width_for_tabs_ = -1; StopAnimation(); active_animation_.reset(new InsertTabAnimation(this, index)); active_animation_->Start(); }
C
Chrome
0
CVE-2013-7455
https://www.cvedetails.com/cve/CVE-2013-7455/
null
https://github.com/mm2/Little-CMS/commit/fefaaa43c382eee632ea3ad0cfa915335140e1db
fefaaa43c382eee632ea3ad0cfa915335140e1db
Fix a double free on error recovering
void Temp2CHAD(cmsMAT3* Chad, cmsFloat64Number Temp) { cmsCIEXYZ White; cmsCIExyY ChromaticityOfWhite; cmsWhitePointFromTemp(&ChromaticityOfWhite, Temp); cmsxyY2XYZ(&White, &ChromaticityOfWhite); _cmsAdaptationMatrix(Chad, NULL, &White, cmsD50_XYZ()); }
void Temp2CHAD(cmsMAT3* Chad, cmsFloat64Number Temp) { cmsCIEXYZ White; cmsCIExyY ChromaticityOfWhite; cmsWhitePointFromTemp(&ChromaticityOfWhite, Temp); cmsxyY2XYZ(&White, &ChromaticityOfWhite); _cmsAdaptationMatrix(Chad, NULL, &White, cmsD50_XYZ()); }
C
Little-CMS
0
CVE-2015-1229
https://www.cvedetails.com/cve/CVE-2015-1229/
CWE-19
https://github.com/chromium/chromium/commit/7933c117fd16b192e70609c331641e9112af5e42
7933c117fd16b192e70609c331641e9112af5e42
Sanitize headers in Proxy Authentication Required responses BUG=431504 Review URL: https://codereview.chromium.org/769043003 Cr-Commit-Position: refs/heads/master@{#310014}
bool HttpProxyClientSocket::WasEverUsed() const { if (transport_.get() && transport_->socket()) { return transport_->socket()->WasEverUsed(); } NOTREACHED(); return false; }
bool HttpProxyClientSocket::WasEverUsed() const { if (transport_.get() && transport_->socket()) { return transport_->socket()->WasEverUsed(); } NOTREACHED(); return false; }
C
Chrome
0
CVE-2018-9511
https://www.cvedetails.com/cve/CVE-2018-9511/
CWE-909
https://android.googlesource.com/platform/system/netd/+/931418b16c7197ca2df34c2a5609e49791125abe
931418b16c7197ca2df34c2a5609e49791125abe
Set optlen for UDP-encap check in XfrmController When setting the socket owner for an encap socket XfrmController will first attempt to verify that the socket has the UDP-encap socket option set. When doing so it would pass in an uninitialized optlen parameter which could cause the call to not modify the option value if the optlen happened to be too short. So for example if the stack happened to contain a zero where optlen was located the check would fail and the socket owner would not be changed. Fix this by setting optlen to the size of the option value parameter. Test: run cts -m CtsNetTestCases BUG: 111650288 Change-Id: I57b6e9dba09c1acda71e3ec2084652e961667bd9 (cherry picked from commit fc42a105147310bd680952d4b71fe32974bd8506)
netdutils::Status XfrmController::allocateSpi(const XfrmSaInfo& record, uint32_t minSpi, uint32_t maxSpi, uint32_t* outSpi, const XfrmSocket& sock) { xfrm_userspi_info spiInfo{}; enum { NLMSG_HDR, USERSAID, USERSAID_PAD }; std::vector<iovec> iov = { {NULL, 0}, // reserved for the eventual addition of a NLMSG_HDR {&spiInfo, 0}, // main userspi_info struct {kPadBytes, 0}, // up to NLMSG_ALIGNTO pad bytes of padding }; int len; if (fillUserSaInfo(record, &spiInfo.info) == 0) { ALOGE("Failed to fill transport SA Info"); } len = iov[USERSAID].iov_len = sizeof(spiInfo); iov[USERSAID_PAD].iov_len = NLMSG_ALIGN(len) - len; RandomSpi spiGen = RandomSpi(minSpi, maxSpi); int spi; netdutils::Status ret; while ((spi = spiGen.next()) != INVALID_SPI) { spiInfo.min = spi; spiInfo.max = spi; ret = sock.sendMessage(XFRM_MSG_ALLOCSPI, NETLINK_REQUEST_FLAGS, 0, &iov); /* If the SPI is in use, we'll get ENOENT */ if (netdutils::equalToErrno(ret, ENOENT)) continue; if (isOk(ret)) { *outSpi = spi; ALOGD("Allocated an SPI: %x", *outSpi); } else { *outSpi = INVALID_SPI; ALOGE("SPI Allocation Failed with error %d", ret.code()); } return ret; } return ret; }
netdutils::Status XfrmController::allocateSpi(const XfrmSaInfo& record, uint32_t minSpi, uint32_t maxSpi, uint32_t* outSpi, const XfrmSocket& sock) { xfrm_userspi_info spiInfo{}; enum { NLMSG_HDR, USERSAID, USERSAID_PAD }; std::vector<iovec> iov = { {NULL, 0}, // reserved for the eventual addition of a NLMSG_HDR {&spiInfo, 0}, // main userspi_info struct {kPadBytes, 0}, // up to NLMSG_ALIGNTO pad bytes of padding }; int len; if (fillUserSaInfo(record, &spiInfo.info) == 0) { ALOGE("Failed to fill transport SA Info"); } len = iov[USERSAID].iov_len = sizeof(spiInfo); iov[USERSAID_PAD].iov_len = NLMSG_ALIGN(len) - len; RandomSpi spiGen = RandomSpi(minSpi, maxSpi); int spi; netdutils::Status ret; while ((spi = spiGen.next()) != INVALID_SPI) { spiInfo.min = spi; spiInfo.max = spi; ret = sock.sendMessage(XFRM_MSG_ALLOCSPI, NETLINK_REQUEST_FLAGS, 0, &iov); /* If the SPI is in use, we'll get ENOENT */ if (netdutils::equalToErrno(ret, ENOENT)) continue; if (isOk(ret)) { *outSpi = spi; ALOGD("Allocated an SPI: %x", *outSpi); } else { *outSpi = INVALID_SPI; ALOGE("SPI Allocation Failed with error %d", ret.code()); } return ret; } return ret; }
C
Android
0
CVE-2013-4540
https://www.cvedetails.com/cve/CVE-2013-4540/
CWE-119
https://git.qemu.org/?p=qemu.git;a=commit;h=52f91c3723932f8340fe36c8ec8b18a757c37b2b
52f91c3723932f8340fe36c8ec8b18a757c37b2b
null
static void scoop_register_types(void) { type_register_static(&scoop_sysbus_info); }
static void scoop_register_types(void) { type_register_static(&scoop_sysbus_info); }
C
qemu
0
CVE-2018-1000040
https://www.cvedetails.com/cve/CVE-2018-1000040/
CWE-20
http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=83d4dae44c71816c084a635550acc1a51529b881;hp=f597300439e62f5e921f0d7b1e880b5c1a1f1607
83d4dae44c71816c084a635550acc1a51529b881
null
std_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv) { float rgb[3]; int i; const fz_colorspace *srcs = cc->ss; const fz_colorspace *dsts = cc->ds; if (srcs == NULL) srcs = fz_device_rgb(ctx); if (dsts == NULL) dsts = fz_device_rgb(ctx); if (srcs != dsts) { assert(srcs->to_ccs && dsts->from_ccs); srcs->to_ccs(ctx, srcs, srcv, rgb); dsts->from_ccs(ctx, dsts, rgb, dstv); for (i = 0; i < dsts->n; i++) dstv[i] = fz_clamp(dstv[i], 0, 1); } else { for (i = 0; i < srcs->n; i++) dstv[i] = srcv[i]; } }
std_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv) { float rgb[3]; int i; const fz_colorspace *srcs = cc->ss; const fz_colorspace *dsts = cc->ds; if (srcs == NULL) srcs = fz_device_rgb(ctx); if (dsts == NULL) dsts = fz_device_rgb(ctx); if (srcs != dsts) { assert(srcs->to_ccs && dsts->from_ccs); srcs->to_ccs(ctx, srcs, srcv, rgb); dsts->from_ccs(ctx, dsts, rgb, dstv); for (i = 0; i < dsts->n; i++) dstv[i] = fz_clamp(dstv[i], 0, 1); } else { for (i = 0; i < srcs->n; i++) dstv[i] = srcv[i]; } }
C
ghostscript
0
CVE-2013-2856
https://www.cvedetails.com/cve/CVE-2013-2856/
CWE-416
https://github.com/chromium/chromium/commit/e68fafe04d29810cebe8d25554863b0cae4c1356
e68fafe04d29810cebe8d25554863b0cae4c1356
Map posix error codes in bind better, and fix one windows mapping. r=wtc BUG=330233 Review URL: https://codereview.chromium.org/101193008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242224 0039d316-1c4b-4281-b951-d872f2087c98
int UDPSocketWin::Bind(const IPEndPoint& address) { DCHECK(!is_connected()); int rv = CreateSocket(address.GetSockAddrFamily()); if (rv < 0) return rv; rv = SetSocketOptions(); if (rv < 0) { Close(); return rv; } rv = DoBind(address); if (rv < 0) { Close(); return rv; } local_address_.reset(); return rv; }
int UDPSocketWin::Bind(const IPEndPoint& address) { DCHECK(!is_connected()); int rv = CreateSocket(address.GetSockAddrFamily()); if (rv < 0) return rv; rv = SetSocketOptions(); if (rv < 0) { Close(); return rv; } rv = DoBind(address); if (rv < 0) { Close(); return rv; } local_address_.reset(); return rv; }
C
Chrome
0
CVE-2018-6088
https://www.cvedetails.com/cve/CVE-2018-6088/
CWE-20
https://github.com/chromium/chromium/commit/94b3728a2836da335a10085d4089c9d8e1c9d225
94b3728a2836da335a10085d4089c9d8e1c9d225
Copy visible_pages_ when iterating over it. On this case, a call inside the loop may cause visible_pages_ to change. Bug: 822091 Change-Id: I41b0715faa6fe3e39203cd9142cf5ea38e59aefb Reviewed-on: https://chromium-review.googlesource.com/964592 Reviewed-by: dsinclair <[email protected]> Commit-Queue: Henrique Nakashima <[email protected]> Cr-Commit-Position: refs/heads/master@{#543494}
bool PDFiumEngine::IsPointInEditableFormTextArea(FPDF_PAGE page, double page_x, double page_y, int form_type) { #if defined(PDF_ENABLE_XFA) if (IS_XFA_FORMFIELD(form_type)) return form_type == FPDF_FORMFIELD_XFA_TEXTFIELD || form_type == FPDF_FORMFIELD_XFA_COMBOBOX; #endif // defined(PDF_ENABLE_XFA) FPDF_ANNOTATION annot = FPDFAnnot_GetFormFieldAtPoint(form_, page, page_x, page_y); if (!annot) return false; int flags = FPDFAnnot_GetFormFieldFlags(page, annot); bool is_editable_form_text_area = CheckIfEditableFormTextArea(flags, form_type); FPDFPage_CloseAnnot(annot); return is_editable_form_text_area; }
bool PDFiumEngine::IsPointInEditableFormTextArea(FPDF_PAGE page, double page_x, double page_y, int form_type) { #if defined(PDF_ENABLE_XFA) if (IS_XFA_FORMFIELD(form_type)) return form_type == FPDF_FORMFIELD_XFA_TEXTFIELD || form_type == FPDF_FORMFIELD_XFA_COMBOBOX; #endif // defined(PDF_ENABLE_XFA) FPDF_ANNOTATION annot = FPDFAnnot_GetFormFieldAtPoint(form_, page, page_x, page_y); if (!annot) return false; int flags = FPDFAnnot_GetFormFieldFlags(page, annot); bool is_editable_form_text_area = CheckIfEditableFormTextArea(flags, form_type); FPDFPage_CloseAnnot(annot); return is_editable_form_text_area; }
C
Chrome
0
CVE-2016-10030
https://www.cvedetails.com/cve/CVE-2016-10030/
CWE-284
https://github.com/SchedMD/slurm/commit/92362a92fffe60187df61f99ab11c249d44120ee
92362a92fffe60187df61f99ab11c249d44120ee
Fix security issue in _prolog_error(). Fix security issue caused by insecure file path handling triggered by the failure of a Prolog script. To exploit this a user needs to anticipate or cause the Prolog to fail for their job. (This commit is slightly different from the fix to the 15.08 branch.) CVE-2016-10030.
_rpc_terminate_tasks(slurm_msg_t *msg) { kill_tasks_msg_t *req = (kill_tasks_msg_t *) msg->data; int rc = SLURM_SUCCESS; int fd; uid_t req_uid, uid; uint16_t protocol_version; debug3("Entering _rpc_terminate_tasks"); fd = stepd_connect(conf->spooldir, conf->node_name, req->job_id, req->job_step_id, &protocol_version); if (fd == -1) { debug("kill for nonexistent job %u.%u stepd_connect " "failed: %m", req->job_id, req->job_step_id); rc = ESLURM_INVALID_JOB_ID; goto done; } if ((int)(uid = stepd_get_uid(fd, protocol_version)) < 0) { debug("terminate_tasks couldn't read from the step %u.%u: %m", req->job_id, req->job_step_id); rc = ESLURM_INVALID_JOB_ID; goto done2; } req_uid = g_slurm_auth_get_uid(msg->auth_cred, conf->auth_info); if ((req_uid != uid) && (!_slurm_authorized_user(req_uid))) { debug("kill req from uid %ld for job %u.%u owned by uid %ld", (long) req_uid, req->job_id, req->job_step_id, (long) uid); rc = ESLURM_USER_ID_MISSING; /* or bad in this case */ goto done2; } rc = stepd_terminate(fd, protocol_version); if (rc == -1) rc = ESLURMD_JOB_NOTRUNNING; done2: close(fd); done: slurm_send_rc_msg(msg, rc); }
_rpc_terminate_tasks(slurm_msg_t *msg) { kill_tasks_msg_t *req = (kill_tasks_msg_t *) msg->data; int rc = SLURM_SUCCESS; int fd; uid_t req_uid, uid; uint16_t protocol_version; debug3("Entering _rpc_terminate_tasks"); fd = stepd_connect(conf->spooldir, conf->node_name, req->job_id, req->job_step_id, &protocol_version); if (fd == -1) { debug("kill for nonexistent job %u.%u stepd_connect " "failed: %m", req->job_id, req->job_step_id); rc = ESLURM_INVALID_JOB_ID; goto done; } if ((int)(uid = stepd_get_uid(fd, protocol_version)) < 0) { debug("terminate_tasks couldn't read from the step %u.%u: %m", req->job_id, req->job_step_id); rc = ESLURM_INVALID_JOB_ID; goto done2; } req_uid = g_slurm_auth_get_uid(msg->auth_cred, conf->auth_info); if ((req_uid != uid) && (!_slurm_authorized_user(req_uid))) { debug("kill req from uid %ld for job %u.%u owned by uid %ld", (long) req_uid, req->job_id, req->job_step_id, (long) uid); rc = ESLURM_USER_ID_MISSING; /* or bad in this case */ goto done2; } rc = stepd_terminate(fd, protocol_version); if (rc == -1) rc = ESLURMD_JOB_NOTRUNNING; done2: close(fd); done: slurm_send_rc_msg(msg, rc); }
C
slurm
0
CVE-2018-9491
https://www.cvedetails.com/cve/CVE-2018-9491/
CWE-190
https://android.googlesource.com/platform/frameworks/av/+/2b4667baa5a2badbdfec1794156ee17d4afef37c
2b4667baa5a2badbdfec1794156ee17d4afef37c
Check for overflow of crypto size Bug: 111603051 Test: CTS Change-Id: Ib5b1802b9b35769a25c16e2b977308cf7a810606 (cherry picked from commit d1fd02761236b35a336434367131f71bef7405c9)
virtual ~AMediaCodecPersistentSurface() { }
virtual ~AMediaCodecPersistentSurface() { }
C
Android
0
CVE-2013-2878
https://www.cvedetails.com/cve/CVE-2013-2878/
CWE-119
https://github.com/chromium/chromium/commit/09fbb829eab7ee25e90bb4e9c2f4973c6c62d0f3
09fbb829eab7ee25e90bb4e9c2f4973c6c62d0f3
Upgrade a TextIterator ASSERT to a RELEASE_ASSERT as a defensive measure. BUG=156930,177197 [email protected] Review URL: https://codereview.chromium.org/15057010 git-svn-id: svn://svn.chromium.org/blink/trunk@150123 bbb929c8-8fbe-4397-9dbb-9b2b20218538
WordAwareIterator::WordAwareIterator(const Range* r) : m_previousText(0) , m_didLookAhead(true) // so we consider the first chunk from the text iterator , m_textIterator(r) { advance(); // get in position over the first chunk of text }
WordAwareIterator::WordAwareIterator(const Range* r) : m_previousText(0) , m_didLookAhead(true) // so we consider the first chunk from the text iterator , m_textIterator(r) { advance(); // get in position over the first chunk of text }
C
Chrome
0
CVE-2015-3412
https://www.cvedetails.com/cve/CVE-2015-3412/
CWE-254
https://git.php.net/?p=php-src.git;a=commit;h=4435b9142ff9813845d5c97ab29a5d637bedb257
4435b9142ff9813845d5c97ab29a5d637bedb257
null
static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, int into_object) { zval *result, *zrow = NULL; PGresult *pgsql_result; pgsql_result_handle *pg_result; int i, num_fields, pgsql_row, use_row; long row = -1; char *field_name; zval *ctor_params = NULL; zend_class_entry *ce = NULL; if (into_object) { char *class_name = NULL; int class_name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!sz", &result, &zrow, &class_name, &class_name_len, &ctor_params) == FAILURE) { return; } if (!class_name) { ce = zend_standard_class_def; } else { ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); } if (!ce) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name); return; } result_type = PGSQL_ASSOC; } else { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!l", &result, &zrow, &result_type) == FAILURE) { return; } } if (zrow == NULL) { row = -1; } else { convert_to_long(zrow); row = Z_LVAL_P(zrow); if (row < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The row parameter must be greater or equal to zero"); RETURN_FALSE; } } use_row = ZEND_NUM_ARGS() > 1 && row != -1; if (!(result_type & PGSQL_BOTH)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_result->result; if (use_row) { pgsql_row = row; pg_result->row = pgsql_row; if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on PostgreSQL result index %ld", row, Z_LVAL_P(result)); RETURN_FALSE; } } else { /* If 2nd param is NULL, use internal row counter to access next row */ pgsql_row = pg_result->row; if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { RETURN_FALSE; } pg_result->row++; } array_init(return_value); for (i = 0, num_fields = PQnfields(pgsql_result); i < num_fields; i++) { if (PQgetisnull(pgsql_result, pgsql_row, i)) { if (result_type & PGSQL_NUM) { add_index_null(return_value, i); } if (result_type & PGSQL_ASSOC) { field_name = PQfname(pgsql_result, i); add_assoc_null(return_value, field_name); } } else { char *element = PQgetvalue(pgsql_result, pgsql_row, i); if (element) { char *data; int data_len; int should_copy=0; const uint element_len = strlen(element); data = safe_estrndup(element, element_len); data_len = element_len; if (result_type & PGSQL_NUM) { add_index_stringl(return_value, i, data, data_len, should_copy); should_copy=1; } if (result_type & PGSQL_ASSOC) { field_name = PQfname(pgsql_result, i); add_assoc_stringl(return_value, field_name, data, data_len, should_copy); } } } } if (into_object) { zval dataset = *return_value; zend_fcall_info fci; zend_fcall_info_cache fcc; zval *retval_ptr; object_and_properties_init(return_value, ce, NULL); zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC); if (ce->constructor) { fci.size = sizeof(fci); fci.function_table = &ce->function_table; fci.function_name = NULL; fci.symbol_table = NULL; fci.object_ptr = return_value; fci.retval_ptr_ptr = &retval_ptr; if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { if (Z_TYPE_P(ctor_params) == IS_ARRAY) { HashTable *ht = Z_ARRVAL_P(ctor_params); Bucket *p; fci.param_count = 0; fci.params = safe_emalloc(sizeof(zval***), ht->nNumOfElements, 0); p = ht->pListHead; while (p != NULL) { fci.params[fci.param_count++] = (zval**)p->pData; p = p->pListNext; } } else { /* Two problems why we throw exceptions here: PHP is typeless * and hence passing one argument that's not an array could be * by mistake and the other way round is possible, too. The * single value is an array. Also we'd have to make that one * argument passed by reference. */ zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); return; } } else { fci.param_count = 0; fci.params = NULL; } fci.no_separation = 1; fcc.initialized = 1; fcc.function_handler = ce->constructor; fcc.calling_scope = EG(scope); fcc.called_scope = Z_OBJCE_P(return_value); fcc.object_ptr = return_value; if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); } else { if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } } if (fci.params) { efree(fci.params); } } else if (ctor_params) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); } } }
static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, int into_object) { zval *result, *zrow = NULL; PGresult *pgsql_result; pgsql_result_handle *pg_result; int i, num_fields, pgsql_row, use_row; long row = -1; char *field_name; zval *ctor_params = NULL; zend_class_entry *ce = NULL; if (into_object) { char *class_name = NULL; int class_name_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!sz", &result, &zrow, &class_name, &class_name_len, &ctor_params) == FAILURE) { return; } if (!class_name) { ce = zend_standard_class_def; } else { ce = zend_fetch_class(class_name, class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); } if (!ce) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not find class '%s'", class_name); return; } result_type = PGSQL_ASSOC; } else { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z!l", &result, &zrow, &result_type) == FAILURE) { return; } } if (zrow == NULL) { row = -1; } else { convert_to_long(zrow); row = Z_LVAL_P(zrow); if (row < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The row parameter must be greater or equal to zero"); RETURN_FALSE; } } use_row = ZEND_NUM_ARGS() > 1 && row != -1; if (!(result_type & PGSQL_BOTH)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid result type"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_result->result; if (use_row) { pgsql_row = row; pg_result->row = pgsql_row; if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %ld on PostgreSQL result index %ld", row, Z_LVAL_P(result)); RETURN_FALSE; } } else { /* If 2nd param is NULL, use internal row counter to access next row */ pgsql_row = pg_result->row; if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { RETURN_FALSE; } pg_result->row++; } array_init(return_value); for (i = 0, num_fields = PQnfields(pgsql_result); i < num_fields; i++) { if (PQgetisnull(pgsql_result, pgsql_row, i)) { if (result_type & PGSQL_NUM) { add_index_null(return_value, i); } if (result_type & PGSQL_ASSOC) { field_name = PQfname(pgsql_result, i); add_assoc_null(return_value, field_name); } } else { char *element = PQgetvalue(pgsql_result, pgsql_row, i); if (element) { char *data; int data_len; int should_copy=0; const uint element_len = strlen(element); data = safe_estrndup(element, element_len); data_len = element_len; if (result_type & PGSQL_NUM) { add_index_stringl(return_value, i, data, data_len, should_copy); should_copy=1; } if (result_type & PGSQL_ASSOC) { field_name = PQfname(pgsql_result, i); add_assoc_stringl(return_value, field_name, data, data_len, should_copy); } } } } if (into_object) { zval dataset = *return_value; zend_fcall_info fci; zend_fcall_info_cache fcc; zval *retval_ptr; object_and_properties_init(return_value, ce, NULL); zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC); if (ce->constructor) { fci.size = sizeof(fci); fci.function_table = &ce->function_table; fci.function_name = NULL; fci.symbol_table = NULL; fci.object_ptr = return_value; fci.retval_ptr_ptr = &retval_ptr; if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) { if (Z_TYPE_P(ctor_params) == IS_ARRAY) { HashTable *ht = Z_ARRVAL_P(ctor_params); Bucket *p; fci.param_count = 0; fci.params = safe_emalloc(sizeof(zval***), ht->nNumOfElements, 0); p = ht->pListHead; while (p != NULL) { fci.params[fci.param_count++] = (zval**)p->pData; p = p->pListNext; } } else { /* Two problems why we throw exceptions here: PHP is typeless * and hence passing one argument that's not an array could be * by mistake and the other way round is possible, too. The * single value is an array. Also we'd have to make that one * argument passed by reference. */ zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Parameter ctor_params must be an array", 0 TSRMLS_CC); return; } } else { fci.param_count = 0; fci.params = NULL; } fci.no_separation = 1; fcc.initialized = 1; fcc.function_handler = ce->constructor; fcc.calling_scope = EG(scope); fcc.called_scope = Z_OBJCE_P(return_value); fcc.object_ptr = return_value; if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); } else { if (retval_ptr) { zval_ptr_dtor(&retval_ptr); } } if (fci.params) { efree(fci.params); } } else if (ctor_params) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name); } } }
C
php
0
null
null
null
https://github.com/chromium/chromium/commit/bfa69d49b17f33635c79f79819b90a8d2089c4b3
bfa69d49b17f33635c79f79819b90a8d2089c4b3
Change notification cmd line enabling to use the new RuntimeEnabledFeatures code. BUG=25318 TEST=none Review URL: http://codereview.chromium.org/339093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30660 0039d316-1c4b-4281-b951-d872f2087c98
void RenderThread::OnSetExtensionFunctionNames( const std::vector<std::string>& names) { ExtensionProcessBindings::SetFunctionNames(names); }
void RenderThread::OnSetExtensionFunctionNames( const std::vector<std::string>& names) { ExtensionProcessBindings::SetFunctionNames(names); }
C
Chrome
0
CVE-2016-2324
https://www.cvedetails.com/cve/CVE-2016-2324/
CWE-119
https://github.com/git/git/commit/de1e67d0703894cb6ea782e36abb63976ab07e60
de1e67d0703894cb6ea782e36abb63976ab07e60
list-objects: pass full pathname to callbacks When we find a blob at "a/b/c", we currently pass this to our show_object_fn callbacks as two components: "a/b/" and "c". Callbacks which want the full value then call path_name(), which concatenates the two. But this is an inefficient interface; the path is a strbuf, and we could simply append "c" to it temporarily, then roll back the length, without creating a new copy. So we could improve this by teaching the callsites of path_name() this trick (and there are only 3). But we can also notice that no callback actually cares about the broken-down representation, and simply pass each callback the full path "a/b/c" as a string. The callback code becomes even simpler, then, as we do not have to worry about freeing an allocated buffer, nor rolling back our modification to the strbuf. This is theoretically less efficient, as some callbacks would not bother to format the final path component. But in practice this is not measurable. Since we use the same strbuf over and over, our work to grow it is amortized, and we really only pay to memcpy a few bytes. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
static unsigned long do_compress(void **pptr, unsigned long size) { git_zstream stream; void *in, *out; unsigned long maxsize; git_deflate_init(&stream, pack_compression_level); maxsize = git_deflate_bound(&stream, size); in = *pptr; out = xmalloc(maxsize); *pptr = out; stream.next_in = in; stream.avail_in = size; stream.next_out = out; stream.avail_out = maxsize; while (git_deflate(&stream, Z_FINISH) == Z_OK) ; /* nothing */ git_deflate_end(&stream); free(in); return stream.total_out; }
static unsigned long do_compress(void **pptr, unsigned long size) { git_zstream stream; void *in, *out; unsigned long maxsize; git_deflate_init(&stream, pack_compression_level); maxsize = git_deflate_bound(&stream, size); in = *pptr; out = xmalloc(maxsize); *pptr = out; stream.next_in = in; stream.avail_in = size; stream.next_out = out; stream.avail_out = maxsize; while (git_deflate(&stream, Z_FINISH) == Z_OK) ; /* nothing */ git_deflate_end(&stream); free(in); return stream.total_out; }
C
git
0
CVE-2016-5767
https://www.cvedetails.com/cve/CVE-2016-5767/
CWE-190
https://github.com/php/php-src/commit/c395c6e5d7e8df37a21265ff76e48fe75ceb5ae6?w=1
c395c6e5d7e8df37a21265ff76e48fe75ceb5ae6?w=1
iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
int gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a) { int i; if (im->trueColor) { return gdTrueColorAlpha(r, g, b, a); } for (i = 0; i < im->colorsTotal; i++) { if (im->open[i]) { continue; } if ((im->red[i] == r) && (im->green[i] == g) && (im->blue[i] == b) && (im->alpha[i] == a)) { return i; } } return -1; }
int gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a) { int i; if (im->trueColor) { return gdTrueColorAlpha(r, g, b, a); } for (i = 0; i < im->colorsTotal; i++) { if (im->open[i]) { continue; } if ((im->red[i] == r) && (im->green[i] == g) && (im->blue[i] == b) && (im->alpha[i] == a)) { return i; } } return -1; }
C
php-src
0
null
null
null
https://github.com/chromium/chromium/commit/f85716d839636e0814d3309ce1d8f8a2cd1fb9a8
f85716d839636e0814d3309ce1d8f8a2cd1fb9a8
[LayoutNG] Take overflow into account when column-balancing. I didn't check why one test started to pass (it's not a very interesting test for overflow). Bug: 829028 Change-Id: I2c2d5fe3ea8c6a87f00df47f81d4158936d8a1bd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1742162 Reviewed-by: Ian Kilpatrick <[email protected]> Commit-Queue: Morten Stenshorne <[email protected]> Cr-Commit-Position: refs/heads/master@{#685349}
String DumpFragmentTree(const NGPhysicalBoxFragment* fragment) { NGPhysicalFragment::DumpFlags flags = NGPhysicalFragment::DumpHeaderText | NGPhysicalFragment::DumpSubtree | NGPhysicalFragment::DumpIndentation | NGPhysicalFragment::DumpOffset | NGPhysicalFragment::DumpSize; return fragment->DumpFragmentTree(flags); }
String DumpFragmentTree(const NGPhysicalBoxFragment* fragment) { NGPhysicalFragment::DumpFlags flags = NGPhysicalFragment::DumpHeaderText | NGPhysicalFragment::DumpSubtree | NGPhysicalFragment::DumpIndentation | NGPhysicalFragment::DumpOffset | NGPhysicalFragment::DumpSize; return fragment->DumpFragmentTree(flags); }
C
Chrome
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
ChromePluginServiceFilter::GetOrRegisterProcess( int render_process_id) { return &plugin_details_[render_process_id]; }
ChromePluginServiceFilter::GetOrRegisterProcess( int render_process_id) { return &plugin_details_[render_process_id]; }
C
Chrome
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; imp->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue); }
static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; imp->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue); }
C
Chrome
0
CVE-2016-2464
https://www.cvedetails.com/cve/CVE-2016-2464/
CWE-20
https://android.googlesource.com/platform/external/libvpx/+/cc274e2abe8b2a6698a5c47d8aa4bb45f1f9538d
cc274e2abe8b2a6698a5c47d8aa4bb45f1f9538d
external/libvpx/libwebm: Update snapshot Update libwebm snapshot. This update contains security fixes from upstream. Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b BUG=23167726 Change-Id: Id3e140e7b31ae11294724b1ecfe2e9c83b4d4207 (cherry picked from commit d0281a15b3c6bd91756e453cc9398c5ef412d99a)
long long Cluster::GetFirstTime() const { const BlockEntry* pEntry; const long status = GetFirst(pEntry); if (status < 0) // error return status; if (pEntry == NULL) // empty cluster return GetTime(); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); return pBlock->GetTime(this); }
long long Cluster::GetFirstTime() const { const BlockEntry* pEntry; const long status = GetFirst(pEntry); if (status < 0) // error return status; if (pEntry == NULL) // empty cluster return GetTime(); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); return pBlock->GetTime(this); }
C
Android
0
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 [email protected] Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
PassRefPtr<FrameView> FrameView::create(LocalFrame* frame, const IntSize& initialSize) { RefPtr<FrameView> view = adoptRef(new FrameView(frame)); view->Widget::setFrameRect(IntRect(view->location(), initialSize)); view->setLayoutSizeInternal(initialSize); view->show(); return view.release(); }
PassRefPtr<FrameView> FrameView::create(LocalFrame* frame, const IntSize& initialSize) { RefPtr<FrameView> view = adoptRef(new FrameView(frame)); view->Widget::setFrameRect(IntRect(view->location(), initialSize)); view->setLayoutSizeInternal(initialSize); view->show(); return view.release(); }
C
Chrome
0
CVE-2016-5350
https://www.cvedetails.com/cve/CVE-2016-5350/
CWE-399
https://github.com/wireshark/wireshark/commit/b4d16b4495b732888e12baf5b8a7e9bf2665e22b
b4d16b4495b732888e12baf5b8a7e9bf2665e22b
SPOOLSS: Try to avoid an infinite loop. Use tvb_reported_length_remaining in dissect_spoolss_uint16uni. Make sure our offset always increments in dissect_spoolss_keybuffer. Change-Id: I7017c9685bb2fa27161d80a03b8fca4ef630e793 Reviewed-on: https://code.wireshark.org/review/14687 Reviewed-by: Gerald Combs <[email protected]> Petri-Dish: Gerald Combs <[email protected]> Tested-by: Petri Dish Buildbot <[email protected]> Reviewed-by: Michael Mann <[email protected]>
SpoolssEnumPrinterData_q(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep _U_) { guint32 ndx; proto_item *hidden_item; hidden_item = proto_tree_add_uint( tree, hf_printerdata, tvb, offset, 0, 1); PROTO_ITEM_SET_HIDDEN(hidden_item); /* Parse packet */ offset = dissect_nt_policy_hnd( tvb, offset, pinfo, tree, di, drep, hf_hnd, NULL, NULL, FALSE, FALSE); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, di, drep, hf_enumprinterdata_enumindex, &ndx); col_append_fstr(pinfo->cinfo, COL_INFO, ", index %d", ndx); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, di, drep, hf_enumprinterdata_value_offered, NULL); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, di, drep, hf_enumprinterdata_data_offered, NULL); return offset; }
SpoolssEnumPrinterData_q(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep _U_) { guint32 ndx; proto_item *hidden_item; hidden_item = proto_tree_add_uint( tree, hf_printerdata, tvb, offset, 0, 1); PROTO_ITEM_SET_HIDDEN(hidden_item); /* Parse packet */ offset = dissect_nt_policy_hnd( tvb, offset, pinfo, tree, di, drep, hf_hnd, NULL, NULL, FALSE, FALSE); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, di, drep, hf_enumprinterdata_enumindex, &ndx); col_append_fstr(pinfo->cinfo, COL_INFO, ", index %d", ndx); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, di, drep, hf_enumprinterdata_value_offered, NULL); offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, di, drep, hf_enumprinterdata_data_offered, NULL); return offset; }
C
wireshark
0
CVE-2018-6154
https://www.cvedetails.com/cve/CVE-2018-6154/
CWE-119
https://github.com/chromium/chromium/commit/98095c718d7580b5d6715e5bfd8698234ecb4470
98095c718d7580b5d6715e5bfd8698234ecb4470
Validate all incoming WebGLObjects. A few entry points were missing the correct validation. Tested with improved conformance tests in https://github.com/KhronosGroup/WebGL/pull/2654 . Bug: 848914 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: Ib98a61cc5bf378d1b3338b04acd7e1bc4c2fe008 Reviewed-on: https://chromium-review.googlesource.com/1086718 Reviewed-by: Kai Ninomiya <[email protected]> Reviewed-by: Antoine Labour <[email protected]> Commit-Queue: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#565016}
void WebGLRenderingContextBase::hint(GLenum target, GLenum mode) { if (isContextLost()) return; bool is_valid = false; switch (target) { case GL_GENERATE_MIPMAP_HINT: is_valid = true; break; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: // OES_standard_derivatives if (ExtensionEnabled(kOESStandardDerivativesName) || IsWebGL2OrHigher()) is_valid = true; break; } if (!is_valid) { SynthesizeGLError(GL_INVALID_ENUM, "hint", "invalid target"); return; } ContextGL()->Hint(target, mode); }
void WebGLRenderingContextBase::hint(GLenum target, GLenum mode) { if (isContextLost()) return; bool is_valid = false; switch (target) { case GL_GENERATE_MIPMAP_HINT: is_valid = true; break; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: // OES_standard_derivatives if (ExtensionEnabled(kOESStandardDerivativesName) || IsWebGL2OrHigher()) is_valid = true; break; } if (!is_valid) { SynthesizeGLError(GL_INVALID_ENUM, "hint", "invalid target"); return; } ContextGL()->Hint(target, mode); }
C
Chrome
0
CVE-2017-11522
https://www.cvedetails.com/cve/CVE-2017-11522/
CWE-476
https://github.com/ImageMagick/ImageMagick/commit/816ecab6c532ae086ff4186b3eaf4aa7092d536f
816ecab6c532ae086ff4186b3eaf4aa7092d536f
https://github.com/ImageMagick/ImageMagick/issues/58
static void read_tIME_chunk(Image *image,png_struct *ping,png_info *info, ExceptionInfo *exception) { png_timep time; if (png_get_tIME(ping,info,&time)) { char timestamp[21]; FormatLocaleString(timestamp,21,"%04d-%02d-%02dT%02d:%02d:%02dZ", time->year,time->month,time->day,time->hour,time->minute,time->second); SetImageProperty(image,"png:tIME",timestamp,exception); } }
static void read_tIME_chunk(Image *image,png_struct *ping,png_info *info, ExceptionInfo *exception) { png_timep time; if (png_get_tIME(ping,info,&time)) { char timestamp[21]; FormatLocaleString(timestamp,21,"%04d-%02d-%02dT%02d:%02d:%02dZ", time->year,time->month,time->day,time->hour,time->minute,time->second); SetImageProperty(image,"png:tIME",timestamp,exception); } }
C
ImageMagick
0
CVE-2017-12187
https://www.cvedetails.com/cve/CVE-2017-12187/
CWE-20
https://cgit.freedesktop.org/xorg/xserver/commit/?id=cad5a1050b7184d828aef9c1dd151c3ab649d37e
cad5a1050b7184d828aef9c1dd151c3ab649d37e
null
dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet) { XRenderPictFormat *pFormat; DMXScreenInfo *dmxScreen = &dmxScreens[idx]; dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); PictFormatPtr pFmt = glyphSet->format; int (*oldErrorHandler) (Display *, XErrorEvent *); pFormat = dmxFindFormat(dmxScreen, pFmt); if (!pFormat) { return BadMatch; } dmxGlyphLastError = 0; oldErrorHandler = XSetErrorHandler(dmxGlyphErrorHandler); /* Catch when this fails */ glyphPriv->glyphSets[idx] = XRenderCreateGlyphSet(dmxScreen->beDisplay, pFormat); XSetErrorHandler(oldErrorHandler); if (dmxGlyphLastError) { return dmxGlyphLastError; } return Success; }
dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet) { XRenderPictFormat *pFormat; DMXScreenInfo *dmxScreen = &dmxScreens[idx]; dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); PictFormatPtr pFmt = glyphSet->format; int (*oldErrorHandler) (Display *, XErrorEvent *); pFormat = dmxFindFormat(dmxScreen, pFmt); if (!pFormat) { return BadMatch; } dmxGlyphLastError = 0; oldErrorHandler = XSetErrorHandler(dmxGlyphErrorHandler); /* Catch when this fails */ glyphPriv->glyphSets[idx] = XRenderCreateGlyphSet(dmxScreen->beDisplay, pFormat); XSetErrorHandler(oldErrorHandler); if (dmxGlyphLastError) { return dmxGlyphLastError; } return Success; }
C
xserver
0
CVE-2012-5136
https://www.cvedetails.com/cve/CVE-2012-5136/
CWE-20
https://github.com/chromium/chromium/commit/401d30ef93030afbf7e81e53a11b68fc36194502
401d30ef93030afbf7e81e53a11b68fc36194502
Refactoring: Move m_mayDisplaySeamlesslyWithParent down to Document The member is used only in Document, thus no reason to stay in SecurityContext. TEST=none BUG=none [email protected], abarth, haraken, hayato Review URL: https://codereview.chromium.org/27615003 git-svn-id: svn://svn.chromium.org/blink/trunk@159829 bbb929c8-8fbe-4397-9dbb-9b2b20218538
EventQueue* Document::eventQueue() const { return m_eventQueue.get(); }
EventQueue* Document::eventQueue() const { return m_eventQueue.get(); }
C
Chrome
0
CVE-2017-9739
https://www.cvedetails.com/cve/CVE-2017-9739/
CWE-125
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=c501a58f8d5650c8ba21d447c0d6f07eafcb0f15
c501a58f8d5650c8ba21d447c0d6f07eafcb0f15
null
static void Ins_FDEF( INS_ARG ) { PDefRecord pRec; if ( BOUNDS( args[0], CUR.numFDefs ) ) { CUR.error = TT_Err_Invalid_Reference; return; } pRec = &CUR.FDefs[args[0]]; pRec->Range = CUR.curRange; pRec->Opc = (Byte)(args[0]); pRec->Start = CUR.IP + 1; pRec->Active = TRUE; skip_FDEF(EXEC_ARG); }
static void Ins_FDEF( INS_ARG ) { PDefRecord pRec; if ( BOUNDS( args[0], CUR.numFDefs ) ) { CUR.error = TT_Err_Invalid_Reference; return; } pRec = &CUR.FDefs[args[0]]; pRec->Range = CUR.curRange; pRec->Opc = (Byte)(args[0]); pRec->Start = CUR.IP + 1; pRec->Active = TRUE; skip_FDEF(EXEC_ARG); }
C
ghostscript
0
CVE-2017-9310
https://www.cvedetails.com/cve/CVE-2017-9310/
CWE-835
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=4154c7e03fa55b4cf52509a83d50d6c09d743b7
4154c7e03fa55b4cf52509a83d50d6c09d743b77
null
e1000e_core_write(E1000ECore *core, hwaddr addr, uint64_t val, unsigned size) { uint16_t index = e1000e_get_reg_index_with_offset(mac_reg_access, addr); if (index < E1000E_NWRITEOPS && e1000e_macreg_writeops[index]) { if (mac_reg_access[index] & MAC_ACCESS_PARTIAL) { trace_e1000e_wrn_regs_write_trivial(index << 2); } trace_e1000e_core_write(index << 2, size, val); e1000e_macreg_writeops[index](core, index, val); } else if (index < E1000E_NREADOPS && e1000e_macreg_readops[index]) { trace_e1000e_wrn_regs_write_ro(index << 2, size, val); } else { trace_e1000e_wrn_regs_write_unknown(index << 2, size, val); } }
e1000e_core_write(E1000ECore *core, hwaddr addr, uint64_t val, unsigned size) { uint16_t index = e1000e_get_reg_index_with_offset(mac_reg_access, addr); if (index < E1000E_NWRITEOPS && e1000e_macreg_writeops[index]) { if (mac_reg_access[index] & MAC_ACCESS_PARTIAL) { trace_e1000e_wrn_regs_write_trivial(index << 2); } trace_e1000e_core_write(index << 2, size, val); e1000e_macreg_writeops[index](core, index, val); } else if (index < E1000E_NREADOPS && e1000e_macreg_readops[index]) { trace_e1000e_wrn_regs_write_ro(index << 2, size, val); } else { trace_e1000e_wrn_regs_write_unknown(index << 2, size, val); } }
C
qemu
0
CVE-2011-2183
https://www.cvedetails.com/cve/CVE-2011-2183/
CWE-362
https://github.com/torvalds/linux/commit/2b472611a32a72f4a118c069c2d62a1a3f087afd
2b472611a32a72f4a118c069c2d62a1a3f087afd
ksm: fix NULL pointer dereference in scan_get_next_rmap_item() Andrea Righi reported a case where an exiting task can race against ksmd::scan_get_next_rmap_item (http://lkml.org/lkml/2011/6/1/742) easily triggering a NULL pointer dereference in ksmd. ksm_scan.mm_slot == &ksm_mm_head with only one registered mm CPU 1 (__ksm_exit) CPU 2 (scan_get_next_rmap_item) list_empty() is false lock slot == &ksm_mm_head list_del(slot->mm_list) (list now empty) unlock lock slot = list_entry(slot->mm_list.next) (list is empty, so slot is still ksm_mm_head) unlock slot->mm == NULL ... Oops Close this race by revalidating that the new slot is not simply the list head again. Andrea's test case: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #define BUFSIZE getpagesize() int main(int argc, char **argv) { void *ptr; if (posix_memalign(&ptr, getpagesize(), BUFSIZE) < 0) { perror("posix_memalign"); exit(1); } if (madvise(ptr, BUFSIZE, MADV_MERGEABLE) < 0) { perror("madvise"); exit(1); } *(char *)NULL = 0; return 0; } Reported-by: Andrea Righi <[email protected]> Tested-by: Andrea Righi <[email protected]> Cc: Andrea Arcangeli <[email protected]> Signed-off-by: Hugh Dickins <[email protected]> Signed-off-by: Chris Wright <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void insert_to_mm_slots_hash(struct mm_struct *mm, struct mm_slot *mm_slot) { struct hlist_head *bucket; bucket = &mm_slots_hash[hash_ptr(mm, MM_SLOTS_HASH_SHIFT)]; mm_slot->mm = mm; hlist_add_head(&mm_slot->link, bucket); }
static void insert_to_mm_slots_hash(struct mm_struct *mm, struct mm_slot *mm_slot) { struct hlist_head *bucket; bucket = &mm_slots_hash[hash_ptr(mm, MM_SLOTS_HASH_SHIFT)]; mm_slot->mm = mm; hlist_add_head(&mm_slot->link, bucket); }
C
linux
0
CVE-2017-9330
https://www.cvedetails.com/cve/CVE-2017-9330/
CWE-835
https://git.qemu.org/?p=qemu.git;a=commit;h=26f670a244982335cc08943fb1ec099a2c81e42d
26f670a244982335cc08943fb1ec099a2c81e42d
null
static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len) { bool print16 = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_SHORT); bool printall = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_FULL); const int width = 16; int i; char tmp[3 * width + 1]; char *p = tmp; if (!printall && !print16) { return; } for (i = 0; ; i++) { if (i && (!(i % width) || (i == len))) { if (!printall) { trace_usb_ohci_td_pkt_short(msg, tmp); break; } trace_usb_ohci_td_pkt_full(msg, tmp); p = tmp; *p = 0; } if (i == len) { break; } p += sprintf(p, " %.2x", buf[i]); } }
static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len) { bool print16 = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_SHORT); bool printall = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_FULL); const int width = 16; int i; char tmp[3 * width + 1]; char *p = tmp; if (!printall && !print16) { return; } for (i = 0; ; i++) { if (i && (!(i % width) || (i == len))) { if (!printall) { trace_usb_ohci_td_pkt_short(msg, tmp); break; } trace_usb_ohci_td_pkt_full(msg, tmp); p = tmp; *p = 0; } if (i == len) { break; } p += sprintf(p, " %.2x", buf[i]); } }
C
qemu
0
CVE-2013-0882
https://www.cvedetails.com/cve/CVE-2013-0882/
CWE-119
https://github.com/chromium/chromium/commit/25f9415f43d607d3d01f542f067e3cc471983e6b
25f9415f43d607d3d01f542f067e3cc471983e6b
Add HTMLFormControlElement::supportsAutofocus to fix a FIXME comment. This virtual function should return true if the form control can hanlde 'autofocucs' attribute if it is specified. Note: HTMLInputElement::supportsAutofocus reuses InputType::isInteractiveContent because interactiveness is required for autofocus capability. BUG=none TEST=none; no behavior changes. Review URL: https://codereview.chromium.org/143343003 git-svn-id: svn://svn.chromium.org/blink/trunk@165432 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void HTMLInputElement::updateType() { const AtomicString& newTypeName = InputType::normalizeTypeName(fastGetAttribute(typeAttr)); bool hadType = m_hasType; m_hasType = true; if (m_inputType->formControlType() == newTypeName) return; if (hadType && !InputType::canChangeFromAnotherType(newTypeName)) { setAttribute(typeAttr, type()); return; } RefPtr<InputType> newType = InputType::create(*this, newTypeName); removeFromRadioButtonGroup(); bool didStoreValue = m_inputType->storesValueSeparateFromAttribute(); bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttributes(); m_inputTypeView->destroyShadowSubtree(); lazyReattachIfAttached(); m_inputType = newType.release(); if (hasAuthorShadowRoot()) m_inputTypeView = InputTypeView::create(*this); else m_inputTypeView = m_inputType; m_inputTypeView->createShadowSubtree(); bool hasTouchEventHandler = m_inputTypeView->hasTouchEventHandler(); if (hasTouchEventHandler != m_hasTouchEventHandler) { if (hasTouchEventHandler) document().didAddTouchEventHandler(this); else document().didRemoveTouchEventHandler(this); m_hasTouchEventHandler = hasTouchEventHandler; } setNeedsWillValidateCheck(); bool willStoreValue = m_inputType->storesValueSeparateFromAttribute(); if (didStoreValue && !willStoreValue && hasDirtyValue()) { setAttribute(valueAttr, AtomicString(m_valueIfDirty)); m_valueIfDirty = String(); } if (!didStoreValue && willStoreValue) { AtomicString valueString = fastGetAttribute(valueAttr); m_valueIfDirty = sanitizeValue(valueString); } else updateValueIfNeeded(); setFormControlValueMatchesRenderer(false); m_inputTypeView->updateView(); if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttributes()) { ASSERT(elementData()); if (const Attribute* height = getAttributeItem(heightAttr)) attributeChanged(heightAttr, height->value()); if (const Attribute* width = getAttributeItem(widthAttr)) attributeChanged(widthAttr, width->value()); if (const Attribute* align = getAttributeItem(alignAttr)) attributeChanged(alignAttr, align->value()); } if (document().focusedElement() == this) document().updateFocusAppearanceSoon(true /* restore selection */); setChangedSinceLastFormControlChangeEvent(false); addToRadioButtonGroup(); setNeedsValidityCheck(); notifyFormStateChanged(); }
void HTMLInputElement::updateType() { const AtomicString& newTypeName = InputType::normalizeTypeName(fastGetAttribute(typeAttr)); bool hadType = m_hasType; m_hasType = true; if (m_inputType->formControlType() == newTypeName) return; if (hadType && !InputType::canChangeFromAnotherType(newTypeName)) { setAttribute(typeAttr, type()); return; } RefPtr<InputType> newType = InputType::create(*this, newTypeName); removeFromRadioButtonGroup(); bool didStoreValue = m_inputType->storesValueSeparateFromAttribute(); bool didRespectHeightAndWidth = m_inputType->shouldRespectHeightAndWidthAttributes(); m_inputTypeView->destroyShadowSubtree(); lazyReattachIfAttached(); m_inputType = newType.release(); if (hasAuthorShadowRoot()) m_inputTypeView = InputTypeView::create(*this); else m_inputTypeView = m_inputType; m_inputTypeView->createShadowSubtree(); bool hasTouchEventHandler = m_inputTypeView->hasTouchEventHandler(); if (hasTouchEventHandler != m_hasTouchEventHandler) { if (hasTouchEventHandler) document().didAddTouchEventHandler(this); else document().didRemoveTouchEventHandler(this); m_hasTouchEventHandler = hasTouchEventHandler; } setNeedsWillValidateCheck(); bool willStoreValue = m_inputType->storesValueSeparateFromAttribute(); if (didStoreValue && !willStoreValue && hasDirtyValue()) { setAttribute(valueAttr, AtomicString(m_valueIfDirty)); m_valueIfDirty = String(); } if (!didStoreValue && willStoreValue) { AtomicString valueString = fastGetAttribute(valueAttr); m_valueIfDirty = sanitizeValue(valueString); } else updateValueIfNeeded(); setFormControlValueMatchesRenderer(false); m_inputTypeView->updateView(); if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttributes()) { ASSERT(elementData()); if (const Attribute* height = getAttributeItem(heightAttr)) attributeChanged(heightAttr, height->value()); if (const Attribute* width = getAttributeItem(widthAttr)) attributeChanged(widthAttr, width->value()); if (const Attribute* align = getAttributeItem(alignAttr)) attributeChanged(alignAttr, align->value()); } if (document().focusedElement() == this) document().updateFocusAppearanceSoon(true /* restore selection */); setChangedSinceLastFormControlChangeEvent(false); addToRadioButtonGroup(); setNeedsValidityCheck(); notifyFormStateChanged(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/75f1a0ebf09d110642f19dd4e389004e949a7828
75f1a0ebf09d110642f19dd4e389004e949a7828
Web Animations: Temporary fix for performance regression in transition tests This patch adds a flag to Player::setStartTime to permit it to only call update() instead of serviceAnimations() (as per previous behaviour). We intend to in the near future replace the serviceAnimations calls with a deferred timing update system. Note that update() here is not correct in general as we may need to ask the timeline to request frame callbacks. BUG=340511 Review URL: https://codereview.chromium.org/155303002 git-svn-id: svn://svn.chromium.org/blink/trunk@166473 bbb929c8-8fbe-4397-9dbb-9b2b20218538
PassRefPtr<Player> Player::create(DocumentTimeline& timeline, TimedItem* content) { return adoptRef(new Player(timeline, content)); }
PassRefPtr<Player> Player::create(DocumentTimeline& timeline, TimedItem* content) { return adoptRef(new Player(timeline, content)); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/df831400bcb63db4259b5858281b1727ba972a2a
df831400bcb63db4259b5858281b1727ba972a2a
WebKit2: Support window bounce when panning. https://bugs.webkit.org/show_bug.cgi?id=58065 <rdar://problem/9244367> Reviewed by Adam Roben. Make gestureDidScroll synchronous, as once we scroll, we need to know whether or not we are at the beginning or end of the scrollable document. If we are at either end of the scrollable document, we call the Windows 7 API to bounce the window to give an indication that you are past an end of the document. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::gestureDidScroll): Pass a boolean for the reply, and return it. * UIProcess/WebPageProxy.h: * UIProcess/win/WebView.cpp: (WebKit::WebView::WebView): Inititalize a new variable. (WebKit::WebView::onGesture): Once we send the message to scroll, check if have gone to an end of the document, and if we have, bounce the window. * UIProcess/win/WebView.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: GestureDidScroll is now sync. * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::gestureDidScroll): When we are done scrolling, check if we have a vertical scrollbar and if we are at the beginning or the end of the scrollable document. git-svn-id: svn://svn.chromium.org/blink/trunk@83197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
IntSize WebPageProxy::viewSize() const { return m_pageClient->viewSize(); }
IntSize WebPageProxy::viewSize() const { return m_pageClient->viewSize(); }
C
Chrome
0
CVE-2014-6269
https://www.cvedetails.com/cve/CVE-2014-6269/
CWE-189
https://git.haproxy.org/?p=haproxy-1.5.git;a=commitdiff;h=b4d05093bc89f71377230228007e69a1434c1a0c
b4d05093bc89f71377230228007e69a1434c1a0c
null
smp_fetch_fhdr_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt, const struct arg *args, struct sample *smp, const char *kw) { struct http_txn *txn = l7; struct hdr_idx *idx = &txn->hdr_idx; struct hdr_ctx ctx; const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp; int cnt; if (!args || args->type != ARGT_STR) return 0; CHECK_HTTP_MESSAGE_FIRST(); ctx.idx = 0; cnt = 0; while (http_find_full_header2(args->data.str.str, args->data.str.len, msg->chn->buf->p, idx, &ctx)) cnt++; smp->type = SMP_T_UINT; smp->data.uint = cnt; smp->flags = SMP_F_VOL_HDR; return 1; }
smp_fetch_fhdr_cnt(struct proxy *px, struct session *l4, void *l7, unsigned int opt, const struct arg *args, struct sample *smp, const char *kw) { struct http_txn *txn = l7; struct hdr_idx *idx = &txn->hdr_idx; struct hdr_ctx ctx; const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp; int cnt; if (!args || args->type != ARGT_STR) return 0; CHECK_HTTP_MESSAGE_FIRST(); ctx.idx = 0; cnt = 0; while (http_find_full_header2(args->data.str.str, args->data.str.len, msg->chn->buf->p, idx, &ctx)) cnt++; smp->type = SMP_T_UINT; smp->data.uint = cnt; smp->flags = SMP_F_VOL_HDR; return 1; }
C
haproxy
0
null
null
null
https://github.com/chromium/chromium/commit/a0af50481db56aa780942e8595a20c36b2c34f5c
a0af50481db56aa780942e8595a20c36b2c34f5c
Build fix following bug #30696. Patch by Gavin Barraclough <[email protected]> on 2009-10-22 Reviewed by NOBODY (build fix). * WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::windowObjectCleared): * webkit/webkitwebframe.cpp: (webkit_web_frame_get_global_context): git-svn-id: svn://svn.chromium.org/blink/trunk@49964 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool FrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const { return item != 0; }
bool FrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const { return item != 0; }
C
Chrome
0
CVE-2016-1621
https://www.cvedetails.com/cve/CVE-2016-1621/
CWE-119
https://android.googlesource.com/platform/external/libvpx/+/04839626ed859623901ebd3a5fd483982186b59d
04839626ed859623901ebd3a5fd483982186b59d
libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b5510269852ae The diff is so huge because there were some style clean ups upstream. But it was ensured that there were no breaking changes when the style clean ups was done upstream. Change-Id: Ib6e907175484b4b0ae1b55ab39522ea3188ad039
void Chapters::Atom::Clear()
void Chapters::Atom::Clear() { delete[] m_string_uid; m_string_uid = NULL; while (m_displays_count > 0) { Display& d = m_displays[--m_displays_count]; d.Clear(); } delete[] m_displays; m_displays = NULL; m_displays_size = 0; }
C
Android
1
CVE-2016-2476
https://www.cvedetails.com/cve/CVE-2016-2476/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/0bb5ced60304da7f61478ffd359e7ba65d72f181
0bb5ced60304da7f61478ffd359e7ba65d72f181
Fix size check for OMX_IndexParamConsumerUsageBits since it doesn't follow the OMX convention. And remove support for the kClientNeedsFrameBuffer flag. Bug: 27207275 Change-Id: Ia2c119e2456ebf9e2f4e1de5104ef9032a212255
virtual status_t fillBuffer(node_id node, buffer_id buffer, int fenceFd) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); data.writeInt32((int32_t)buffer); data.writeInt32(fenceFd >= 0); if (fenceFd >= 0) { data.writeFileDescriptor(fenceFd, true /* takeOwnership */); } remote()->transact(FILL_BUFFER, data, &reply); return reply.readInt32(); }
virtual status_t fillBuffer(node_id node, buffer_id buffer, int fenceFd) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); data.writeInt32((int32_t)buffer); data.writeInt32(fenceFd >= 0); if (fenceFd >= 0) { data.writeFileDescriptor(fenceFd, true /* takeOwnership */); } remote()->transact(FILL_BUFFER, data, &reply); return reply.readInt32(); }
C
Android
0
CVE-2016-2419
https://www.cvedetails.com/cve/CVE-2016-2419/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/5a856f2092f7086aa0fea9ae06b9255befcdcd34
5a856f2092f7086aa0fea9ae06b9255befcdcd34
Fix info leak vulnerability of IDrm bug: 26323455 Change-Id: I25bb30d3666ab38d5150496375ed2f55ecb23ba8
virtual status_t getProvisionRequest(String8 const &certType, String8 const &certAuthority, Vector<uint8_t> &request, String8 &defaultUrl) { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); data.writeString8(certType); data.writeString8(certAuthority); status_t status = remote()->transact(GET_PROVISION_REQUEST, data, &reply); if (status != OK) { return status; } readVector(reply, request); defaultUrl = reply.readString8(); return reply.readInt32(); }
virtual status_t getProvisionRequest(String8 const &certType, String8 const &certAuthority, Vector<uint8_t> &request, String8 &defaultUrl) { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); data.writeString8(certType); data.writeString8(certAuthority); status_t status = remote()->transact(GET_PROVISION_REQUEST, data, &reply); if (status != OK) { return status; } readVector(reply, request); defaultUrl = reply.readString8(); return reply.readInt32(); }
C
Android
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); if (UNLIKELY(info.Length() <= 0)) { imp->methodWithOptionalString(); return; } V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); imp->methodWithOptionalString(str); }
static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); if (UNLIKELY(info.Length() <= 0)) { imp->methodWithOptionalString(); return; } V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); imp->methodWithOptionalString(str); }
C
Chrome
0
CVE-2013-2909
https://www.cvedetails.com/cve/CVE-2013-2909/
CWE-399
https://github.com/chromium/chromium/commit/248a92c21c20c14b5983680c50e1d8b73fc79a2f
248a92c21c20c14b5983680c50e1d8b73fc79a2f
Update containtingIsolate to go back all the way to top isolate from current root, rather than stopping at the first isolate it finds. This works because the current root is always updated with each isolate run. BUG=279277 Review URL: https://chromiumcodereview.appspot.com/23972003 git-svn-id: svn://svn.chromium.org/blink/trunk@157268 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static inline void constructBidiRunsForSegment(InlineBidiResolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& endOfRuns, VisualDirectionOverride override, bool previousLineBrokeCleanly) { ASSERT(&topResolver.runs() == &bidiRuns); ASSERT(topResolver.position() != endOfRuns); RenderObject* currentRoot = topResolver.position().root(); topResolver.createBidiRunsForLine(endOfRuns, override, previousLineBrokeCleanly); while (!topResolver.isolatedRuns().isEmpty()) { BidiRun* isolatedRun = topResolver.isolatedRuns().last(); topResolver.isolatedRuns().removeLast(); RenderObject* startObj = isolatedRun->object(); RenderInline* isolatedInline = toRenderInline(highestContainingIsolateWithinRoot(startObj, currentRoot)); ASSERT(isolatedInline); InlineBidiResolver isolatedResolver; EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi(); TextDirection direction = isolatedInline->style()->direction(); if (unicodeBidi == Plaintext) direction = determinePlaintextDirectionality(isolatedInline, startObj); else { ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride); direction = isolatedInline->style()->direction(); } isolatedResolver.setStatus(statusWithDirection(direction, isOverride(unicodeBidi))); setupResolverToResumeInIsolate(isolatedResolver, isolatedInline, startObj); InlineIterator iter = InlineIterator(isolatedInline, startObj, isolatedRun->m_start); isolatedResolver.setPositionIgnoringNestedIsolates(iter); isolatedResolver.createBidiRunsForLine(endOfRuns, NoVisualOverride, previousLineBrokeCleanly); if (isolatedResolver.runs().runCount()) bidiRuns.replaceRunWithRuns(isolatedRun, isolatedResolver.runs()); if (!isolatedResolver.isolatedRuns().isEmpty()) { topResolver.isolatedRuns().append(isolatedResolver.isolatedRuns()); isolatedResolver.isolatedRuns().clear(); currentRoot = isolatedInline; } } }
static inline void constructBidiRunsForSegment(InlineBidiResolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& endOfRuns, VisualDirectionOverride override, bool previousLineBrokeCleanly) { ASSERT(&topResolver.runs() == &bidiRuns); ASSERT(topResolver.position() != endOfRuns); RenderObject* currentRoot = topResolver.position().root(); topResolver.createBidiRunsForLine(endOfRuns, override, previousLineBrokeCleanly); while (!topResolver.isolatedRuns().isEmpty()) { BidiRun* isolatedRun = topResolver.isolatedRuns().last(); topResolver.isolatedRuns().removeLast(); RenderObject* startObj = isolatedRun->object(); RenderInline* isolatedInline = toRenderInline(containingIsolate(startObj, currentRoot)); InlineBidiResolver isolatedResolver; EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi(); TextDirection direction = isolatedInline->style()->direction(); if (unicodeBidi == Plaintext) direction = determinePlaintextDirectionality(isolatedInline, startObj); else { ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride); direction = isolatedInline->style()->direction(); } isolatedResolver.setStatus(statusWithDirection(direction, isOverride(unicodeBidi))); setupResolverToResumeInIsolate(isolatedResolver, isolatedInline, startObj); InlineIterator iter = InlineIterator(isolatedInline, startObj, isolatedRun->m_start); isolatedResolver.setPositionIgnoringNestedIsolates(iter); isolatedResolver.createBidiRunsForLine(endOfRuns, NoVisualOverride, previousLineBrokeCleanly); if (isolatedResolver.runs().runCount()) bidiRuns.replaceRunWithRuns(isolatedRun, isolatedResolver.runs()); if (!isolatedResolver.isolatedRuns().isEmpty()) { topResolver.isolatedRuns().append(isolatedResolver.isolatedRuns()); isolatedResolver.isolatedRuns().clear(); currentRoot = isolatedInline; } } }
C
Chrome
1
CVE-2019-13136
https://www.cvedetails.com/cve/CVE-2019-13136/
CWE-190
https://github.com/ImageMagick/ImageMagick/commit/fe5f4b85e6b1b54d3b4588a77133c06ade46d891
fe5f4b85e6b1b54d3b4588a77133c06ade46d891
https://github.com/ImageMagick/ImageMagick/issues/1602
static void InitPSDInfo(const Image *image,PSDInfo *info) { info->version=1; info->columns=image->columns; info->rows=image->rows; info->mode=10; /* Set the mode to a value that won't change the colorspace */ info->channels=1U; info->min_channels=1U; if (image->storage_class == PseudoClass) info->mode=2; /* indexed mode */ else { info->channels=(unsigned short) image->number_channels; info->min_channels=info->channels; if (image->alpha_trait == BlendPixelTrait) info->min_channels--; } }
static void InitPSDInfo(const Image *image,PSDInfo *info) { info->version=1; info->columns=image->columns; info->rows=image->rows; info->mode=10; /* Set the mode to a value that won't change the colorspace */ info->channels=1U; info->min_channels=1U; if (image->storage_class == PseudoClass) info->mode=2; /* indexed mode */ else { info->channels=(unsigned short) image->number_channels; info->min_channels=info->channels; if (image->alpha_trait == BlendPixelTrait) info->min_channels--; } }
C
ImageMagick
0
CVE-2017-5093
https://www.cvedetails.com/cve/CVE-2017-5093/
CWE-20
https://github.com/chromium/chromium/commit/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review-Url: https://codereview.chromium.org/2906133004 Cr-Commit-Position: refs/heads/master@{#478884}
void WebContentsImpl::Copy() { RenderFrameHost* focused_frame = GetFocusedFrame(); if (!focused_frame) return; focused_frame->GetFrameInputHandler()->Copy(); RecordAction(base::UserMetricsAction("Copy")); }
void WebContentsImpl::Copy() { RenderFrameHost* focused_frame = GetFocusedFrame(); if (!focused_frame) return; focused_frame->GetFrameInputHandler()->Copy(); RecordAction(base::UserMetricsAction("Copy")); }
C
Chrome
0
CVE-2018-11232
https://www.cvedetails.com/cve/CVE-2018-11232/
CWE-20
https://github.com/torvalds/linux/commit/f09444639099584bc4784dfcd85ada67c6f33e0f
f09444639099584bc4784dfcd85ada67c6f33e0f
coresight: fix kernel panic caused by invalid CPU Commit d52c9750f150 ("coresight: reset "enable_sink" flag when need be") caused a kernel panic because of the using of an invalid value: after 'for_each_cpu(cpu, mask)', value of local variable 'cpu' become invalid, causes following 'cpu_to_node' access invalid memory area. This patch brings the deleted 'cpu = cpumask_first(mask)' back. Panic log: $ perf record -e cs_etm// ls Unable to handle kernel paging request at virtual address fffe801804af4f10 pgd = ffff8017ce031600 [fffe801804af4f10] *pgd=0000000000000000, *pud=0000000000000000 Internal error: Oops: 96000004 [#1] SMP Modules linked in: CPU: 33 PID: 1619 Comm: perf Not tainted 4.7.1+ #16 Hardware name: Huawei Taishan 2280 /CH05TEVBA, BIOS 1.10 11/24/2016 task: ffff8017cb0c8400 ti: ffff8017cb154000 task.ti: ffff8017cb154000 PC is at tmc_alloc_etf_buffer+0x60/0xd4 LR is at tmc_alloc_etf_buffer+0x44/0xd4 pc : [<ffff000008633df8>] lr : [<ffff000008633ddc>] pstate: 60000145 sp : ffff8017cb157b40 x29: ffff8017cb157b40 x28: 0000000000000000 ...skip... 7a60: ffff000008c64dc8 0000000000000006 0000000000000253 ffffffffffffffff 7a80: 0000000000000000 0000000000000000 ffff0000080872cc 0000000000000001 [<ffff000008633df8>] tmc_alloc_etf_buffer+0x60/0xd4 [<ffff000008632b9c>] etm_setup_aux+0x1dc/0x1e8 [<ffff00000816eed4>] rb_alloc_aux+0x2b0/0x338 [<ffff00000816a5e4>] perf_mmap+0x414/0x568 [<ffff0000081ab694>] mmap_region+0x324/0x544 [<ffff0000081abbe8>] do_mmap+0x334/0x3e0 [<ffff000008191150>] vm_mmap_pgoff+0xa4/0xc8 [<ffff0000081a9a30>] SyS_mmap_pgoff+0xb0/0x22c [<ffff0000080872e4>] sys_mmap+0x18/0x28 [<ffff0000080843f0>] el0_svc_naked+0x24/0x28 Code: 912040a5 d0001c00 f873d821 911c6000 (b8656822) ---[ end trace 98933da8f92b0c9a ]--- Signed-off-by: Wang Nan <[email protected]> Cc: Xia Kaixu <[email protected]> Cc: Li Zefan <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: [email protected] Cc: [email protected] Fixes: d52c9750f150 ("coresight: reset "enable_sink" flag when need be") Signed-off-by: Mathieu Poirier <[email protected]> Cc: stable <[email protected]> # 4.10 Signed-off-by: Greg Kroah-Hartman <[email protected]>
static void *alloc_event_data(int cpu) { int size; cpumask_t *mask; struct etm_event_data *event_data; /* First get memory for the session's data */ event_data = kzalloc(sizeof(struct etm_event_data), GFP_KERNEL); if (!event_data) return NULL; /* Make sure nothing disappears under us */ get_online_cpus(); size = num_online_cpus(); mask = &event_data->mask; if (cpu != -1) cpumask_set_cpu(cpu, mask); else cpumask_copy(mask, cpu_online_mask); put_online_cpus(); /* * Each CPU has a single path between source and destination. As such * allocate an array using CPU numbers as indexes. That way a path * for any CPU can easily be accessed at any given time. We proceed * the same way for sessions involving a single CPU. The cost of * unused memory when dealing with single CPU trace scenarios is small * compared to the cost of searching through an optimized array. */ event_data->path = kcalloc(size, sizeof(struct list_head *), GFP_KERNEL); if (!event_data->path) { kfree(event_data); return NULL; } return event_data; }
static void *alloc_event_data(int cpu) { int size; cpumask_t *mask; struct etm_event_data *event_data; /* First get memory for the session's data */ event_data = kzalloc(sizeof(struct etm_event_data), GFP_KERNEL); if (!event_data) return NULL; /* Make sure nothing disappears under us */ get_online_cpus(); size = num_online_cpus(); mask = &event_data->mask; if (cpu != -1) cpumask_set_cpu(cpu, mask); else cpumask_copy(mask, cpu_online_mask); put_online_cpus(); /* * Each CPU has a single path between source and destination. As such * allocate an array using CPU numbers as indexes. That way a path * for any CPU can easily be accessed at any given time. We proceed * the same way for sessions involving a single CPU. The cost of * unused memory when dealing with single CPU trace scenarios is small * compared to the cost of searching through an optimized array. */ event_data->path = kcalloc(size, sizeof(struct list_head *), GFP_KERNEL); if (!event_data->path) { kfree(event_data); return NULL; } return event_data; }
C
linux
0
CVE-2016-3955
https://www.cvedetails.com/cve/CVE-2016-3955/
CWE-119
https://github.com/torvalds/linux/commit/b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb
b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb
USB: usbip: fix potential out-of-bounds write Fix potential out-of-bounds write to urb->transfer_buffer usbip handles network communication directly in the kernel. When receiving a packet from its peer, usbip code parses headers according to protocol. As part of this parsing urb->actual_length is filled. Since the input for urb->actual_length comes from the network, it should be treated as untrusted. Any entity controlling the network may put any value in the input and the preallocated urb->transfer_buffer may not be large enough to hold the data. Thus, the malicious entity is able to write arbitrary data to kernel memory. Signed-off-by: Ignat Korchagin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
void usbip_dump_urb(struct urb *urb) { struct device *dev; if (!urb) { pr_debug("urb: null pointer!!\n"); return; } if (!urb->dev) { pr_debug("urb->dev: null pointer!!\n"); return; } dev = &urb->dev->dev; dev_dbg(dev, " urb :%p\n", urb); dev_dbg(dev, " dev :%p\n", urb->dev); usbip_dump_usb_device(urb->dev); dev_dbg(dev, " pipe :%08x ", urb->pipe); usbip_dump_pipe(urb->pipe); dev_dbg(dev, " status :%d\n", urb->status); dev_dbg(dev, " transfer_flags :%08X\n", urb->transfer_flags); dev_dbg(dev, " transfer_buffer :%p\n", urb->transfer_buffer); dev_dbg(dev, " transfer_buffer_length:%d\n", urb->transfer_buffer_length); dev_dbg(dev, " actual_length :%d\n", urb->actual_length); dev_dbg(dev, " setup_packet :%p\n", urb->setup_packet); if (urb->setup_packet && usb_pipetype(urb->pipe) == PIPE_CONTROL) usbip_dump_usb_ctrlrequest( (struct usb_ctrlrequest *)urb->setup_packet); dev_dbg(dev, " start_frame :%d\n", urb->start_frame); dev_dbg(dev, " number_of_packets :%d\n", urb->number_of_packets); dev_dbg(dev, " interval :%d\n", urb->interval); dev_dbg(dev, " error_count :%d\n", urb->error_count); dev_dbg(dev, " context :%p\n", urb->context); dev_dbg(dev, " complete :%p\n", urb->complete); }
void usbip_dump_urb(struct urb *urb) { struct device *dev; if (!urb) { pr_debug("urb: null pointer!!\n"); return; } if (!urb->dev) { pr_debug("urb->dev: null pointer!!\n"); return; } dev = &urb->dev->dev; dev_dbg(dev, " urb :%p\n", urb); dev_dbg(dev, " dev :%p\n", urb->dev); usbip_dump_usb_device(urb->dev); dev_dbg(dev, " pipe :%08x ", urb->pipe); usbip_dump_pipe(urb->pipe); dev_dbg(dev, " status :%d\n", urb->status); dev_dbg(dev, " transfer_flags :%08X\n", urb->transfer_flags); dev_dbg(dev, " transfer_buffer :%p\n", urb->transfer_buffer); dev_dbg(dev, " transfer_buffer_length:%d\n", urb->transfer_buffer_length); dev_dbg(dev, " actual_length :%d\n", urb->actual_length); dev_dbg(dev, " setup_packet :%p\n", urb->setup_packet); if (urb->setup_packet && usb_pipetype(urb->pipe) == PIPE_CONTROL) usbip_dump_usb_ctrlrequest( (struct usb_ctrlrequest *)urb->setup_packet); dev_dbg(dev, " start_frame :%d\n", urb->start_frame); dev_dbg(dev, " number_of_packets :%d\n", urb->number_of_packets); dev_dbg(dev, " interval :%d\n", urb->interval); dev_dbg(dev, " error_count :%d\n", urb->error_count); dev_dbg(dev, " context :%p\n", urb->context); dev_dbg(dev, " complete :%p\n", urb->complete); }
C
linux
0
CVE-2016-5766
https://www.cvedetails.com/cve/CVE-2016-5766/
CWE-190
https://github.com/php/php-src/commit/7722455726bec8c53458a32851d2a87982cf0eac?w=1
7722455726bec8c53458a32851d2a87982cf0eac?w=1
Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
static void _gd2PutHeader (gdImagePtr im, gdIOCtx * out, int cs, int fmt, int cx, int cy) { int i; /* Send the gd2 id, to verify file format. */ for (i = 0; i < 4; i++) { gdPutC((unsigned char) (GD2_ID[i]), out); } /* We put the version info first, so future versions can easily change header info. */ gdPutWord(GD2_VERS, out); gdPutWord(im->sx, out); gdPutWord(im->sy, out); gdPutWord(cs, out); gdPutWord(fmt, out); gdPutWord(cx, out); gdPutWord(cy, out); }
static void _gd2PutHeader (gdImagePtr im, gdIOCtx * out, int cs, int fmt, int cx, int cy) { int i; /* Send the gd2 id, to verify file format. */ for (i = 0; i < 4; i++) { gdPutC((unsigned char) (GD2_ID[i]), out); } /* We put the version info first, so future versions can easily change header info. */ gdPutWord(GD2_VERS, out); gdPutWord(im->sx, out); gdPutWord(im->sy, out); gdPutWord(cs, out); gdPutWord(fmt, out); gdPutWord(cx, out); gdPutWord(cy, out); }
C
php-src
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=9cf2325fb22f812b31858e519411f57747d39bd8
9cf2325fb22f812b31858e519411f57747d39bd8
null
void Splash::setLineCap(int lineCap) { state->lineCap = lineCap; }
void Splash::setLineCap(int lineCap) { state->lineCap = lineCap; }
CPP
poppler
0
CVE-2017-5093
https://www.cvedetails.com/cve/CVE-2017-5093/
CWE-20
https://github.com/chromium/chromium/commit/0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
0720b02e4f303ea6b114d4ae9453e3a7ff55f8dc
If JavaScript shows a dialog, cause the page to lose fullscreen. BUG=670135, 550017, 726761, 728276 Review-Url: https://codereview.chromium.org/2906133004 Cr-Commit-Position: refs/heads/master@{#478884}
void WebContentsImpl::UpdateOverridingUserAgent() { NotifyPreferencesChanged(); }
void WebContentsImpl::UpdateOverridingUserAgent() { NotifyPreferencesChanged(); }
C
Chrome
0
CVE-2016-3751
https://www.cvedetails.com/cve/CVE-2016-3751/
null
https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca
9d4853418ab2f754c2b63e091c29c5529b8b86ca
DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
buffer_read(struct display *dp, struct buffer *bp, png_bytep data, png_size_t size) { struct buffer_list *last = bp->current; size_t read_count = bp->read_count; while (size > 0) { size_t avail; if (last == NULL || (last == bp->last && read_count >= bp->end_count)) { display_log(dp, USER_ERROR, "file truncated (%lu bytes)", (unsigned long)size); /*NOTREACHED*/ break; } else if (read_count >= sizeof last->buffer) { /* Move to the next buffer: */ last = last->next; read_count = 0; bp->current = last; /* Avoid update outside the loop */ /* And do a sanity check (the EOF case is caught above) */ if (last == NULL) { display_log(dp, INTERNAL_ERROR, "damaged buffer list"); /*NOTREACHED*/ break; } } avail = (sizeof last->buffer) - read_count; if (avail > size) avail = size; memcpy(data, last->buffer + read_count, avail); read_count += avail; size -= avail; data += avail; } bp->read_count = read_count; }
buffer_read(struct display *dp, struct buffer *bp, png_bytep data, png_size_t size) { struct buffer_list *last = bp->current; size_t read_count = bp->read_count; while (size > 0) { size_t avail; if (last == NULL || (last == bp->last && read_count >= bp->end_count)) { display_log(dp, USER_ERROR, "file truncated (%lu bytes)", (unsigned long)size); /*NOTREACHED*/ break; } else if (read_count >= sizeof last->buffer) { /* Move to the next buffer: */ last = last->next; read_count = 0; bp->current = last; /* Avoid update outside the loop */ /* And do a sanity check (the EOF case is caught above) */ if (last == NULL) { display_log(dp, INTERNAL_ERROR, "damaged buffer list"); /*NOTREACHED*/ break; } } avail = (sizeof last->buffer) - read_count; if (avail > size) avail = size; memcpy(data, last->buffer + read_count, avail); read_count += avail; size -= avail; data += avail; } bp->read_count = read_count; }
C
Android
0
null
null
null
https://github.com/chromium/chromium/commit/8c3278613079f1c6d858f2b2deb95d8b95dd1789
8c3278613079f1c6d858f2b2deb95d8b95dd1789
Enable ManifestTest.AppLaunchContainer as it should be passing now. BUG=47230 TEST=test passes TBR=robertshield Review URL: http://codereview.chromium.org/2844016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50553 0039d316-1c4b-4281-b951-d872f2087c98
Extension* LoadAndExpectSuccess(const std::string& name) { std::string error; Extension* extension = LoadExtension(name, &error); EXPECT_TRUE(extension); EXPECT_EQ("", error); return extension; }
Extension* LoadAndExpectSuccess(const std::string& name) { std::string error; Extension* extension = LoadExtension(name, &error); EXPECT_TRUE(extension); EXPECT_EQ("", error); return extension; }
C
Chrome
0
CVE-2012-2895
https://www.cvedetails.com/cve/CVE-2012-2895/
CWE-119
https://github.com/chromium/chromium/commit/16dcd30c215801941d9890859fd79a234128fc3e
16dcd30c215801941d9890859fd79a234128fc3e
Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved to after the auto-opening. The tests that test the auto-opening (for web store install) were waiting for download completion to check install, and hence were failing when completion was moved earlier. Doing this right would probably require another state (OPENED). BUG=123998 BUG-134930 [email protected] Review URL: https://chromiumcodereview.appspot.com/10701040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145157 0039d316-1c4b-4281-b951-d872f2087c98
content::MockDownloadItem& AddItemToManager() { DownloadCreateInfo info; static const char* kDownloadIdDomain = "Test download id domain"; int id = next_download_id_; ++next_download_id_; info.download_id = content::DownloadId(kDownloadIdDomain, id); info.request_handle = DownloadRequestHandle(); download_manager_->CreateDownloadItem(&info); DCHECK(mock_download_item_factory_->GetItem(id)); content::MockDownloadItem& item(*mock_download_item_factory_->GetItem(id)); ON_CALL(item, GetId()) .WillByDefault(Return(id)); return item; }
content::MockDownloadItem& AddItemToManager() { DownloadCreateInfo info; static const char* kDownloadIdDomain = "Test download id domain"; int id = next_download_id_; ++next_download_id_; info.download_id = content::DownloadId(kDownloadIdDomain, id); info.request_handle = DownloadRequestHandle(); download_manager_->CreateDownloadItem(&info); DCHECK(mock_download_item_factory_->GetItem(id)); content::MockDownloadItem& item(*mock_download_item_factory_->GetItem(id)); ON_CALL(item, GetId()) .WillByDefault(Return(id)); return item; }
C
Chrome
0
CVE-2016-6787
https://www.cvedetails.com/cve/CVE-2016-6787/
CWE-264
https://github.com/torvalds/linux/commit/f63a8daa5812afef4f06c962351687e1ff9ccb2b
f63a8daa5812afef4f06c962351687e1ff9ccb2b
perf: Fix event->ctx locking There have been a few reported issues wrt. the lack of locking around changing event->ctx. This patch tries to address those. It avoids the whole rwsem thing; and while it appears to work, please give it some thought in review. What I did fail at is sensible runtime checks on the use of event->ctx, the RCU use makes it very hard. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
unclone_ctx(struct perf_event_context *ctx) { struct perf_event_context *parent_ctx = ctx->parent_ctx; lockdep_assert_held(&ctx->lock); if (parent_ctx) ctx->parent_ctx = NULL; ctx->generation++; return parent_ctx; }
unclone_ctx(struct perf_event_context *ctx) { struct perf_event_context *parent_ctx = ctx->parent_ctx; lockdep_assert_held(&ctx->lock); if (parent_ctx) ctx->parent_ctx = NULL; ctx->generation++; return parent_ctx; }
C
linux
0
CVE-2011-2799
https://www.cvedetails.com/cve/CVE-2011-2799/
CWE-399
https://github.com/chromium/chromium/commit/5a2de6455f565783c73e53eae2c8b953e7d48520
5a2de6455f565783c73e53eae2c8b953e7d48520
2011-06-02 Joone Hur <[email protected]> Reviewed by Martin Robinson. [GTK] Only load dictionaries if spell check is enabled https://bugs.webkit.org/show_bug.cgi?id=32879 We don't need to call enchant if enable-spell-checking is false. * webkit/webkitwebview.cpp: (webkit_web_view_update_settings): Skip loading dictionaries when enable-spell-checking is false. (webkit_web_view_settings_notify): Ditto. git-svn-id: svn://svn.chromium.org/blink/trunk@87925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
gboolean webkit_web_view_can_cut_clipboard(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); return frame->editor()->canCut() || frame->editor()->canDHTMLCut(); }
gboolean webkit_web_view_can_cut_clipboard(WebKitWebView* webView) { g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); return frame->editor()->canCut() || frame->editor()->canDHTMLCut(); }
C
Chrome
0
CVE-2010-2519
https://www.cvedetails.com/cve/CVE-2010-2519/
CWE-119
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=5ef20c8c1d4de12a84b50ba497c2a358c90ec44b
5ef20c8c1d4de12a84b50ba497c2a358c90ec44b
null
find_variant_selector_charmap( FT_Face face ) { FT_CharMap* first; FT_CharMap* end; FT_CharMap* cur; /* caller should have already checked that `face' is valid */ FT_ASSERT( face ); first = face->charmaps; if ( !first ) return NULL; end = first + face->num_charmaps; /* points after the last one */ for ( cur = first; cur < end; ++cur ) { if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR && FT_Get_CMap_Format( cur[0] ) == 14 ) return cur[0]; } return NULL; }
find_variant_selector_charmap( FT_Face face ) { FT_CharMap* first; FT_CharMap* end; FT_CharMap* cur; /* caller should have already checked that `face' is valid */ FT_ASSERT( face ); first = face->charmaps; if ( !first ) return NULL; end = first + face->num_charmaps; /* points after the last one */ for ( cur = first; cur < end; ++cur ) { if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR && FT_Get_CMap_Format( cur[0] ) == 14 ) return cur[0]; } return NULL; }
C
savannah
0
CVE-2016-6836
https://www.cvedetails.com/cve/CVE-2016-6836/
CWE-200
https://git.qemu.org/?p=qemu.git;a=commit;h=fdda170e50b8af062cf5741e12c4fb5e57a2eacf
fdda170e50b8af062cf5741e12c4fb5e57a2eacf
null
vmxnet3_setup_tx_offloads(VMXNET3State *s) { switch (s->offload_mode) { case VMXNET3_OM_NONE: net_tx_pkt_build_vheader(s->tx_pkt, false, false, 0); break; case VMXNET3_OM_CSUM: net_tx_pkt_build_vheader(s->tx_pkt, false, true, 0); VMW_PKPRN("L4 CSO requested\n"); break; case VMXNET3_OM_TSO: net_tx_pkt_build_vheader(s->tx_pkt, true, true, s->cso_or_gso_size); net_tx_pkt_update_ip_checksums(s->tx_pkt); VMW_PKPRN("GSO offload requested."); break; default: g_assert_not_reached(); return false; } return true; }
vmxnet3_setup_tx_offloads(VMXNET3State *s) { switch (s->offload_mode) { case VMXNET3_OM_NONE: net_tx_pkt_build_vheader(s->tx_pkt, false, false, 0); break; case VMXNET3_OM_CSUM: net_tx_pkt_build_vheader(s->tx_pkt, false, true, 0); VMW_PKPRN("L4 CSO requested\n"); break; case VMXNET3_OM_TSO: net_tx_pkt_build_vheader(s->tx_pkt, true, true, s->cso_or_gso_size); net_tx_pkt_update_ip_checksums(s->tx_pkt); VMW_PKPRN("GSO offload requested."); break; default: g_assert_not_reached(); return false; } return true; }
C
qemu
0
CVE-2016-5217
https://www.cvedetails.com/cve/CVE-2016-5217/
CWE-284
https://github.com/chromium/chromium/commit/0d68cbd77addd38909101f76847deea56de00524
0d68cbd77addd38909101f76847deea56de00524
Fix PIP window being blank after minimize/show DesktopWindowTreeHostX11::SetVisible only made the call into OnNativeWidgetVisibilityChanged when transitioning from shown to minimized and not vice versa. This is because this change https://chromium-review.googlesource.com/c/chromium/src/+/1437263 considered IsVisible to be true when minimized, which made IsVisible always true in this case. This caused layers to be hidden but never shown again. This is a reland of: https://chromium-review.googlesource.com/c/chromium/src/+/1580103 Bug: 949199 Change-Id: I2151cd09e537d8ce8781897f43a3b8e9cec75996 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584617 Reviewed-by: Scott Violet <[email protected]> Commit-Queue: enne <[email protected]> Cr-Commit-Position: refs/heads/master@{#654280}
int XI2ModeToXMode(int xi2_mode) { switch (xi2_mode) { case XINotifyNormal: return NotifyNormal; case XINotifyGrab: case XINotifyPassiveGrab: return NotifyGrab; case XINotifyUngrab: case XINotifyPassiveUngrab: return NotifyUngrab; case XINotifyWhileGrabbed: return NotifyWhileGrabbed; default: NOTREACHED(); return NotifyNormal; } }
int XI2ModeToXMode(int xi2_mode) { switch (xi2_mode) { case XINotifyNormal: return NotifyNormal; case XINotifyGrab: case XINotifyPassiveGrab: return NotifyGrab; case XINotifyUngrab: case XINotifyPassiveUngrab: return NotifyUngrab; case XINotifyWhileGrabbed: return NotifyWhileGrabbed; default: NOTREACHED(); return NotifyNormal; } }
C
Chrome
0
CVE-2014-8275
https://www.cvedetails.com/cve/CVE-2014-8275/
CWE-310
https://github.com/openssl/openssl/commit/684400ce192dac51df3d3e92b61830a6ef90be3e
684400ce192dac51df3d3e92b61830a6ef90be3e
Fix various certificate fingerprint issues. By using non-DER or invalid encodings outside the signed portion of a certificate the fingerprint can be changed without breaking the signature. Although no details of the signed portion of the certificate can be changed this can cause problems with some applications: e.g. those using the certificate fingerprint for blacklists. 1. Reject signatures with non zero unused bits. If the BIT STRING containing the signature has non zero unused bits reject the signature. All current signature algorithms require zero unused bits. 2. Check certificate algorithm consistency. Check the AlgorithmIdentifier inside TBS matches the one in the certificate signature. NB: this will result in signature failure errors for some broken certificates. 3. Check DSA/ECDSA signatures use DER. Reencode DSA/ECDSA signatures and compare with the original received signature. Return an error if there is a mismatch. This will reject various cases including garbage after signature (thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS program for discovering this case) and use of BER or invalid ASN.1 INTEGERs (negative or with leading zeroes). CVE-2014-8275 Reviewed-by: Emilia Käsper <[email protected]>
int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md, unsigned int *len) { return(ASN1_item_digest(ASN1_ITEM_rptr(X509_CRL),type,(char *)data,md,len)); }
int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md, unsigned int *len) { return(ASN1_item_digest(ASN1_ITEM_rptr(X509_CRL),type,(char *)data,md,len)); }
C
openssl
0
null
null
null
https://github.com/chromium/chromium/commit/d1a59e4e845a01d7d7b80ef184b672752a9eae4d
d1a59e4e845a01d7d7b80ef184b672752a9eae4d
Fixing cross-process postMessage replies on more than two iterations. When two frames are replying to each other using event.source across processes, after the first two replies, things break down. The root cause is that in RenderViewImpl::GetFrameByMappedID, the lookup was incorrect. It is now properly searching for the remote frame id and returning the local one. BUG=153445 Review URL: https://chromiumcodereview.appspot.com/11040015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159924 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewImpl::dispatchIntent( WebFrame* frame, const WebIntentRequest& intentRequest) { webkit_glue::WebIntentData intent_data(intentRequest.intent()); WebKit::WebMessagePortChannelArray* channels = intentRequest.intent().messagePortChannelsRelease(); if (channels) { for (size_t i = 0; i < channels->size(); ++i) { WebMessagePortChannelImpl* webchannel = static_cast<WebMessagePortChannelImpl*>((*channels)[i]); intent_data.message_port_ids.push_back(webchannel->message_port_id()); DCHECK(intent_data.message_port_ids[i] != MSG_ROUTING_NONE); } delete channels; } int id = intents_host_->RegisterWebIntent(intentRequest); Send(new IntentsHostMsg_WebIntentDispatch( routing_id_, intent_data, id)); }
void RenderViewImpl::dispatchIntent( WebFrame* frame, const WebIntentRequest& intentRequest) { webkit_glue::WebIntentData intent_data(intentRequest.intent()); WebKit::WebMessagePortChannelArray* channels = intentRequest.intent().messagePortChannelsRelease(); if (channels) { for (size_t i = 0; i < channels->size(); ++i) { WebMessagePortChannelImpl* webchannel = static_cast<WebMessagePortChannelImpl*>((*channels)[i]); intent_data.message_port_ids.push_back(webchannel->message_port_id()); DCHECK(intent_data.message_port_ids[i] != MSG_ROUTING_NONE); } delete channels; } int id = intents_host_->RegisterWebIntent(intentRequest); Send(new IntentsHostMsg_WebIntentDispatch( routing_id_, intent_data, id)); }
C
Chrome
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
static int get_update_sysctl_factor(void) { unsigned int cpus = min_t(int, num_online_cpus(), 8); unsigned int factor; switch (sysctl_sched_tunable_scaling) { case SCHED_TUNABLESCALING_NONE: factor = 1; break; case SCHED_TUNABLESCALING_LINEAR: factor = cpus; break; case SCHED_TUNABLESCALING_LOG: default: factor = 1 + ilog2(cpus); break; } return factor; }
static int get_update_sysctl_factor(void) { unsigned int cpus = min_t(int, num_online_cpus(), 8); unsigned int factor; switch (sysctl_sched_tunable_scaling) { case SCHED_TUNABLESCALING_NONE: factor = 1; break; case SCHED_TUNABLESCALING_LINEAR: factor = cpus; break; case SCHED_TUNABLESCALING_LOG: default: factor = 1 + ilog2(cpus); break; } return factor; }
C
linux
0
CVE-2016-6250
https://www.cvedetails.com/cve/CVE-2016-6250/
CWE-190
https://github.com/libarchive/libarchive/commit/3014e198
3014e198
Issue 711: Be more careful about verifying filename lengths when writing ISO9660 archives * Don't cast size_t to int, since this can lead to overflow on machines where sizeof(int) < sizeof(size_t) * Check a + b > limit by writing it as a > limit || b > limit || a + b > limit to avoid problems when a + b wraps around.
set_str_utf16be(struct archive_write *a, unsigned char *p, const char *s, size_t l, uint16_t uf, enum vdc vdc) { size_t size, i; int onepad; if (s == NULL) s = ""; if (l & 0x01) { onepad = 1; l &= ~1; } else onepad = 0; if (vdc == VDC_UCS2) { struct iso9660 *iso9660 = a->format_data; if (archive_strncpy_l(&iso9660->utf16be, s, strlen(s), iso9660->sconv_to_utf16be) != 0 && errno == ENOMEM) { archive_set_error(&a->archive, ENOMEM, "Can't allocate memory for UTF-16BE"); return (ARCHIVE_FATAL); } size = iso9660->utf16be.length; if (size > l) size = l; memcpy(p, iso9660->utf16be.s, size); } else { const uint16_t *u16 = (const uint16_t *)s; size = 0; while (*u16++) size += 2; if (size > l) size = l; memcpy(p, s, size); } for (i = 0; i < size; i += 2, p += 2) { if (!joliet_allowed_char(p[0], p[1])) archive_be16enc(p, 0x005F);/* '_' */ } l -= size; while (l > 0) { archive_be16enc(p, uf); p += 2; l -= 2; } if (onepad) *p = 0; return (ARCHIVE_OK); }
set_str_utf16be(struct archive_write *a, unsigned char *p, const char *s, size_t l, uint16_t uf, enum vdc vdc) { size_t size, i; int onepad; if (s == NULL) s = ""; if (l & 0x01) { onepad = 1; l &= ~1; } else onepad = 0; if (vdc == VDC_UCS2) { struct iso9660 *iso9660 = a->format_data; if (archive_strncpy_l(&iso9660->utf16be, s, strlen(s), iso9660->sconv_to_utf16be) != 0 && errno == ENOMEM) { archive_set_error(&a->archive, ENOMEM, "Can't allocate memory for UTF-16BE"); return (ARCHIVE_FATAL); } size = iso9660->utf16be.length; if (size > l) size = l; memcpy(p, iso9660->utf16be.s, size); } else { const uint16_t *u16 = (const uint16_t *)s; size = 0; while (*u16++) size += 2; if (size > l) size = l; memcpy(p, s, size); } for (i = 0; i < size; i += 2, p += 2) { if (!joliet_allowed_char(p[0], p[1])) archive_be16enc(p, 0x005F);/* '_' */ } l -= size; while (l > 0) { archive_be16enc(p, uf); p += 2; l -= 2; } if (onepad) *p = 0; return (ARCHIVE_OK); }
C
libarchive
0
CVE-2014-1713
https://www.cvedetails.com/cve/CVE-2014-1713/
CWE-399
https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154
f85a87ec670ad0fce9d98d90c9a705b72a288154
document.location bindings fix BUG=352374 [email protected] Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Value> jsValue = info[0]; TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); TestObjectV8Internal::attrWithJSGetterAndSetterAttributeSetter(jsValue, info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
static void attrWithJSGetterAndSetterAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::Local<v8::Value> jsValue = info[0]; TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); TestObjectV8Internal::attrWithJSGetterAndSetterAttributeSetter(jsValue, info); TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); }
C
Chrome
0
CVE-2018-20067
https://www.cvedetails.com/cve/CVE-2018-20067/
CWE-254
https://github.com/chromium/chromium/commit/a7d715ae5b654d1f98669fd979a00282a7229044
a7d715ae5b654d1f98669fd979a00282a7229044
Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' renderer initiated navigation uses the FrameHost::BeginNavigation() path. A code similar to this patch is done in NavigatorImpl::OnBeginNavigation(). Test: ----- Added: NavigationBrowserTest. * HistoryBackInBeforeUnload * HistoryBackInBeforeUnloadAfterSetTimeout * HistoryBackCancelPendingNavigationNoUserGesture * HistoryBackCancelPendingNavigationUserGesture Fixed: * (WPT) .../the-history-interface/traverse_the_history_2.html * (WPT) .../the-history-interface/traverse_the_history_3.html * (WPT) .../the-history-interface/traverse_the_history_4.html * (WPT) .../the-history-interface/traverse_the_history_5.html Bug: 879965 Change-Id: I1a9bfaaea1ffc219e6c32f6e676b660e746c578c Reviewed-on: https://chromium-review.googlesource.com/1209744 Commit-Queue: Arthur Sonzogni <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Mustaq Ahmed <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Reviewed-by: Charlie Reis <[email protected]> Cr-Commit-Position: refs/heads/master@{#592823}
void WebContentsImpl::AddDestructionObserver(WebContentsImpl* web_contents) { if (!ContainsKey(destruction_observers_, web_contents)) { destruction_observers_[web_contents] = std::make_unique<DestructionObserver>(this, web_contents); } }
void WebContentsImpl::AddDestructionObserver(WebContentsImpl* web_contents) { if (!ContainsKey(destruction_observers_, web_contents)) { destruction_observers_[web_contents] = std::make_unique<DestructionObserver>(this, web_contents); } }
C
Chrome
0
CVE-2013-6630
https://www.cvedetails.com/cve/CVE-2013-6630/
CWE-189
https://github.com/chromium/chromium/commit/805eabb91d386c86bd64336c7643f6dfa864151d
805eabb91d386c86bd64336c7643f6dfa864151d
Convert ARRAYSIZE_UNSAFE -> arraysize in base/. [email protected] BUG=423134 Review URL: https://codereview.chromium.org/656033009 Cr-Commit-Position: refs/heads/master@{#299835}
static int OpenObjectFileContainingPc(uint64_t pc, uint64_t& start_address, uint64_t& base_address, char* file_path, int file_path_size) { SandboxSymbolizeHelper* instance = GetInstance(); std::vector<MappedMemoryRegion>::const_iterator it; bool is_first = true; for (it = instance->regions_.begin(); it != instance->regions_.end(); ++it, is_first = false) { const MappedMemoryRegion& region = *it; if (region.start <= pc && pc < region.end) { start_address = region.start; base_address = (is_first ? 0U : start_address) - region.offset; if (file_path && file_path_size > 0) { strncpy(file_path, region.path.c_str(), file_path_size); file_path[file_path_size - 1] = '\0'; } return instance->GetFileDescriptor(region.path.c_str()); } } return -1; }
static int OpenObjectFileContainingPc(uint64_t pc, uint64_t& start_address, uint64_t& base_address, char* file_path, int file_path_size) { SandboxSymbolizeHelper* instance = GetInstance(); std::vector<MappedMemoryRegion>::const_iterator it; bool is_first = true; for (it = instance->regions_.begin(); it != instance->regions_.end(); ++it, is_first = false) { const MappedMemoryRegion& region = *it; if (region.start <= pc && pc < region.end) { start_address = region.start; base_address = (is_first ? 0U : start_address) - region.offset; if (file_path && file_path_size > 0) { strncpy(file_path, region.path.c_str(), file_path_size); file_path[file_path_size - 1] = '\0'; } return instance->GetFileDescriptor(region.path.c_str()); } } return -1; }
C
Chrome
0
CVE-2017-11399
https://www.cvedetails.com/cve/CVE-2017-11399/
CWE-125
https://github.com/FFmpeg/FFmpeg/commit/ba4beaf6149f7241c8bd85fe853318c2f6837ad0
ba4beaf6149f7241c8bd85fe853318c2f6837ad0
avcodec/apedec: Fix integer overflow Fixes: out of array access Fixes: PoC.ape and others Found-by: Bingchang, Liu@VARAS of IIE Signed-off-by: Michael Niedermayer <[email protected]>
static void entropy_decode_mono_3860(APEContext *ctx, int blockstodecode) { int32_t *decoded0 = ctx->decoded[0]; while (blockstodecode--) *decoded0++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceY); }
static void entropy_decode_mono_3860(APEContext *ctx, int blockstodecode) { int32_t *decoded0 = ctx->decoded[0]; while (blockstodecode--) *decoded0++ = ape_decode_value_3860(ctx, &ctx->gb, &ctx->riceY); }
C
FFmpeg
0
CVE-2017-10971
https://www.cvedetails.com/cve/CVE-2017-10971/
CWE-119
https://cgit.freedesktop.org/xorg/xserver/commit/?id=215f894965df5fb0bb45b107d84524e700d2073c
215f894965df5fb0bb45b107d84524e700d2073c
null
XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent) { ScreenPtr pScreen; int i; SpritePtr pSprite = pDev->spriteInfo->sprite; /* x,y are in Screen 0 coordinates. We need to decide what Screen to send the message too and what the coordinates relative to that screen are. */ pScreen = pSprite->screen; x += screenInfo.screens[0]->x; y += screenInfo.screens[0]->y; if (!point_on_screen(pScreen, x, y)) { FOR_NSCREENS(i) { if (i == pScreen->myNum) continue; if (point_on_screen(screenInfo.screens[i], x, y)) { pScreen = screenInfo.screens[i]; break; } } } pSprite->screen = pScreen; pSprite->hotPhys.x = x - screenInfo.screens[0]->x; pSprite->hotPhys.y = y - screenInfo.screens[0]->y; x -= pScreen->x; y -= pScreen->y; return (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); }
XineramaSetCursorPosition(DeviceIntPtr pDev, int x, int y, Bool generateEvent) { ScreenPtr pScreen; int i; SpritePtr pSprite = pDev->spriteInfo->sprite; /* x,y are in Screen 0 coordinates. We need to decide what Screen to send the message too and what the coordinates relative to that screen are. */ pScreen = pSprite->screen; x += screenInfo.screens[0]->x; y += screenInfo.screens[0]->y; if (!point_on_screen(pScreen, x, y)) { FOR_NSCREENS(i) { if (i == pScreen->myNum) continue; if (point_on_screen(screenInfo.screens[i], x, y)) { pScreen = screenInfo.screens[i]; break; } } } pSprite->screen = pScreen; pSprite->hotPhys.x = x - screenInfo.screens[0]->x; pSprite->hotPhys.y = y - screenInfo.screens[0]->y; x -= pScreen->x; y -= pScreen->y; return (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); }
C
xserver
0
CVE-2017-13054
https://www.cvedetails.com/cve/CVE-2017-13054/
CWE-125
https://github.com/the-tcpdump-group/tcpdump/commit/e6511cc1a950fe1566b2236329d6b4bd0826cc7a
e6511cc1a950fe1566b2236329d6b4bd0826cc7a
CVE-2017-13054/LLDP: add a missing length check In lldp_private_8023_print() the case block for subtype 4 (Maximum Frame Size TLV, IEEE 802.3bc-2009 Section 79.3.4) did not include the length check and could over-read the input buffer, put it right. This fixes a buffer over-read discovered by Bhargava Shastry, SecT/TU Berlin. Add a test using the capture file supplied by the reporter(s).
lldp_private_8023_print(netdissect_options *ndo, const u_char *tptr, u_int tlv_len) { int subtype, hexdump = FALSE; if (tlv_len < 4) { return hexdump; } subtype = *(tptr+3); ND_PRINT((ndo, "\n\t %s Subtype (%u)", tok2str(lldp_8023_subtype_values, "unknown", subtype), subtype)); switch (subtype) { case LLDP_PRIVATE_8023_SUBTYPE_MACPHY: if (tlv_len < 9) { return hexdump; } ND_PRINT((ndo, "\n\t autonegotiation [%s] (0x%02x)", bittok2str(lldp_8023_autonegotiation_values, "none", *(tptr+4)), *(tptr + 4))); ND_PRINT((ndo, "\n\t PMD autoneg capability [%s] (0x%04x)", bittok2str(lldp_pmd_capability_values,"unknown", EXTRACT_16BITS(tptr+5)), EXTRACT_16BITS(tptr + 5))); ND_PRINT((ndo, "\n\t MAU type %s (0x%04x)", tok2str(lldp_mau_types_values, "unknown", EXTRACT_16BITS(tptr+7)), EXTRACT_16BITS(tptr + 7))); break; case LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER: if (tlv_len < 7) { return hexdump; } ND_PRINT((ndo, "\n\t MDI power support [%s], power pair %s, power class %s", bittok2str(lldp_mdi_values, "none", *(tptr+4)), tok2str(lldp_mdi_power_pairs_values, "unknown", *(tptr+5)), tok2str(lldp_mdi_power_class_values, "unknown", *(tptr + 6)))); break; case LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR: if (tlv_len < 9) { return hexdump; } ND_PRINT((ndo, "\n\t aggregation status [%s], aggregation port ID %u", bittok2str(lldp_aggregation_values, "none", *(tptr+4)), EXTRACT_32BITS(tptr + 5))); break; case LLDP_PRIVATE_8023_SUBTYPE_MTU: if (tlv_len < 6) { return hexdump; } ND_PRINT((ndo, "\n\t MTU size %u", EXTRACT_16BITS(tptr + 4))); break; default: hexdump = TRUE; break; } return hexdump; }
lldp_private_8023_print(netdissect_options *ndo, const u_char *tptr, u_int tlv_len) { int subtype, hexdump = FALSE; if (tlv_len < 4) { return hexdump; } subtype = *(tptr+3); ND_PRINT((ndo, "\n\t %s Subtype (%u)", tok2str(lldp_8023_subtype_values, "unknown", subtype), subtype)); switch (subtype) { case LLDP_PRIVATE_8023_SUBTYPE_MACPHY: if (tlv_len < 9) { return hexdump; } ND_PRINT((ndo, "\n\t autonegotiation [%s] (0x%02x)", bittok2str(lldp_8023_autonegotiation_values, "none", *(tptr+4)), *(tptr + 4))); ND_PRINT((ndo, "\n\t PMD autoneg capability [%s] (0x%04x)", bittok2str(lldp_pmd_capability_values,"unknown", EXTRACT_16BITS(tptr+5)), EXTRACT_16BITS(tptr + 5))); ND_PRINT((ndo, "\n\t MAU type %s (0x%04x)", tok2str(lldp_mau_types_values, "unknown", EXTRACT_16BITS(tptr+7)), EXTRACT_16BITS(tptr + 7))); break; case LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER: if (tlv_len < 7) { return hexdump; } ND_PRINT((ndo, "\n\t MDI power support [%s], power pair %s, power class %s", bittok2str(lldp_mdi_values, "none", *(tptr+4)), tok2str(lldp_mdi_power_pairs_values, "unknown", *(tptr+5)), tok2str(lldp_mdi_power_class_values, "unknown", *(tptr + 6)))); break; case LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR: if (tlv_len < 9) { return hexdump; } ND_PRINT((ndo, "\n\t aggregation status [%s], aggregation port ID %u", bittok2str(lldp_aggregation_values, "none", *(tptr+4)), EXTRACT_32BITS(tptr + 5))); break; case LLDP_PRIVATE_8023_SUBTYPE_MTU: ND_PRINT((ndo, "\n\t MTU size %u", EXTRACT_16BITS(tptr + 4))); break; default: hexdump = TRUE; break; } return hexdump; }
C
tcpdump
1
CVE-2012-3552
https://www.cvedetails.com/cve/CVE-2012-3552/
CWE-362
https://github.com/torvalds/linux/commit/f6d8bd051c391c1c0458a30b2a7abcd939329259
f6d8bd051c391c1c0458a30b2a7abcd939329259
inet: add RCU protection to inet->opt We lack proper synchronization to manipulate inet->opt ip_options Problem is ip_make_skb() calls ip_setup_cork() and ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options), without any protection against another thread manipulating inet->opt. Another thread can change inet->opt pointer and free old one under us. Use RCU to protect inet->opt (changed to inet->inet_opt). Instead of handling atomic refcounts, just copy ip_options when necessary, to avoid cache line dirtying. We cant insert an rcu_head in struct ip_options since its included in skb->cb[], so this patch is large because I had to introduce a new ip_options_rcu structure. Signed-off-by: Eric Dumazet <[email protected]> Cc: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void tcp_v6_reqsk_send_ack(struct sock *sk, struct sk_buff *skb, struct request_sock *req) { tcp_v6_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, req->rcv_wnd, req->ts_recent, tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr)); }
static void tcp_v6_reqsk_send_ack(struct sock *sk, struct sk_buff *skb, struct request_sock *req) { tcp_v6_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, req->rcv_wnd, req->ts_recent, tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->daddr)); }
C
linux
0
CVE-2016-2464
https://www.cvedetails.com/cve/CVE-2016-2464/
CWE-20
https://android.googlesource.com/platform/external/libvpx/+/65c49d5b382de4085ee5668732bcb0f6ecaf7148
65c49d5b382de4085ee5668732bcb0f6ecaf7148
Fix ParseElementHeader to support 0 payload elements Cherry-pick'ing Change 5c83bbec9a5f6f00a349674ddad85b753d2ea219 from upstream. This fixes regression in some edge cases for mkv playback. BUG=26499283 Change-Id: I88de03219a3d941b6b2f251d384e29c36bdd4d9b
Tags::Tag::~Tag() {}
Tags::Tag::~Tag() {}
C
Android
0
CVE-2010-2520
https://www.cvedetails.com/cve/CVE-2010-2520/
CWE-119
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=888cd1843e935fe675cf2ac303116d4ed5b9d54b
888cd1843e935fe675cf2ac303116d4ed5b9d54b
null
Ins_ROUND( INS_ARG ) { DO_ROUND }
Ins_ROUND( INS_ARG ) { DO_ROUND }
C
savannah
0
CVE-2017-5077
https://www.cvedetails.com/cve/CVE-2017-5077/
CWE-125
https://github.com/chromium/chromium/commit/fec26ff33bf372476a70326f3669a35f34a9d474
fec26ff33bf372476a70326f3669a35f34a9d474
Origins should be represented as url::Origin (not as GURL). As pointed out in //docs/security/origin-vs-url.md, origins should be represented as url::Origin (not as GURL). This CL applies this guideline to predictor-related code and changes the type of the following fields from GURL to url::Origin: - OriginRequestSummary::origin - PreconnectedRequestStats::origin - PreconnectRequest::origin The old code did not depend on any non-origin parts of GURL (like path and/or query). Therefore, this CL has no intended behavior change. Bug: 973885 Change-Id: Idd14590b4834cb9d50c74ed747b595fe1a4ba357 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895167 Commit-Queue: Łukasz Anforowicz <[email protected]> Reviewed-by: Alex Ilin <[email protected]> Cr-Commit-Position: refs/heads/master@{#716311}
void ReportPreconnectPredictionAccuracy(const PreconnectPrediction& prediction, const PageRequestSummary& summary) { if (prediction.requests.empty() || summary.origins.empty()) return; const auto& actual_origins = summary.origins; size_t correctly_predicted_count = std::count_if( prediction.requests.begin(), prediction.requests.end(), [&actual_origins](const PreconnectRequest& request) { return actual_origins.find(request.origin) != actual_origins.end(); }); size_t precision_percentage = (100 * correctly_predicted_count) / prediction.requests.size(); size_t recall_percentage = (100 * correctly_predicted_count) / actual_origins.size(); UMA_HISTOGRAM_PERCENTAGE( internal::kLoadingPredictorPreconnectLearningPrecision, precision_percentage); UMA_HISTOGRAM_PERCENTAGE(internal::kLoadingPredictorPreconnectLearningRecall, recall_percentage); UMA_HISTOGRAM_COUNTS_100(internal::kLoadingPredictorPreconnectLearningCount, prediction.requests.size()); RedirectStatus redirect_status = GetPredictionRedirectStatus( summary.initial_url, summary.main_frame_url, prediction.host, prediction.is_redirected, true /* is_host */); UMA_HISTOGRAM_ENUMERATION( internal::kLoadingPredictorPreconnectLearningRedirectStatus, static_cast<int>(redirect_status), static_cast<int>(RedirectStatus::MAX)); }
void ReportPreconnectPredictionAccuracy(const PreconnectPrediction& prediction, const PageRequestSummary& summary) { if (prediction.requests.empty() || summary.origins.empty()) return; const auto& actual_origins = summary.origins; size_t correctly_predicted_count = std::count_if( prediction.requests.begin(), prediction.requests.end(), [&actual_origins](const PreconnectRequest& request) { return actual_origins.find(request.origin) != actual_origins.end(); }); size_t precision_percentage = (100 * correctly_predicted_count) / prediction.requests.size(); size_t recall_percentage = (100 * correctly_predicted_count) / actual_origins.size(); UMA_HISTOGRAM_PERCENTAGE( internal::kLoadingPredictorPreconnectLearningPrecision, precision_percentage); UMA_HISTOGRAM_PERCENTAGE(internal::kLoadingPredictorPreconnectLearningRecall, recall_percentage); UMA_HISTOGRAM_COUNTS_100(internal::kLoadingPredictorPreconnectLearningCount, prediction.requests.size()); RedirectStatus redirect_status = GetPredictionRedirectStatus( summary.initial_url, summary.main_frame_url, prediction.host, prediction.is_redirected, true /* is_host */); UMA_HISTOGRAM_ENUMERATION( internal::kLoadingPredictorPreconnectLearningRedirectStatus, static_cast<int>(redirect_status), static_cast<int>(RedirectStatus::MAX)); }
C
Chrome
0
CVE-2016-1665
https://www.cvedetails.com/cve/CVE-2016-1665/
CWE-20
https://github.com/chromium/chromium/commit/282f53ffdc3b1902da86f6a0791af736837efbf8
282f53ffdc3b1902da86f6a0791af736837efbf8
[signin] Add metrics to track the source for refresh token updated events This CL add a source for update and revoke credentials operations. It then surfaces the source in the chrome://signin-internals page. This CL also records the following histograms that track refresh token events: * Signin.RefreshTokenUpdated.ToValidToken.Source * Signin.RefreshTokenUpdated.ToInvalidToken.Source * Signin.RefreshTokenRevoked.Source These histograms are needed to validate the assumptions of how often tokens are revoked by the browser and the sources for the token revocations. Bug: 896182 Change-Id: I2fcab80ee8e5699708e695bc3289fa6d34859a90 Reviewed-on: https://chromium-review.googlesource.com/c/1286464 Reviewed-by: Jochen Eisinger <[email protected]> Reviewed-by: David Roger <[email protected]> Reviewed-by: Ilya Sherman <[email protected]> Commit-Queue: Mihai Sardarescu <[email protected]> Cr-Commit-Position: refs/heads/master@{#606181}
void SupervisedUserService::AddExtensionInstallRequest( const std::string& extension_id, const base::Version& version) { std::string id = GetExtensionRequestId(extension_id, version); AddExtensionInstallRequest(extension_id, version, base::BindOnce(ExtensionInstallRequestSent, id)); }
void SupervisedUserService::AddExtensionInstallRequest( const std::string& extension_id, const base::Version& version) { std::string id = GetExtensionRequestId(extension_id, version); AddExtensionInstallRequest(extension_id, version, base::BindOnce(ExtensionInstallRequestSent, id)); }
C
Chrome
0
CVE-2012-2900
https://www.cvedetails.com/cve/CVE-2012-2900/
null
https://github.com/chromium/chromium/commit/9597042cad54926f50d58f5ada39205eb734d7be
9597042cad54926f50d58f5ada39205eb734d7be
Revert 137988 - VAVDA is the hardware video decode accelerator for Chrome on Linux and ChromeOS for Intel CPUs (Sandy Bridge and newer). This CL enables VAVDA acceleration for ChromeOS, both for HTML5 video and Flash. The feature is currently hidden behind a command line flag and can be enabled by adding the --enable-vaapi parameter to command line. BUG=117062 TEST=Manual runs of test streams. Change-Id: I386e16739e2ef2230f52a0a434971b33d8654699 Review URL: https://chromiumcodereview.appspot.com/9814001 This is causing crbug.com/129103 [email protected] Review URL: https://chromiumcodereview.appspot.com/10411066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138208 0039d316-1c4b-4281-b951-d872f2087c98
~GpuMainThread() { Stop(); }
~GpuMainThread() { Stop(); }
C
Chrome
0
CVE-2017-5092
https://www.cvedetails.com/cve/CVE-2017-5092/
CWE-20
https://github.com/chromium/chromium/commit/66b99f3fe60dce77f079cc9c07164f6a34dbea37
66b99f3fe60dce77f079cc9c07164f6a34dbea37
Validate in-process plugin instance messages. Bug: 733548, 733549 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation Change-Id: Ie5572c7bcafa05399b09c44425ddd5ce9b9e4cba Reviewed-on: https://chromium-review.googlesource.com/538908 Commit-Queue: Bill Budge <[email protected]> Reviewed-by: Raymes Khoury <[email protected]> Cr-Commit-Position: refs/heads/master@{#480696}
BrowserPpapiHostImpl::HostMessageFilter::HostMessageFilter( ppapi::host::PpapiHost* ppapi_host, BrowserPpapiHostImpl* browser_ppapi_host_impl) : ppapi_host_(ppapi_host), browser_ppapi_host_impl_(browser_ppapi_host_impl) {}
BrowserPpapiHostImpl::HostMessageFilter::HostMessageFilter( ppapi::host::PpapiHost* ppapi_host, BrowserPpapiHostImpl* browser_ppapi_host_impl) : ppapi_host_(ppapi_host), browser_ppapi_host_impl_(browser_ppapi_host_impl) {}
C
Chrome
0
CVE-2010-1149
https://www.cvedetails.com/cve/CVE-2010-1149/
CWE-200
https://cgit.freedesktop.org/udisks/commit/?id=0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
0fcc7cb3b66f23fac53ae08647aa0007a2bd56c4
null
daemon_linux_lvm2_lv_stop_authorized_cb (Daemon *daemon, Device *device, DBusGMethodInvocation *context, const gchar *action_id, guint num_user_data, gpointer *user_data_elements) { gchar *name; /* TODO: use options */ guint n; gchar *argv[10]; name = NULL; if (!device->priv->device_is_linux_lvm2_lv) { throw_error (context, ERROR_FAILED, "Device is not a Linux LVM2 Logical Volume"); goto out; } /* Unfortunately lvchange does not (yet - file a bug) accept UUIDs */ name = g_strdup_printf ("%s/%s", device->priv->linux_lvm2_lv_group_name, device->priv->linux_lvm2_lv_name); n = 0; argv[n++] = "lvchange"; argv[n++] = "-an"; argv[n++] = name; argv[n++] = NULL; if (!job_new (context, "LinuxLvm2LVStop", TRUE, NULL, argv, NULL, linux_lvm2_lv_stop_completed_cb, FALSE, NULL, NULL)) { goto out; } out: g_free (name); }
daemon_linux_lvm2_lv_stop_authorized_cb (Daemon *daemon, Device *device, DBusGMethodInvocation *context, const gchar *action_id, guint num_user_data, gpointer *user_data_elements) { gchar *name; /* TODO: use options */ guint n; gchar *argv[10]; name = NULL; if (!device->priv->device_is_linux_lvm2_lv) { throw_error (context, ERROR_FAILED, "Device is not a Linux LVM2 Logical Volume"); goto out; } /* Unfortunately lvchange does not (yet - file a bug) accept UUIDs */ name = g_strdup_printf ("%s/%s", device->priv->linux_lvm2_lv_group_name, device->priv->linux_lvm2_lv_name); n = 0; argv[n++] = "lvchange"; argv[n++] = "-an"; argv[n++] = name; argv[n++] = NULL; if (!job_new (context, "LinuxLvm2LVStop", TRUE, NULL, argv, NULL, linux_lvm2_lv_stop_completed_cb, FALSE, NULL, NULL)) { goto out; } out: g_free (name); }
C
udisks
0
CVE-2015-1331
https://www.cvedetails.com/cve/CVE-2015-1331/
CWE-59
https://github.com/lxc/lxc/commit/72cf81f6a3404e35028567db2c99a90406e9c6e6
72cf81f6a3404e35028567db2c99a90406e9c6e6
CVE-2015-1331: lxclock: use /run/lxc/lock rather than /run/lock/lxc This prevents an unprivileged user to use LXC to create arbitrary file on the filesystem. Signed-off-by: Serge Hallyn <[email protected]> Signed-off-by: Tyler Hicks <[email protected]> Acked-by: Stéphane Graber <[email protected]>
int container_disk_lock(struct lxc_container *c) { int ret; if ((ret = lxclock(c->privlock, 0))) return ret; if ((ret = lxclock(c->slock, 0))) { lxcunlock(c->privlock); return ret; } return 0; }
int container_disk_lock(struct lxc_container *c) { int ret; if ((ret = lxclock(c->privlock, 0))) return ret; if ((ret = lxclock(c->slock, 0))) { lxcunlock(c->privlock); return ret; } return 0; }
C
lxc
0