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-2013-6431
https://www.cvedetails.com/cve/CVE-2013-6431/
CWE-264
https://github.com/torvalds/linux/commit/ae7b4e1f213aa659aedf9c6ecad0bf5f0476e1e2
ae7b4e1f213aa659aedf9c6ecad0bf5f0476e1e2
net: fib: fib6_add: fix potential NULL pointer dereference When the kernel is compiled with CONFIG_IPV6_SUBTREES, and we return with an error in fn = fib6_add_1(), then error codes are encoded into the return pointer e.g. ERR_PTR(-ENOENT). In such an error case, we write the error code into err and jump to out, hence enter the if(err) condition. Now, if CONFIG_IPV6_SUBTREES is enabled, we check for: if (pn != fn && pn->leaf == rt) ... if (pn != fn && !pn->leaf && !(pn->fn_flags & RTN_RTINFO)) ... Since pn is NULL and fn is f.e. ERR_PTR(-ENOENT), then pn != fn evaluates to true and causes a NULL-pointer dereference on further checks on pn. Fix it, by setting both NULL in error case, so that pn != fn already evaluates to false and no further dereference takes place. This was first correctly implemented in 4a287eba2 ("IPv6 routing, NLM_F_* flag support: REPLACE and EXCL flags support, warn about missing CREATE flag"), but the bug got later on introduced by 188c517a0 ("ipv6: return errno pointers consistently for fib6_add_1()"). Signed-off-by: Daniel Borkmann <[email protected]> Cc: Lin Ming <[email protected]> Cc: Matti Vaittinen <[email protected]> Cc: Hannes Frederic Sowa <[email protected]> Acked-by: Hannes Frederic Sowa <[email protected]> Acked-by: Matti Vaittinen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void __net_init fib6_tables_init(struct net *net) { fib6_link_table(net, net->ipv6.fib6_main_tbl); }
static void __net_init fib6_tables_init(struct net *net) { fib6_link_table(net, net->ipv6.fib6_main_tbl); }
C
linux
0
CVE-2011-3346
https://www.cvedetails.com/cve/CVE-2011-3346/
CWE-119
https://github.com/bonzini/qemu/commit/7285477ab11831b1cf56e45878a89170dd06d9b9
7285477ab11831b1cf56e45878a89170dd06d9b9
scsi-disk: lazily allocate bounce buffer It will not be needed for reads and writes if the HBA provides a sglist. In addition, this lets scsi-disk refuse commands with an excessive allocation length, as well as limit memory on usual well-behaved guests. Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf) static int scsi_disk_emulate_command(SCSIDiskReq *r) { SCSIRequest *req = &r->req; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); uint64_t nb_sectors; uint8_t *outbuf; int buflen = 0; if (!r->iov.iov_base) { /* * FIXME: we shouldn't return anything bigger than 4k, but the code * requires the buffer to be as big as req->cmd.xfer in several * places. So, do not allow CDBs with a very large ALLOCATION * LENGTH. The real fix would be to modify scsi_read_data and * dma_buf_read, so that they return data beyond the buflen * as all zeros. */ if (req->cmd.xfer > 65536) { goto illegal_request; } r->buflen = MAX(4096, req->cmd.xfer); r->iov.iov_base = qemu_blockalign(s->bs, r->buflen); } outbuf = r->iov.iov_base; switch (req->cmd.buf[0]) { case TEST_UNIT_READY: if (s->tray_open || !bdrv_is_inserted(s->bs)) goto not_ready; break; case INQUIRY: buflen = scsi_disk_emulate_inquiry(req, outbuf); if (buflen < 0) goto illegal_request; break; case MODE_SENSE: case MODE_SENSE_10: buflen = scsi_disk_emulate_mode_sense(r, outbuf); if (buflen < 0) goto illegal_request; break; case READ_TOC: buflen = scsi_disk_emulate_read_toc(req, outbuf); if (buflen < 0) goto illegal_request; break; case RESERVE: if (req->cmd.buf[1] & 1) goto illegal_request; break; case RESERVE_10: if (req->cmd.buf[1] & 3) goto illegal_request; break; case RELEASE: if (req->cmd.buf[1] & 1) goto illegal_request; break; case RELEASE_10: if (req->cmd.buf[1] & 3) goto illegal_request; break; case START_STOP: if (scsi_disk_emulate_start_stop(r) < 0) { return -1; } break; case ALLOW_MEDIUM_REMOVAL: s->tray_locked = req->cmd.buf[4] & 1; bdrv_lock_medium(s->bs, req->cmd.buf[4] & 1); break; case READ_CAPACITY_10: /* The normal LEN field for this command is zero. */ memset(outbuf, 0, 8); bdrv_get_geometry(s->bs, &nb_sectors); if (!nb_sectors) goto not_ready; nb_sectors /= s->cluster_size; /* Returned value is the address of the last sector. */ nb_sectors--; /* Remember the new size for read/write sanity checking. */ s->max_lba = nb_sectors; /* Clip to 2TB, instead of returning capacity modulo 2TB. */ if (nb_sectors > UINT32_MAX) nb_sectors = UINT32_MAX; outbuf[0] = (nb_sectors >> 24) & 0xff; outbuf[1] = (nb_sectors >> 16) & 0xff; outbuf[2] = (nb_sectors >> 8) & 0xff; outbuf[3] = nb_sectors & 0xff; outbuf[4] = 0; outbuf[5] = 0; outbuf[6] = s->cluster_size * 2; outbuf[7] = 0; buflen = 8; break; case GET_CONFIGURATION: memset(outbuf, 0, 8); /* ??? This should probably return much more information. For now just return the basic header indicating the CD-ROM profile. */ outbuf[7] = 8; // CD-ROM buflen = 8; break; case SERVICE_ACTION_IN_16: /* Service Action In subcommands. */ if ((req->cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) { DPRINTF("SAI READ CAPACITY(16)\n"); memset(outbuf, 0, req->cmd.xfer); bdrv_get_geometry(s->bs, &nb_sectors); if (!nb_sectors) goto not_ready; nb_sectors /= s->cluster_size; /* Returned value is the address of the last sector. */ nb_sectors--; /* Remember the new size for read/write sanity checking. */ s->max_lba = nb_sectors; outbuf[0] = (nb_sectors >> 56) & 0xff; outbuf[1] = (nb_sectors >> 48) & 0xff; outbuf[2] = (nb_sectors >> 40) & 0xff; outbuf[3] = (nb_sectors >> 32) & 0xff; outbuf[4] = (nb_sectors >> 24) & 0xff; outbuf[5] = (nb_sectors >> 16) & 0xff; outbuf[6] = (nb_sectors >> 8) & 0xff; outbuf[7] = nb_sectors & 0xff; outbuf[8] = 0; outbuf[9] = 0; outbuf[10] = s->cluster_size * 2; outbuf[11] = 0; outbuf[12] = 0; outbuf[13] = get_physical_block_exp(&s->qdev.conf); /* set TPE bit if the format supports discard */ if (s->qdev.conf.discard_granularity) { outbuf[14] = 0x80; } /* Protection, exponent and lowest lba field left blank. */ buflen = req->cmd.xfer; break; } DPRINTF("Unsupported Service Action In\n"); goto illegal_request; case VERIFY_10: break; default: scsi_check_condition(r, SENSE_CODE(INVALID_OPCODE)); return -1; } return buflen; not_ready: if (s->tray_open || !bdrv_is_inserted(s->bs)) { scsi_check_condition(r, SENSE_CODE(NO_MEDIUM)); } else { scsi_check_condition(r, SENSE_CODE(LUN_NOT_READY)); } return -1; illegal_request: if (r->req.status == -1) { scsi_check_condition(r, SENSE_CODE(INVALID_FIELD)); } return -1; }
static int scsi_disk_emulate_command(SCSIDiskReq *r, uint8_t *outbuf) { SCSIRequest *req = &r->req; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); uint64_t nb_sectors; int buflen = 0; switch (req->cmd.buf[0]) { case TEST_UNIT_READY: if (s->tray_open || !bdrv_is_inserted(s->bs)) goto not_ready; break; case INQUIRY: buflen = scsi_disk_emulate_inquiry(req, outbuf); if (buflen < 0) goto illegal_request; break; case MODE_SENSE: case MODE_SENSE_10: buflen = scsi_disk_emulate_mode_sense(r, outbuf); if (buflen < 0) goto illegal_request; break; case READ_TOC: buflen = scsi_disk_emulate_read_toc(req, outbuf); if (buflen < 0) goto illegal_request; break; case RESERVE: if (req->cmd.buf[1] & 1) goto illegal_request; break; case RESERVE_10: if (req->cmd.buf[1] & 3) goto illegal_request; break; case RELEASE: if (req->cmd.buf[1] & 1) goto illegal_request; break; case RELEASE_10: if (req->cmd.buf[1] & 3) goto illegal_request; break; case START_STOP: if (scsi_disk_emulate_start_stop(r) < 0) { return -1; } break; case ALLOW_MEDIUM_REMOVAL: s->tray_locked = req->cmd.buf[4] & 1; bdrv_lock_medium(s->bs, req->cmd.buf[4] & 1); break; case READ_CAPACITY_10: /* The normal LEN field for this command is zero. */ memset(outbuf, 0, 8); bdrv_get_geometry(s->bs, &nb_sectors); if (!nb_sectors) goto not_ready; nb_sectors /= s->cluster_size; /* Returned value is the address of the last sector. */ nb_sectors--; /* Remember the new size for read/write sanity checking. */ s->max_lba = nb_sectors; /* Clip to 2TB, instead of returning capacity modulo 2TB. */ if (nb_sectors > UINT32_MAX) nb_sectors = UINT32_MAX; outbuf[0] = (nb_sectors >> 24) & 0xff; outbuf[1] = (nb_sectors >> 16) & 0xff; outbuf[2] = (nb_sectors >> 8) & 0xff; outbuf[3] = nb_sectors & 0xff; outbuf[4] = 0; outbuf[5] = 0; outbuf[6] = s->cluster_size * 2; outbuf[7] = 0; buflen = 8; break; case GET_CONFIGURATION: memset(outbuf, 0, 8); /* ??? This should probably return much more information. For now just return the basic header indicating the CD-ROM profile. */ outbuf[7] = 8; // CD-ROM buflen = 8; break; case SERVICE_ACTION_IN_16: /* Service Action In subcommands. */ if ((req->cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) { DPRINTF("SAI READ CAPACITY(16)\n"); memset(outbuf, 0, req->cmd.xfer); bdrv_get_geometry(s->bs, &nb_sectors); if (!nb_sectors) goto not_ready; nb_sectors /= s->cluster_size; /* Returned value is the address of the last sector. */ nb_sectors--; /* Remember the new size for read/write sanity checking. */ s->max_lba = nb_sectors; outbuf[0] = (nb_sectors >> 56) & 0xff; outbuf[1] = (nb_sectors >> 48) & 0xff; outbuf[2] = (nb_sectors >> 40) & 0xff; outbuf[3] = (nb_sectors >> 32) & 0xff; outbuf[4] = (nb_sectors >> 24) & 0xff; outbuf[5] = (nb_sectors >> 16) & 0xff; outbuf[6] = (nb_sectors >> 8) & 0xff; outbuf[7] = nb_sectors & 0xff; outbuf[8] = 0; outbuf[9] = 0; outbuf[10] = s->cluster_size * 2; outbuf[11] = 0; outbuf[12] = 0; outbuf[13] = get_physical_block_exp(&s->qdev.conf); /* set TPE bit if the format supports discard */ if (s->qdev.conf.discard_granularity) { outbuf[14] = 0x80; } /* Protection, exponent and lowest lba field left blank. */ buflen = req->cmd.xfer; break; } DPRINTF("Unsupported Service Action In\n"); goto illegal_request; case VERIFY_10: break; default: scsi_check_condition(r, SENSE_CODE(INVALID_OPCODE)); return -1; } return buflen; not_ready: if (s->tray_open || !bdrv_is_inserted(s->bs)) { scsi_check_condition(r, SENSE_CODE(NO_MEDIUM)); } else { scsi_check_condition(r, SENSE_CODE(LUN_NOT_READY)); } return -1; illegal_request: if (r->req.status == -1) { scsi_check_condition(r, SENSE_CODE(INVALID_FIELD)); } return -1; }
C
qemu
1
CVE-2017-18203
https://www.cvedetails.com/cve/CVE-2017-18203/
CWE-362
https://github.com/torvalds/linux/commit/b9a41d21dceadf8104812626ef85dc56ee8a60ed
b9a41d21dceadf8104812626ef85dc56ee8a60ed
dm: fix race between dm_get_from_kobject() and __dm_destroy() The following BUG_ON was hit when testing repeat creation and removal of DM devices: kernel BUG at drivers/md/dm.c:2919! CPU: 7 PID: 750 Comm: systemd-udevd Not tainted 4.1.44 Call Trace: [<ffffffff81649e8b>] dm_get_from_kobject+0x34/0x3a [<ffffffff81650ef1>] dm_attr_show+0x2b/0x5e [<ffffffff817b46d1>] ? mutex_lock+0x26/0x44 [<ffffffff811df7f5>] sysfs_kf_seq_show+0x83/0xcf [<ffffffff811de257>] kernfs_seq_show+0x23/0x25 [<ffffffff81199118>] seq_read+0x16f/0x325 [<ffffffff811de994>] kernfs_fop_read+0x3a/0x13f [<ffffffff8117b625>] __vfs_read+0x26/0x9d [<ffffffff8130eb59>] ? security_file_permission+0x3c/0x44 [<ffffffff8117bdb8>] ? rw_verify_area+0x83/0xd9 [<ffffffff8117be9d>] vfs_read+0x8f/0xcf [<ffffffff81193e34>] ? __fdget_pos+0x12/0x41 [<ffffffff8117c686>] SyS_read+0x4b/0x76 [<ffffffff817b606e>] system_call_fastpath+0x12/0x71 The bug can be easily triggered, if an extra delay (e.g. 10ms) is added between the test of DMF_FREEING & DMF_DELETING and dm_get() in dm_get_from_kobject(). To fix it, we need to ensure the test of DMF_FREEING & DMF_DELETING and dm_get() are done in an atomic way, so _minor_lock is used. The other callers of dm_get() have also been checked to be OK: some callers invoke dm_get() under _minor_lock, some callers invoke it under _hash_lock, and dm_start_request() invoke it after increasing md->open_count. Cc: [email protected] Signed-off-by: Hou Tao <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
static int __send_write_same(struct clone_info *ci) { return __send_changing_extent_only(ci, get_num_write_same_bios, NULL); }
static int __send_write_same(struct clone_info *ci) { return __send_changing_extent_only(ci, get_num_write_same_bios, NULL); }
C
linux
0
CVE-2017-18190
https://www.cvedetails.com/cve/CVE-2017-18190/
CWE-290
https://github.com/apple/cups/commit/afa80cb2b457bf8d64f775bed307588610476c41
afa80cb2b457bf8d64f775bed307588610476c41
Don't treat "localhost.localdomain" as an allowed replacement for localhost, since it isn't.
install_cupsd_conf(cupsd_client_t *con) /* I - Connection */ { char filename[1024]; /* Configuration filename */ cups_file_t *in, /* Input file */ *out; /* Output file */ char buffer[16384]; /* Copy buffer */ ssize_t bytes; /* Number of bytes */ /* * Open the request file... */ if ((in = cupsFileOpen(con->filename, "rb")) == NULL) { cupsdLogClient(con, CUPSD_LOG_ERROR, "Unable to open request file \"%s\": %s", con->filename, strerror(errno)); goto server_error; } /* * Open the new config file... */ if ((out = cupsdCreateConfFile(ConfigurationFile, ConfigFilePerm)) == NULL) { cupsFileClose(in); goto server_error; } cupsdLogClient(con, CUPSD_LOG_INFO, "Installing config file \"%s\"...", ConfigurationFile); /* * Copy from the request to the new config file... */ while ((bytes = cupsFileRead(in, buffer, sizeof(buffer))) > 0) if (cupsFileWrite(out, buffer, (size_t)bytes) < bytes) { cupsdLogClient(con, CUPSD_LOG_ERROR, "Unable to copy to config file \"%s\": %s", ConfigurationFile, strerror(errno)); cupsFileClose(in); cupsFileClose(out); snprintf(filename, sizeof(filename), "%s.N", ConfigurationFile); cupsdUnlinkOrRemoveFile(filename); goto server_error; } /* * Close the files... */ cupsFileClose(in); if (cupsdCloseCreatedConfFile(out, ConfigurationFile)) goto server_error; /* * Remove the request file... */ cupsdUnlinkOrRemoveFile(con->filename); cupsdClearString(&con->filename); /* * Set the NeedReload flag... */ NeedReload = RELOAD_CUPSD; ReloadTime = time(NULL); /* * Return that the file was created successfully... */ return (HTTP_STATUS_CREATED); /* * Common exit for errors... */ server_error: cupsdUnlinkOrRemoveFile(con->filename); cupsdClearString(&con->filename); return (HTTP_STATUS_SERVER_ERROR); }
install_cupsd_conf(cupsd_client_t *con) /* I - Connection */ { char filename[1024]; /* Configuration filename */ cups_file_t *in, /* Input file */ *out; /* Output file */ char buffer[16384]; /* Copy buffer */ ssize_t bytes; /* Number of bytes */ /* * Open the request file... */ if ((in = cupsFileOpen(con->filename, "rb")) == NULL) { cupsdLogClient(con, CUPSD_LOG_ERROR, "Unable to open request file \"%s\": %s", con->filename, strerror(errno)); goto server_error; } /* * Open the new config file... */ if ((out = cupsdCreateConfFile(ConfigurationFile, ConfigFilePerm)) == NULL) { cupsFileClose(in); goto server_error; } cupsdLogClient(con, CUPSD_LOG_INFO, "Installing config file \"%s\"...", ConfigurationFile); /* * Copy from the request to the new config file... */ while ((bytes = cupsFileRead(in, buffer, sizeof(buffer))) > 0) if (cupsFileWrite(out, buffer, (size_t)bytes) < bytes) { cupsdLogClient(con, CUPSD_LOG_ERROR, "Unable to copy to config file \"%s\": %s", ConfigurationFile, strerror(errno)); cupsFileClose(in); cupsFileClose(out); snprintf(filename, sizeof(filename), "%s.N", ConfigurationFile); cupsdUnlinkOrRemoveFile(filename); goto server_error; } /* * Close the files... */ cupsFileClose(in); if (cupsdCloseCreatedConfFile(out, ConfigurationFile)) goto server_error; /* * Remove the request file... */ cupsdUnlinkOrRemoveFile(con->filename); cupsdClearString(&con->filename); /* * Set the NeedReload flag... */ NeedReload = RELOAD_CUPSD; ReloadTime = time(NULL); /* * Return that the file was created successfully... */ return (HTTP_STATUS_CREATED); /* * Common exit for errors... */ server_error: cupsdUnlinkOrRemoveFile(con->filename); cupsdClearString(&con->filename); return (HTTP_STATUS_SERVER_ERROR); }
C
cups
0
CVE-2011-2350
https://www.cvedetails.com/cve/CVE-2011-2350/
CWE-20
https://github.com/chromium/chromium/commit/b944f670bb7a8a919daac497a4ea0536c954c201
b944f670bb7a8a919daac497a4ea0536c954c201
[JSC] Implement a helper method createNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=85102 Reviewed by Geoffrey Garen. In bug 84787, kbr@ requested to avoid hard-coding createTypeError(exec, "Not enough arguments") here and there. This patch implements createNotEnoughArgumentsError(exec) and uses it in JSC bindings. c.f. a corresponding bug for V8 bindings is bug 85097. Source/JavaScriptCore: * runtime/Error.cpp: (JSC::createNotEnoughArgumentsError): (JSC): * runtime/Error.h: (JSC): Source/WebCore: Test: bindings/scripts/test/TestObj.idl * bindings/scripts/CodeGeneratorJS.pm: Modified as described above. (GenerateArgumentsCountCheck): * bindings/js/JSDataViewCustom.cpp: Ditto. (WebCore::getDataViewMember): (WebCore::setDataViewMember): * bindings/js/JSDeprecatedPeerConnectionCustom.cpp: (WebCore::JSDeprecatedPeerConnectionConstructor::constructJSDeprecatedPeerConnection): * bindings/js/JSDirectoryEntryCustom.cpp: (WebCore::JSDirectoryEntry::getFile): (WebCore::JSDirectoryEntry::getDirectory): * bindings/js/JSSharedWorkerCustom.cpp: (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): * bindings/js/JSWebKitMutationObserverCustom.cpp: (WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver): (WebCore::JSWebKitMutationObserver::observe): * bindings/js/JSWorkerCustom.cpp: (WebCore::JSWorkerConstructor::constructJSWorker): * bindings/scripts/test/JS/JSFloat64Array.cpp: Updated run-bindings-tests. (WebCore::jsFloat64ArrayPrototypeFunctionFoo): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage): * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetPrototypeFunctionItem): (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener): (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener): (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::constructJSTestInterface): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::constructJSTestObj): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg): (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): (WebCore::jsTestObjPrototypeFunctionSerializedValue): (WebCore::jsTestObjPrototypeFunctionIdbKey): (WebCore::jsTestObjPrototypeFunctionOptionsObject): (WebCore::jsTestObjPrototypeFunctionAddEventListener): (WebCore::jsTestObjPrototypeFunctionRemoveEventListener): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7): (WebCore::jsTestObjConstructorFunctionClassMethod2): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongArray): (WebCore::jsTestObjPrototypeFunctionConvert1): (WebCore::jsTestObjPrototypeFunctionConvert2): (WebCore::jsTestObjPrototypeFunctionConvert3): (WebCore::jsTestObjPrototypeFunctionConvert4): (WebCore::jsTestObjPrototypeFunctionConvert5): (WebCore::jsTestObjPrototypeFunctionStrictFunction): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList): git-svn-id: svn://svn.chromium.org/blink/trunk@115536 bbb929c8-8fbe-4397-9dbb-9b2b20218538
EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunction(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestActiveDOMObject::s_info)) return throwVMTypeError(exec); JSTestActiveDOMObject* castedThis = jsCast<JSTestActiveDOMObject*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestActiveDOMObject::s_info); if (!castedThis->allowsAccessFrom(exec)) return JSValue::encode(jsUndefined()); TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl()); if (exec->argumentCount() < 1) return throwVMError(exec, createNotEnoughArgumentsError(exec)); Node* nextChild(toNode(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined))); if (exec->hadException()) return JSValue::encode(jsUndefined()); impl->excitingFunction(nextChild); return JSValue::encode(jsUndefined()); }
EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunction(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestActiveDOMObject::s_info)) return throwVMTypeError(exec); JSTestActiveDOMObject* castedThis = jsCast<JSTestActiveDOMObject*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestActiveDOMObject::s_info); if (!castedThis->allowsAccessFrom(exec)) return JSValue::encode(jsUndefined()); TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl()); if (exec->argumentCount() < 1) return throwVMError(exec, createTypeError(exec, "Not enough arguments")); Node* nextChild(toNode(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined))); if (exec->hadException()) return JSValue::encode(jsUndefined()); impl->excitingFunction(nextChild); return JSValue::encode(jsUndefined()); }
C
Chrome
1
CVE-2014-7904
https://www.cvedetails.com/cve/CVE-2014-7904/
CWE-119
https://github.com/chromium/chromium/commit/9965adea952e84c925de418e971b204dfda7d6e0
9965adea952e84c925de418e971b204dfda7d6e0
Replace fixed string uses of AddHeaderFromString Uses of AddHeaderFromString() with a static string may as well be replaced with SetHeader(). Do so. BUG=None Review-Url: https://codereview.chromium.org/2236933005 Cr-Commit-Position: refs/heads/master@{#418161}
void TestTransactionConsumer::Read() { state_ = READING; read_buf_ = new IOBuffer(1024); int result = trans_->Read(read_buf_.get(), 1024, base::Bind(&TestTransactionConsumer::OnIOComplete, base::Unretained(this))); if (result != ERR_IO_PENDING) DidRead(result); }
void TestTransactionConsumer::Read() { state_ = READING; read_buf_ = new IOBuffer(1024); int result = trans_->Read(read_buf_.get(), 1024, base::Bind(&TestTransactionConsumer::OnIOComplete, base::Unretained(this))); if (result != ERR_IO_PENDING) DidRead(result); }
C
Chrome
0
CVE-2017-8068
https://www.cvedetails.com/cve/CVE-2017-8068/
CWE-119
https://github.com/torvalds/linux/commit/5593523f968bc86d42a035c6df47d5e0979b5ace
5593523f968bc86d42a035c6df47d5e0979b5ace
pegasus: Use heap buffers for all register access Allocating USB buffers on the stack is not portable, and no longer works on x86_64 (with VMAP_STACK enabled as per default). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") References: https://bugs.debian.org/852556 Reported-by: Lisandro Damián Nicanor Pérez Meyer <[email protected]> Tested-by: Lisandro Damián Nicanor Pérez Meyer <[email protected]> Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static inline int reset_mac(pegasus_t *pegasus) { __u8 data = 0x8; int i; set_register(pegasus, EthCtrl1, data); for (i = 0; i < REG_TIMEOUT; i++) { get_registers(pegasus, EthCtrl1, 1, &data); if (~data & 0x08) { if (loopback) break; if (mii_mode && (pegasus->features & HAS_HOME_PNA)) set_register(pegasus, Gpio1, 0x34); else set_register(pegasus, Gpio1, 0x26); set_register(pegasus, Gpio0, pegasus->features); set_register(pegasus, Gpio0, DEFAULT_GPIO_SET); break; } } if (i == REG_TIMEOUT) return -ETIMEDOUT; if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS || usb_dev_id[pegasus->dev_index].vendor == VENDOR_DLINK) { set_register(pegasus, Gpio0, 0x24); set_register(pegasus, Gpio0, 0x26); } if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_ELCON) { __u16 auxmode; read_mii_word(pegasus, 3, 0x1b, &auxmode); auxmode |= 4; write_mii_word(pegasus, 3, 0x1b, &auxmode); } return 0; }
static inline int reset_mac(pegasus_t *pegasus) { __u8 data = 0x8; int i; set_register(pegasus, EthCtrl1, data); for (i = 0; i < REG_TIMEOUT; i++) { get_registers(pegasus, EthCtrl1, 1, &data); if (~data & 0x08) { if (loopback) break; if (mii_mode && (pegasus->features & HAS_HOME_PNA)) set_register(pegasus, Gpio1, 0x34); else set_register(pegasus, Gpio1, 0x26); set_register(pegasus, Gpio0, pegasus->features); set_register(pegasus, Gpio0, DEFAULT_GPIO_SET); break; } } if (i == REG_TIMEOUT) return -ETIMEDOUT; if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_LINKSYS || usb_dev_id[pegasus->dev_index].vendor == VENDOR_DLINK) { set_register(pegasus, Gpio0, 0x24); set_register(pegasus, Gpio0, 0x26); } if (usb_dev_id[pegasus->dev_index].vendor == VENDOR_ELCON) { __u16 auxmode; read_mii_word(pegasus, 3, 0x1b, &auxmode); auxmode |= 4; write_mii_word(pegasus, 3, 0x1b, &auxmode); } return 0; }
C
linux
0
CVE-2016-0850
https://www.cvedetails.com/cve/CVE-2016-0850/
CWE-264
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/c677ee92595335233eb0e7b59809a1a94e7a678a
c677ee92595335233eb0e7b59809a1a94e7a678a
DO NOT MERGE Remove Porsche car-kit pairing workaround Bug: 26551752 Change-Id: I14c5e3fcda0849874c8a94e48aeb7d09585617e1
BOOLEAN btm_sec_are_all_trusted(UINT32 p_mask[]) { UINT32 trusted_inx; for (trusted_inx = 0; trusted_inx < BTM_SEC_SERVICE_ARRAY_SIZE; trusted_inx++) { if (p_mask[trusted_inx] != BTM_SEC_TRUST_ALL) return(FALSE); } return(TRUE); }
BOOLEAN btm_sec_are_all_trusted(UINT32 p_mask[]) { UINT32 trusted_inx; for (trusted_inx = 0; trusted_inx < BTM_SEC_SERVICE_ARRAY_SIZE; trusted_inx++) { if (p_mask[trusted_inx] != BTM_SEC_TRUST_ALL) return(FALSE); } return(TRUE); }
C
Android
0
CVE-2018-8099
https://www.cvedetails.com/cve/CVE-2018-8099/
CWE-415
https://github.com/libgit2/libgit2/commit/58a6fe94cb851f71214dbefac3f9bffee437d6fe
58a6fe94cb851f71214dbefac3f9bffee437d6fe
index: convert `read_entry` to return entry size via an out-param The function `read_entry` does not conform to our usual coding style of returning stuff via the out parameter and to use the return value for reporting errors. Due to most of our code conforming to that pattern, it has become quite natural for us to actually return `-1` in case there is any error, which has also slipped in with commit 5625d86b9 (index: support index v4, 2016-05-17). As the function returns an `size_t` only, though, the return value is wrapped around, causing the caller of `read_tree` to continue with an invalid index entry. Ultimately, this can lead to a double-free. Improve code and fix the bug by converting the function to return the index entry size via an out parameter and only using the return value to indicate errors. Reported-by: Krishna Ram Prakash R <[email protected]> Reported-by: Vivek Parikh <[email protected]>
static size_t read_extension(git_index *index, const char *buffer, size_t buffer_size) { struct index_extension dest; size_t total_size; /* buffer is not guaranteed to be aligned */ memcpy(&dest, buffer, sizeof(struct index_extension)); dest.extension_size = ntohl(dest.extension_size); total_size = dest.extension_size + sizeof(struct index_extension); if (dest.extension_size > total_size || buffer_size < total_size || buffer_size - total_size < INDEX_FOOTER_SIZE) return 0; /* optional extension */ if (dest.signature[0] >= 'A' && dest.signature[0] <= 'Z') { /* tree cache */ if (memcmp(dest.signature, INDEX_EXT_TREECACHE_SIG, 4) == 0) { if (git_tree_cache_read(&index->tree, buffer + 8, dest.extension_size, &index->tree_pool) < 0) return 0; } else if (memcmp(dest.signature, INDEX_EXT_UNMERGED_SIG, 4) == 0) { if (read_reuc(index, buffer + 8, dest.extension_size) < 0) return 0; } else if (memcmp(dest.signature, INDEX_EXT_CONFLICT_NAME_SIG, 4) == 0) { if (read_conflict_names(index, buffer + 8, dest.extension_size) < 0) return 0; } /* else, unsupported extension. We cannot parse this, but we can skip * it by returning `total_size */ } else { /* we cannot handle non-ignorable extensions; * in fact they aren't even defined in the standard */ return 0; } return total_size; }
static size_t read_extension(git_index *index, const char *buffer, size_t buffer_size) { struct index_extension dest; size_t total_size; /* buffer is not guaranteed to be aligned */ memcpy(&dest, buffer, sizeof(struct index_extension)); dest.extension_size = ntohl(dest.extension_size); total_size = dest.extension_size + sizeof(struct index_extension); if (dest.extension_size > total_size || buffer_size < total_size || buffer_size - total_size < INDEX_FOOTER_SIZE) return 0; /* optional extension */ if (dest.signature[0] >= 'A' && dest.signature[0] <= 'Z') { /* tree cache */ if (memcmp(dest.signature, INDEX_EXT_TREECACHE_SIG, 4) == 0) { if (git_tree_cache_read(&index->tree, buffer + 8, dest.extension_size, &index->tree_pool) < 0) return 0; } else if (memcmp(dest.signature, INDEX_EXT_UNMERGED_SIG, 4) == 0) { if (read_reuc(index, buffer + 8, dest.extension_size) < 0) return 0; } else if (memcmp(dest.signature, INDEX_EXT_CONFLICT_NAME_SIG, 4) == 0) { if (read_conflict_names(index, buffer + 8, dest.extension_size) < 0) return 0; } /* else, unsupported extension. We cannot parse this, but we can skip * it by returning `total_size */ } else { /* we cannot handle non-ignorable extensions; * in fact they aren't even defined in the standard */ return 0; } return total_size; }
C
libgit2
0
null
null
null
https://github.com/chromium/chromium/commit/27c68f543e5eba779902447445dfb05ec3f5bf75
27c68f543e5eba779902447445dfb05ec3f5bf75
Revert of Add accelerated VP9 decode infrastructure and an implementation for VA-API. (patchset #7 id:260001 of https://codereview.chromium.org/1318863003/ ) Reason for revert: I think this patch broke compile step for Chromium Linux ChromeOS MSan Builder. First failing build: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20Linux%20ChromeOS%20MSan%20Builder/builds/8310 All recent builds: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20Linux%20ChromeOS%20MSan%20Builder?numbuilds=200 Sorry for the revert. I'll re-revert if I'm wrong. Cheers, Tommy Original issue's description: > Add accelerated VP9 decode infrastructure and an implementation for VA-API. > > - Add a hardware/platform-independent VP9Decoder class and related > infrastructure, implementing AcceleratedVideoDecoder interface. VP9Decoder > performs the initial stages of the decode process, which are to be done > on host/in software, such as stream parsing and reference frame management. > > - Add a VP9Accelerator interface, used by the VP9Decoder to offload the > remaining stages of the decode process to hardware. VP9Accelerator > implementations are platform-specific. > > - Add the first implementation of VP9Accelerator - VaapiVP9Accelerator - and > integrate it with VaapiVideoDecodeAccelerator, for devices which provide > hardware VP9 acceleration through VA-API. Hook it up to the new > infrastructure and VP9Decoder. > > - Extend Vp9Parser to provide functionality required by VP9Decoder and > VP9Accelerator, including superframe parsing, handling of loop filter > and segmentation initialization, state persistence across frames and > resetting when needed. Also add code calculating segmentation dequants > and loop filter levels. > > - Update vp9_parser_unittest to the new Vp9Parser interface and flow. > > TEST=vp9_parser_unittest,vda_unittest,Chrome VP9 playback > BUG=chrome-os-partner:41469,chrome-os-partner:41470,chromium:525331 > [email protected] > > Committed: https://crrev.com/e3cc0a661b8abfdc74f569940949bc1f336ece40 > Cr-Commit-Position: refs/heads/master@{#349312} [email protected],[email protected],[email protected],[email protected],[email protected] NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chrome-os-partner:41469,chrome-os-partner:41470,chromium:525331 Review URL: https://codereview.chromium.org/1357513002 Cr-Commit-Position: refs/heads/master@{#349443}
bool VaapiWrapper::CreateSurfaces(unsigned int va_format, const gfx::Size& size, size_t num_surfaces, std::vector<VASurfaceID>* va_surfaces) { base::AutoLock auto_lock(*va_lock_); DVLOG(2) << "Creating " << num_surfaces << " surfaces"; DCHECK(va_surfaces->empty()); DCHECK(va_surface_ids_.empty()); va_surface_ids_.resize(num_surfaces); VAStatus va_res = vaCreateSurfaces(va_display_, va_format, size.width(), size.height(), &va_surface_ids_[0], va_surface_ids_.size(), NULL, 0); VA_LOG_ON_ERROR(va_res, "vaCreateSurfaces failed"); if (va_res != VA_STATUS_SUCCESS) { va_surface_ids_.clear(); return false; } va_res = vaCreateContext(va_display_, va_config_id_, size.width(), size.height(), VA_PROGRESSIVE, &va_surface_ids_[0], va_surface_ids_.size(), &va_context_id_); VA_LOG_ON_ERROR(va_res, "vaCreateContext failed"); if (va_res != VA_STATUS_SUCCESS) { DestroySurfaces(); return false; } *va_surfaces = va_surface_ids_; return true; }
bool VaapiWrapper::CreateSurfaces(unsigned int va_format, const gfx::Size& size, size_t num_surfaces, std::vector<VASurfaceID>* va_surfaces) { base::AutoLock auto_lock(*va_lock_); DVLOG(2) << "Creating " << num_surfaces << " surfaces"; DCHECK(va_surfaces->empty()); DCHECK(va_surface_ids_.empty()); va_surface_ids_.resize(num_surfaces); VAStatus va_res = vaCreateSurfaces(va_display_, va_format, size.width(), size.height(), &va_surface_ids_[0], va_surface_ids_.size(), NULL, 0); VA_LOG_ON_ERROR(va_res, "vaCreateSurfaces failed"); if (va_res != VA_STATUS_SUCCESS) { va_surface_ids_.clear(); return false; } va_res = vaCreateContext(va_display_, va_config_id_, size.width(), size.height(), VA_PROGRESSIVE, &va_surface_ids_[0], va_surface_ids_.size(), &va_context_id_); VA_LOG_ON_ERROR(va_res, "vaCreateContext failed"); if (va_res != VA_STATUS_SUCCESS) { DestroySurfaces(); return false; } *va_surfaces = va_surface_ids_; return true; }
C
Chrome
0
CVE-2011-3104
https://www.cvedetails.com/cve/CVE-2011-3104/
CWE-119
https://github.com/chromium/chromium/commit/6b5f83842b5edb5d4bd6684b196b3630c6769731
6b5f83842b5edb5d4bd6684b196b3630c6769731
[i18n-fixlet] Make strings branding specific in extension code. IDS_EXTENSIONS_UNINSTALL IDS_EXTENSIONS_INCOGNITO_WARNING IDS_EXTENSION_INSTALLED_HEADING IDS_EXTENSION_ALERT_ITEM_EXTERNAL And fix a $1 $1 bug. IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9107061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118018 0039d316-1c4b-4281-b951-d872f2087c98
std::vector<ExtensionPage> ExtensionSettingsHandler::GetActivePagesForExtension( const Extension* extension) { std::vector<ExtensionPage> result; ExtensionProcessManager* process_manager = extension_service_->profile()->GetExtensionProcessManager(); GetActivePagesForExtensionProcess( process_manager->GetRenderViewHostsForExtension( extension->id()), &result); if (extension_service_->profile()->HasOffTheRecordProfile() && extension->incognito_split_mode()) { ExtensionProcessManager* process_manager = extension_service_->profile()->GetOffTheRecordProfile()-> GetExtensionProcessManager(); GetActivePagesForExtensionProcess( process_manager->GetRenderViewHostsForExtension( extension->id()), &result); } return result; }
std::vector<ExtensionPage> ExtensionSettingsHandler::GetActivePagesForExtension( const Extension* extension) { std::vector<ExtensionPage> result; ExtensionProcessManager* process_manager = extension_service_->profile()->GetExtensionProcessManager(); GetActivePagesForExtensionProcess( process_manager->GetRenderViewHostsForExtension( extension->id()), &result); if (extension_service_->profile()->HasOffTheRecordProfile() && extension->incognito_split_mode()) { ExtensionProcessManager* process_manager = extension_service_->profile()->GetOffTheRecordProfile()-> GetExtensionProcessManager(); GetActivePagesForExtensionProcess( process_manager->GetRenderViewHostsForExtension( extension->id()), &result); } return result; }
C
Chrome
0
CVE-2019-17113
https://www.cvedetails.com/cve/CVE-2019-17113/
CWE-120
https://github.com/OpenMPT/openmpt/commit/927688ddab43c2b203569de79407a899e734fabe
927688ddab43c2b203569de79407a899e734fabe
[Fix] libmodplug: C API: Limit the length of strings copied to the output buffer of ModPlug_InstrumentName() and ModPlug_SampleName() to 32 bytes (including terminating null) as is done by original libmodplug. This avoids potential buffer overflows in software relying on this limit instead of querying the required buffer size beforehand. libopenmpt can return strings longer than 32 bytes here beacuse the internal limit of 32 bytes applies to strings encoded in arbitrary character encodings but the API returns them converted to UTF-8, which can be longer. (reported by Antonio Morales Maldonado of Semmle Security Research Team) git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@12127 56274372-70c3-4bfc-bfc3-4c3a0b034d27
LIBOPENMPT_MODPLUG_API unsigned int ModPlug_NumSamples(ModPlugFile* file) { if(!file) return 0; return openmpt_module_get_num_samples(file->mod); }
LIBOPENMPT_MODPLUG_API unsigned int ModPlug_NumSamples(ModPlugFile* file) { if(!file) return 0; return openmpt_module_get_num_samples(file->mod); }
C
openmpt
0
CVE-2010-5313
https://www.cvedetails.com/cve/CVE-2010-5313/
CWE-362
https://github.com/torvalds/linux/commit/fc3a9157d3148ab91039c75423da8ef97be3e105
fc3a9157d3148ab91039c75423da8ef97be3e105
KVM: X86: Don't report L2 emulation failures to user-space This patch prevents that emulation failures which result from emulating an instruction for an L2-Guest results in being reported to userspace. Without this patch a malicious L2-Guest would be able to kill the L1 by triggering a race-condition between an vmexit and the instruction emulator. With this patch the L2 will most likely only kill itself in this situation. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
void kvm_before_handle_nmi(struct kvm_vcpu *vcpu) { percpu_write(current_vcpu, vcpu); }
void kvm_before_handle_nmi(struct kvm_vcpu *vcpu) { percpu_write(current_vcpu, vcpu); }
C
linux
0
CVE-2017-5044
https://www.cvedetails.com/cve/CVE-2017-5044/
CWE-119
https://github.com/chromium/chromium/commit/62154472bd2c43e1790dd1bd8a527c1db9118d88
62154472bd2c43e1790dd1bd8a527c1db9118d88
bluetooth: Implement getAvailability() This change implements the getAvailability() method for navigator.bluetooth as defined in the specification. Bug: 707640 Change-Id: I9e9b3e7f8ea7f259e975f71cb6d9570e5f04b479 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1651516 Reviewed-by: Chris Harrelson <[email protected]> Reviewed-by: Giovanni Ortuño Urquidi <[email protected]> Reviewed-by: Kinuko Yasuda <[email protected]> Commit-Queue: Ovidio de Jesús Ruiz-Henríquez <[email protected]> Auto-Submit: Ovidio de Jesús Ruiz-Henríquez <[email protected]> Cr-Commit-Position: refs/heads/master@{#688987}
void WebBluetoothServiceImpl::RemoteServerGetPrimaryServicesImpl( const blink::WebBluetoothDeviceId& device_id, blink::mojom::WebBluetoothGATTQueryQuantity quantity, const base::Optional<BluetoothUUID>& services_uuid, RemoteServerGetPrimaryServicesCallback callback, device::BluetoothDevice* device) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!device->IsGattConnected()) { RecordGetPrimaryServicesOutcome( quantity, UMAGetPrimaryServiceOutcome::DEVICE_DISCONNECTED); std::move(callback).Run(blink::mojom::WebBluetoothResult::NO_SERVICES_FOUND, base::nullopt /* services */); return; } DCHECK(device->IsGattServicesDiscoveryComplete()); std::vector<device::BluetoothRemoteGattService*> services = services_uuid ? device->GetPrimaryServicesByUUID(services_uuid.value()) : device->GetPrimaryServices(); std::vector<blink::mojom::WebBluetoothRemoteGATTServicePtr> response_services; for (device::BluetoothRemoteGattService* service : services) { if (!allowed_devices().IsAllowedToAccessService(device_id, service->GetUUID())) { continue; } std::string service_instance_id = service->GetIdentifier(); const std::string& device_address = device->GetAddress(); auto insert_result = service_id_to_device_address_.insert( make_pair(service_instance_id, device_address)); if (!insert_result.second) DCHECK_EQ(insert_result.first->second, device_address); blink::mojom::WebBluetoothRemoteGATTServicePtr service_ptr = blink::mojom::WebBluetoothRemoteGATTService::New(); service_ptr->instance_id = service_instance_id; service_ptr->uuid = service->GetUUID(); response_services.push_back(std::move(service_ptr)); if (quantity == blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE) { break; } } if (!response_services.empty()) { DVLOG(1) << "Services found in device."; RecordGetPrimaryServicesOutcome(quantity, UMAGetPrimaryServiceOutcome::SUCCESS); std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS, std::move(response_services)); return; } DVLOG(1) << "Services not found in device."; RecordGetPrimaryServicesOutcome( quantity, services_uuid ? UMAGetPrimaryServiceOutcome::NOT_FOUND : UMAGetPrimaryServiceOutcome::NO_SERVICES); std::move(callback).Run( services_uuid ? blink::mojom::WebBluetoothResult::SERVICE_NOT_FOUND : blink::mojom::WebBluetoothResult::NO_SERVICES_FOUND, base::nullopt /* services */); }
void WebBluetoothServiceImpl::RemoteServerGetPrimaryServicesImpl( const blink::WebBluetoothDeviceId& device_id, blink::mojom::WebBluetoothGATTQueryQuantity quantity, const base::Optional<BluetoothUUID>& services_uuid, RemoteServerGetPrimaryServicesCallback callback, device::BluetoothDevice* device) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!device->IsGattConnected()) { RecordGetPrimaryServicesOutcome( quantity, UMAGetPrimaryServiceOutcome::DEVICE_DISCONNECTED); std::move(callback).Run(blink::mojom::WebBluetoothResult::NO_SERVICES_FOUND, base::nullopt /* services */); return; } DCHECK(device->IsGattServicesDiscoveryComplete()); std::vector<device::BluetoothRemoteGattService*> services = services_uuid ? device->GetPrimaryServicesByUUID(services_uuid.value()) : device->GetPrimaryServices(); std::vector<blink::mojom::WebBluetoothRemoteGATTServicePtr> response_services; for (device::BluetoothRemoteGattService* service : services) { if (!allowed_devices().IsAllowedToAccessService(device_id, service->GetUUID())) { continue; } std::string service_instance_id = service->GetIdentifier(); const std::string& device_address = device->GetAddress(); auto insert_result = service_id_to_device_address_.insert( make_pair(service_instance_id, device_address)); if (!insert_result.second) DCHECK_EQ(insert_result.first->second, device_address); blink::mojom::WebBluetoothRemoteGATTServicePtr service_ptr = blink::mojom::WebBluetoothRemoteGATTService::New(); service_ptr->instance_id = service_instance_id; service_ptr->uuid = service->GetUUID(); response_services.push_back(std::move(service_ptr)); if (quantity == blink::mojom::WebBluetoothGATTQueryQuantity::SINGLE) { break; } } if (!response_services.empty()) { DVLOG(1) << "Services found in device."; RecordGetPrimaryServicesOutcome(quantity, UMAGetPrimaryServiceOutcome::SUCCESS); std::move(callback).Run(blink::mojom::WebBluetoothResult::SUCCESS, std::move(response_services)); return; } DVLOG(1) << "Services not found in device."; RecordGetPrimaryServicesOutcome( quantity, services_uuid ? UMAGetPrimaryServiceOutcome::NOT_FOUND : UMAGetPrimaryServiceOutcome::NO_SERVICES); std::move(callback).Run( services_uuid ? blink::mojom::WebBluetoothResult::SERVICE_NOT_FOUND : blink::mojom::WebBluetoothResult::NO_SERVICES_FOUND, base::nullopt /* services */); }
C
Chrome
0
CVE-2018-6063
https://www.cvedetails.com/cve/CVE-2018-6063/
CWE-787
https://github.com/chromium/chromium/commit/673ce95d481ea9368c4d4d43ac756ba1d6d9e608
673ce95d481ea9368c4d4d43ac756ba1d6d9e608
Correct mojo::WrapSharedMemoryHandle usage Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which were assuming that the call actually has any control over the memory protection applied to a handle when mapped. Where fixing usage is infeasible for this CL, TODOs are added to annotate follow-up work. Also updates the API and documentation to (hopefully) improve clarity and avoid similar mistakes from being made in the future. BUG=792900 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I0578aaa9ca3bfcb01aaf2451315d1ede95458477 Reviewed-on: https://chromium-review.googlesource.com/818282 Reviewed-by: Wei Li <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Reviewed-by: John Abd-El-Malek <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Sadrul Chowdhury <[email protected]> Reviewed-by: Yuzhu Shen <[email protected]> Reviewed-by: Robert Sesek <[email protected]> Commit-Queue: Ken Rockot <[email protected]> Cr-Commit-Position: refs/heads/master@{#530268}
void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) { auto weak_this = weak_ptr_factory_.GetWeakPtr(); print_preview_context_.source_frame()->DispatchBeforePrintEvent(); if (!weak_this) return; const bool is_modifiable = print_preview_context_.IsModifiable(); const bool has_selection = print_preview_context_.HasSelection(); PrintHostMsg_RequestPrintPreview_Params params; params.is_modifiable = is_modifiable; params.has_selection = has_selection; switch (type) { case PRINT_PREVIEW_SCRIPTED: { is_scripted_preview_delayed_ = true; if (is_loading_ && GetPlugin(print_preview_context_.source_frame())) { on_stop_loading_closure_ = base::Bind(&PrintRenderFrameHelper::ShowScriptedPrintPreview, weak_ptr_factory_.GetWeakPtr()); } else { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&PrintRenderFrameHelper::ShowScriptedPrintPreview, weak_ptr_factory_.GetWeakPtr())); } auto msg = base::MakeUnique<PrintHostMsg_SetupScriptedPrintPreview>( routing_id()); msg->EnableMessagePumping(); auto self = weak_ptr_factory_.GetWeakPtr(); Send(msg.release()); if (self) is_scripted_preview_delayed_ = false; return; } case PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME: { if (is_loading_ && GetPlugin(print_preview_context_.source_frame())) { on_stop_loading_closure_ = base::Bind(&PrintRenderFrameHelper::RequestPrintPreview, weak_ptr_factory_.GetWeakPtr(), type); return; } break; } case PRINT_PREVIEW_USER_INITIATED_SELECTION: { DCHECK(has_selection); DCHECK(!GetPlugin(print_preview_context_.source_frame())); params.selection_only = has_selection; break; } case PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE: { if (is_loading_ && GetPlugin(print_preview_context_.source_frame())) { on_stop_loading_closure_ = base::Bind(&PrintRenderFrameHelper::RequestPrintPreview, weak_ptr_factory_.GetWeakPtr(), type); return; } params.webnode_only = true; break; } default: { NOTREACHED(); return; } } Send(new PrintHostMsg_RequestPrintPreview(routing_id(), params)); }
void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) { auto weak_this = weak_ptr_factory_.GetWeakPtr(); print_preview_context_.source_frame()->DispatchBeforePrintEvent(); if (!weak_this) return; const bool is_modifiable = print_preview_context_.IsModifiable(); const bool has_selection = print_preview_context_.HasSelection(); PrintHostMsg_RequestPrintPreview_Params params; params.is_modifiable = is_modifiable; params.has_selection = has_selection; switch (type) { case PRINT_PREVIEW_SCRIPTED: { is_scripted_preview_delayed_ = true; if (is_loading_ && GetPlugin(print_preview_context_.source_frame())) { on_stop_loading_closure_ = base::Bind(&PrintRenderFrameHelper::ShowScriptedPrintPreview, weak_ptr_factory_.GetWeakPtr()); } else { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&PrintRenderFrameHelper::ShowScriptedPrintPreview, weak_ptr_factory_.GetWeakPtr())); } auto msg = base::MakeUnique<PrintHostMsg_SetupScriptedPrintPreview>( routing_id()); msg->EnableMessagePumping(); auto self = weak_ptr_factory_.GetWeakPtr(); Send(msg.release()); if (self) is_scripted_preview_delayed_ = false; return; } case PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME: { if (is_loading_ && GetPlugin(print_preview_context_.source_frame())) { on_stop_loading_closure_ = base::Bind(&PrintRenderFrameHelper::RequestPrintPreview, weak_ptr_factory_.GetWeakPtr(), type); return; } break; } case PRINT_PREVIEW_USER_INITIATED_SELECTION: { DCHECK(has_selection); DCHECK(!GetPlugin(print_preview_context_.source_frame())); params.selection_only = has_selection; break; } case PRINT_PREVIEW_USER_INITIATED_CONTEXT_NODE: { if (is_loading_ && GetPlugin(print_preview_context_.source_frame())) { on_stop_loading_closure_ = base::Bind(&PrintRenderFrameHelper::RequestPrintPreview, weak_ptr_factory_.GetWeakPtr(), type); return; } params.webnode_only = true; break; } default: { NOTREACHED(); return; } } Send(new PrintHostMsg_RequestPrintPreview(routing_id(), params)); }
C
Chrome
0
CVE-2015-6765
https://www.cvedetails.com/cve/CVE-2015-6765/
null
https://github.com/chromium/chromium/commit/e5c298b780737c53fa9aae44d6fef522931d88b0
e5c298b780737c53fa9aae44d6fef522931d88b0
AppCache: fix a browser crashing bug that can happen during updates. BUG=558589 Review URL: https://codereview.chromium.org/1463463003 Cr-Commit-Position: refs/heads/master@{#360967}
AppCacheUpdateJob::~AppCacheUpdateJob() { if (service_) service_->RemoveObserver(this); if (internal_state_ != COMPLETED) Cancel(); DCHECK(!inprogress_cache_.get()); DCHECK(pending_master_entries_.empty()); // The job must not outlive any of its fetchers. CHECK(!manifest_fetcher_); CHECK(pending_url_fetches_.empty()); CHECK(master_entry_fetches_.empty()); if (group_) group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); }
AppCacheUpdateJob::~AppCacheUpdateJob() { if (service_) service_->RemoveObserver(this); if (internal_state_ != COMPLETED) Cancel(); DCHECK(!manifest_fetcher_); DCHECK(pending_url_fetches_.empty()); DCHECK(!inprogress_cache_.get()); DCHECK(pending_master_entries_.empty()); DCHECK(master_entry_fetches_.empty()); if (group_) group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); }
C
Chrome
1
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
lseg_length(PG_FUNCTION_ARGS) { LSEG *lseg = PG_GETARG_LSEG_P(0); PG_RETURN_FLOAT8(point_dt(&lseg->p[0], &lseg->p[1])); }
lseg_length(PG_FUNCTION_ARGS) { LSEG *lseg = PG_GETARG_LSEG_P(0); PG_RETURN_FLOAT8(point_dt(&lseg->p[0], &lseg->p[1])); }
C
postgres
0
CVE-2017-18200
https://www.cvedetails.com/cve/CVE-2017-18200/
CWE-20
https://github.com/torvalds/linux/commit/638164a2718f337ea224b747cf5977ef143166a4
638164a2718f337ea224b747cf5977ef143166a4
f2fs: fix potential panic during fstrim As Ju Hyung Park reported: "When 'fstrim' is called for manual trim, a BUG() can be triggered randomly with this patch. I'm seeing this issue on both x86 Desktop and arm64 Android phone. On x86 Desktop, this was caused during Ubuntu boot-up. I have a cronjob installed which calls 'fstrim -v /' during boot. On arm64 Android, this was caused during GC looping with 1ms gc_min_sleep_time & gc_max_sleep_time." Root cause of this issue is that f2fs_wait_discard_bios can only be used by f2fs_put_super, because during put_super there must be no other referrers, so it can ignore discard entry's reference count when removing the entry, otherwise in other caller we will hit bug_on in __remove_discard_cmd as there may be other issuer added reference count in discard entry. Thread A Thread B - issue_discard_thread - f2fs_ioc_fitrim - f2fs_trim_fs - f2fs_wait_discard_bios - __issue_discard_cmd - __submit_discard_cmd - __wait_discard_cmd - dc->ref++ - __wait_one_discard_bio - __wait_discard_cmd - __remove_discard_cmd - f2fs_bug_on(sbi, dc->ref) Fixes: 969d1b180d987c2be02de890d0fff0f66a0e80de Reported-by: Ju Hyung Park <[email protected]> Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
static void __exit exit_f2fs_fs(void) { f2fs_destroy_root_stats(); unregister_filesystem(&f2fs_fs_type); unregister_shrinker(&f2fs_shrinker_info); f2fs_exit_sysfs(); destroy_extent_cache(); destroy_checkpoint_caches(); destroy_segment_manager_caches(); destroy_node_manager_caches(); destroy_inodecache(); f2fs_destroy_trace_ios(); }
static void __exit exit_f2fs_fs(void) { f2fs_destroy_root_stats(); unregister_filesystem(&f2fs_fs_type); unregister_shrinker(&f2fs_shrinker_info); f2fs_exit_sysfs(); destroy_extent_cache(); destroy_checkpoint_caches(); destroy_segment_manager_caches(); destroy_node_manager_caches(); destroy_inodecache(); f2fs_destroy_trace_ios(); }
C
linux
0
CVE-2011-2918
https://www.cvedetails.com/cve/CVE-2011-2918/
CWE-399
https://github.com/torvalds/linux/commit/a8b0ca17b80e92faab46ee7179ba9e99ccb61233
a8b0ca17b80e92faab46ee7179ba9e99ccb61233
perf: Remove the nmi parameter from the swevent and overflow interface The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <[email protected]> Cc: Michael Cree <[email protected]> Cc: Will Deacon <[email protected]> Cc: Deng-Cheng Zhu <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Paul Mundt <[email protected]> Cc: David S. Miller <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Don Zickus <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
static int perf_event_set_filter(struct perf_event *event, void __user *arg) { char *filter_str; int ret; if (event->attr.type != PERF_TYPE_TRACEPOINT) return -EINVAL; filter_str = strndup_user(arg, PAGE_SIZE); if (IS_ERR(filter_str)) return PTR_ERR(filter_str); ret = ftrace_profile_set_filter(event, event->attr.config, filter_str); kfree(filter_str); return ret; }
static int perf_event_set_filter(struct perf_event *event, void __user *arg) { char *filter_str; int ret; if (event->attr.type != PERF_TYPE_TRACEPOINT) return -EINVAL; filter_str = strndup_user(arg, PAGE_SIZE); if (IS_ERR(filter_str)) return PTR_ERR(filter_str); ret = ftrace_profile_set_filter(event, event->attr.config, filter_str); kfree(filter_str); return ret; }
C
linux
0
CVE-2016-0841
https://www.cvedetails.com/cve/CVE-2016-0841/
CWE-119
https://android.googlesource.com/platform/frameworks/av/+/3097f364237fb552871f7639d37a7afa4563e252
3097f364237fb552871f7639d37a7afa4563e252
Get service by value instead of reference to prevent a cleared service binder from being used. Bug: 26040840 Change-Id: Ifb5483c55b172d3553deb80dbe27f2204b86ecdb
sp<IMemory> MediaMetadataRetriever::extractAlbumArt() { ALOGV("extractAlbumArt"); Mutex::Autolock _l(mLock); if (mRetriever == 0) { ALOGE("retriever is not initialized"); return NULL; } return mRetriever->extractAlbumArt(); }
sp<IMemory> MediaMetadataRetriever::extractAlbumArt() { ALOGV("extractAlbumArt"); Mutex::Autolock _l(mLock); if (mRetriever == 0) { ALOGE("retriever is not initialized"); return NULL; } return mRetriever->extractAlbumArt(); }
C
Android
0
null
null
null
https://github.com/chromium/chromium/commit/123e68f88fd0ed4f7447ba81148f9b619b947c47
123e68f88fd0ed4f7447ba81148f9b619b947c47
Clipboard: Opt out of PNG Encoding filters. Set the PNG encoder's FilterFlag to kNone from the default kAll. The clipboard should prefer faster encode time over encode size for image/png, so set all clipboard image decoding to skip testing of different PNG encoding filters, which takes a lot of time for not too much compression ratio benefit in the common case. Benchmarking with a random-pixel 8k by 4k px image (https://www.photopea.com/clipboard_img.html), and fZLibLevel = 1, here's some encode times (seconds) varying flags: * kNone: 2.98 (trials: 3.00814, 2.98265, 2.99636, 2.9877, 2.96517, 2.99467) * kSub: 3.03 (trials: 3.02345, 3.04085, 3.00886, 3.0587, 3.03992, 3.02549) * kAll: 4.12 (trials: 4.12813, 4.12552, 4.08524, 4.13283, 4.15013, 4.11719) Using kNone would save ~28% encode time over the current kAll. This will be most visible for pasting of extremely large photos. Bug: 1004867 Change-Id: I37a848498da425249e57171ae2ca3f0595c6b793 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827953 Commit-Queue: Victor Costan <[email protected]> Reviewed-by: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#700598}
bool DataObjectItem::HasFileSystemId() const { return kind_ == kFileKind && !file_system_id_.IsEmpty(); }
bool DataObjectItem::HasFileSystemId() const { return kind_ == kFileKind && !file_system_id_.IsEmpty(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/0fb75f1e468fe9054be3b3d3d5b9bf9a66e4199d
0fb75f1e468fe9054be3b3d3d5b9bf9a66e4199d
StackSamplingProfiler: walk a copy of the stack Changes the stack walking strategy to copy the stack while the target thread is suspended, then walk the copy of the stack after the thread has been resumed. This avoids deadlock on locks taken by RtlLookupFunctionEntry when walking the actual stack while the target thread is suspended. BUG=528129 Review URL: https://codereview.chromium.org/1367633002 Cr-Commit-Position: refs/heads/master@{#353004}
Win32StackFrameUnwinderTest() {}
Win32StackFrameUnwinderTest() {}
C
Chrome
0
CVE-2011-2793
https://www.cvedetails.com/cve/CVE-2011-2793/
CWE-399
https://github.com/chromium/chromium/commit/a6e146b4a369b31afa4c4323cc813dcbe0ef0c2b
a6e146b4a369b31afa4c4323cc813dcbe0ef0c2b
Use URLFetcher::Create instead of new in http_bridge.cc. This change modified http_bridge so that it uses a factory to construct the URLFetcher. Moreover, it modified sync_backend_host_unittest.cc to use an URLFetcher factory which will prevent access to www.example.com during the test. BUG=none TEST=sync_backend_host_unittest.cc Review URL: http://codereview.chromium.org/7053011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87227 0039d316-1c4b-4281-b951-d872f2087c98
TestURLFetcher* TestURLFetcherFactory::GetFetcherByID(int id) const { Fetchers::const_iterator i = fetchers_.find(id); return i == fetchers_.end() ? NULL : i->second; }
TestURLFetcher* TestURLFetcherFactory::GetFetcherByID(int id) const { Fetchers::const_iterator i = fetchers_.find(id); return i == fetchers_.end() ? NULL : i->second; }
C
Chrome
0
CVE-2015-5707
https://www.cvedetails.com/cve/CVE-2015-5707/
CWE-189
https://github.com/torvalds/linux/commit/451a2886b6bf90e2fb378f7c46c655450fb96e81
451a2886b6bf90e2fb378f7c46c655450fb96e81
sg_start_req(): make sure that there's not too many elements in iovec unfortunately, allowing an arbitrary 16bit value means a possibility of overflow in the calculation of total number of pages in bio_map_user_iov() - we rely on there being no more than PAGE_SIZE members of sum in the first loop there. If that sum wraps around, we end up allocating too small array of pointers to pages and it's easy to overflow it in the second loop. X-Coverup: TINC (and there's no lumber cartel either) Cc: [email protected] # way, way back Signed-off-by: Al Viro <[email protected]>
sg_mmap(struct file *filp, struct vm_area_struct *vma) { Sg_fd *sfp; unsigned long req_sz, len, sa; Sg_scatter_hold *rsv_schp; int k, length; if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data))) return -ENXIO; req_sz = vma->vm_end - vma->vm_start; SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sfp->parentdp, "sg_mmap starting, vm_start=%p, len=%d\n", (void *) vma->vm_start, (int) req_sz)); if (vma->vm_pgoff) return -EINVAL; /* want no offset */ rsv_schp = &sfp->reserve; if (req_sz > rsv_schp->bufflen) return -ENOMEM; /* cannot map more than reserved buffer */ sa = vma->vm_start; length = 1 << (PAGE_SHIFT + rsv_schp->page_order); for (k = 0; k < rsv_schp->k_use_sg && sa < vma->vm_end; k++) { len = vma->vm_end - sa; len = (len < length) ? len : length; sa += len; } sfp->mmap_called = 1; vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; vma->vm_private_data = sfp; vma->vm_ops = &sg_mmap_vm_ops; return 0; }
sg_mmap(struct file *filp, struct vm_area_struct *vma) { Sg_fd *sfp; unsigned long req_sz, len, sa; Sg_scatter_hold *rsv_schp; int k, length; if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data))) return -ENXIO; req_sz = vma->vm_end - vma->vm_start; SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sfp->parentdp, "sg_mmap starting, vm_start=%p, len=%d\n", (void *) vma->vm_start, (int) req_sz)); if (vma->vm_pgoff) return -EINVAL; /* want no offset */ rsv_schp = &sfp->reserve; if (req_sz > rsv_schp->bufflen) return -ENOMEM; /* cannot map more than reserved buffer */ sa = vma->vm_start; length = 1 << (PAGE_SHIFT + rsv_schp->page_order); for (k = 0; k < rsv_schp->k_use_sg && sa < vma->vm_end; k++) { len = vma->vm_end - sa; len = (len < length) ? len : length; sa += len; } sfp->mmap_called = 1; vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; vma->vm_private_data = sfp; vma->vm_ops = &sg_mmap_vm_ops; return 0; }
C
linux
0
CVE-2018-16075
https://www.cvedetails.com/cve/CVE-2018-16075/
CWE-254
https://github.com/chromium/chromium/commit/d913f72b4875cf0814fc3f03ad7c00642097c4a4
d913f72b4875cf0814fc3f03ad7c00642097c4a4
Remove RequireCSSExtensionForFile runtime enabled flag. The feature has long since been stable (since M64) and doesn't seem to be a need for this flag. BUG=788936 Change-Id: I666390b869289c328acb4a2daa5bf4154e1702c0 Reviewed-on: https://chromium-review.googlesource.com/c/1324143 Reviewed-by: Mike West <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Commit-Queue: Dave Tapuska <[email protected]> Cr-Commit-Position: refs/heads/master@{#607329}
void WebRuntimeFeatures::EnableWebGPU(bool enable) { RuntimeEnabledFeatures::SetWebGPUEnabled(enable); }
void WebRuntimeFeatures::EnableWebGPU(bool enable) { RuntimeEnabledFeatures::SetWebGPUEnabled(enable); }
C
Chrome
0
CVE-2011-3965
https://www.cvedetails.com/cve/CVE-2011-3965/
CWE-20
https://github.com/chromium/chromium/commit/7352baf29ac44d23cd580c2edfa8faf4e140a480
7352baf29ac44d23cd580c2edfa8faf4e140a480
Fix null deref when walking cert chain. BUG=109664 TEST=N/A Review URL: http://codereview.chromium.org/9150013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117080 0039d316-1c4b-4281-b951-d872f2087c98
void SignatureUtil::CheckSignature( const FilePath& file_path, ClientDownloadRequest_SignatureInfo* signature_info) { VLOG(2) << "Checking signature for " << file_path.value(); WINTRUST_FILE_INFO file_info; file_info.cbStruct = sizeof(file_info); file_info.pcwszFilePath = file_path.value().c_str(); file_info.hFile = NULL; file_info.pgKnownSubject = NULL; WINTRUST_DATA wintrust_data; wintrust_data.cbStruct = sizeof(wintrust_data); wintrust_data.pPolicyCallbackData = NULL; wintrust_data.pSIPClientData = NULL; wintrust_data.dwUIChoice = WTD_UI_NONE; wintrust_data.fdwRevocationChecks = WTD_REVOKE_NONE; wintrust_data.dwUnionChoice = WTD_CHOICE_FILE; wintrust_data.pFile = &file_info; wintrust_data.dwStateAction = WTD_STATEACTION_VERIFY; wintrust_data.hWVTStateData = NULL; wintrust_data.pwszURLReference = NULL; wintrust_data.dwProvFlags = WTD_CACHE_ONLY_URL_RETRIEVAL; wintrust_data.dwUIContext = WTD_UICONTEXT_EXECUTE; GUID policy_guid = WINTRUST_ACTION_GENERIC_VERIFY_V2; LONG result = WinVerifyTrust(static_cast<HWND>(INVALID_HANDLE_VALUE), &policy_guid, &wintrust_data); CRYPT_PROVIDER_DATA* prov_data = WTHelperProvDataFromStateData( wintrust_data.hWVTStateData); if (prov_data) { if (prov_data->csSigners > 0) { signature_info->set_trusted(result == ERROR_SUCCESS); } for (DWORD i = 0; i < prov_data->csSigners; ++i) { const CERT_CHAIN_CONTEXT* cert_chain_context = prov_data->pasSigners[i].pChainContext; if (!cert_chain_context) break; for (DWORD j = 0; j < cert_chain_context->cChain; ++j) { CERT_SIMPLE_CHAIN* simple_chain = cert_chain_context->rgpChain[j]; ClientDownloadRequest_CertificateChain* chain = signature_info->add_certificate_chain(); if (!simple_chain) break; for (DWORD k = 0; k < simple_chain->cElement; ++k) { CERT_CHAIN_ELEMENT* element = simple_chain->rgpElement[k]; chain->add_element()->set_certificate( element->pCertContext->pbCertEncoded, element->pCertContext->cbCertEncoded); } } } wintrust_data.dwStateAction = WTD_STATEACTION_CLOSE; WinVerifyTrust(static_cast<HWND>(INVALID_HANDLE_VALUE), &policy_guid, &wintrust_data); } }
void SignatureUtil::CheckSignature( const FilePath& file_path, ClientDownloadRequest_SignatureInfo* signature_info) { VLOG(2) << "Checking signature for " << file_path.value(); WINTRUST_FILE_INFO file_info; file_info.cbStruct = sizeof(file_info); file_info.pcwszFilePath = file_path.value().c_str(); file_info.hFile = NULL; file_info.pgKnownSubject = NULL; WINTRUST_DATA wintrust_data; wintrust_data.cbStruct = sizeof(wintrust_data); wintrust_data.pPolicyCallbackData = NULL; wintrust_data.pSIPClientData = NULL; wintrust_data.dwUIChoice = WTD_UI_NONE; wintrust_data.fdwRevocationChecks = WTD_REVOKE_NONE; wintrust_data.dwUnionChoice = WTD_CHOICE_FILE; wintrust_data.pFile = &file_info; wintrust_data.dwStateAction = WTD_STATEACTION_VERIFY; wintrust_data.hWVTStateData = NULL; wintrust_data.pwszURLReference = NULL; wintrust_data.dwProvFlags = WTD_CACHE_ONLY_URL_RETRIEVAL; wintrust_data.dwUIContext = WTD_UICONTEXT_EXECUTE; GUID policy_guid = WINTRUST_ACTION_GENERIC_VERIFY_V2; LONG result = WinVerifyTrust(static_cast<HWND>(INVALID_HANDLE_VALUE), &policy_guid, &wintrust_data); CRYPT_PROVIDER_DATA* prov_data = WTHelperProvDataFromStateData( wintrust_data.hWVTStateData); if (prov_data) { if (prov_data->csSigners > 0) { signature_info->set_trusted(result == ERROR_SUCCESS); } for (DWORD i = 0; i < prov_data->csSigners; ++i) { const CERT_CHAIN_CONTEXT* cert_chain_context = prov_data->pasSigners[i].pChainContext; for (DWORD j = 0; j < cert_chain_context->cChain; ++j) { CERT_SIMPLE_CHAIN* simple_chain = cert_chain_context->rgpChain[j]; ClientDownloadRequest_CertificateChain* chain = signature_info->add_certificate_chain(); for (DWORD k = 0; k < simple_chain->cElement; ++k) { CERT_CHAIN_ELEMENT* element = simple_chain->rgpElement[k]; chain->add_element()->set_certificate( element->pCertContext->pbCertEncoded, element->pCertContext->cbCertEncoded); } } } wintrust_data.dwStateAction = WTD_STATEACTION_CLOSE; WinVerifyTrust(static_cast<HWND>(INVALID_HANDLE_VALUE), &policy_guid, &wintrust_data); } }
C
Chrome
1
CVE-2017-6414
https://www.cvedetails.com/cve/CVE-2017-6414/
CWE-772
https://cgit.freedesktop.org/spice/libcacard/commit/?id=9113dc6a303604a2d9812ac70c17d076ef11886c
9113dc6a303604a2d9812ac70c17d076ef11886c
null
vcard_process_apdu(VCard *card, VCardAPDU *apdu, VCardResponse **response) { VCardStatus status; VCardBufferResponse *buffer_response; /* first handle any PTS commands, which aren't really APDU's */ if (apdu->a_type == VCARD_7816_PTS) { /* the PTS responses aren't really responses either */ *response = vcard_response_new_data(apdu->a_data, apdu->a_len); /* PTS responses have no status bytes */ (*response)->b_total_len = (*response)->b_len; return VCARD_DONE; } buffer_response = vcard_get_buffer_response(card); if (buffer_response && apdu->a_ins != VCARD7816_INS_GET_RESPONSE) { /* clear out buffer_response, do not return an error */ vcard_set_buffer_response(card, NULL); vcard_buffer_response_delete(buffer_response); } status = vcard_process_applet_apdu(card, apdu, response); if (status != VCARD_NEXT) { return status; } switch (vcard_get_type(card)) { case VCARD_FILE_SYSTEM: return vcard7816_file_system_process_apdu(card, apdu, response); case VCARD_VM: return vcard7816_vm_process_apdu(card, apdu, response); case VCARD_DIRECT: /* if we are type direct, then the applet should handle everything */ assert(!"VCARD_DIRECT: applet failure"); break; default: g_warn_if_reached(); } *response = vcard_make_response(VCARD7816_STATUS_ERROR_COMMAND_NOT_SUPPORTED); return VCARD_DONE; }
vcard_process_apdu(VCard *card, VCardAPDU *apdu, VCardResponse **response) { VCardStatus status; VCardBufferResponse *buffer_response; /* first handle any PTS commands, which aren't really APDU's */ if (apdu->a_type == VCARD_7816_PTS) { /* the PTS responses aren't really responses either */ *response = vcard_response_new_data(apdu->a_data, apdu->a_len); /* PTS responses have no status bytes */ (*response)->b_total_len = (*response)->b_len; return VCARD_DONE; } buffer_response = vcard_get_buffer_response(card); if (buffer_response && apdu->a_ins != VCARD7816_INS_GET_RESPONSE) { /* clear out buffer_response, do not return an error */ vcard_set_buffer_response(card, NULL); vcard_buffer_response_delete(buffer_response); } status = vcard_process_applet_apdu(card, apdu, response); if (status != VCARD_NEXT) { return status; } switch (vcard_get_type(card)) { case VCARD_FILE_SYSTEM: return vcard7816_file_system_process_apdu(card, apdu, response); case VCARD_VM: return vcard7816_vm_process_apdu(card, apdu, response); case VCARD_DIRECT: /* if we are type direct, then the applet should handle everything */ assert(!"VCARD_DIRECT: applet failure"); break; default: g_warn_if_reached(); } *response = vcard_make_response(VCARD7816_STATUS_ERROR_COMMAND_NOT_SUPPORTED); return VCARD_DONE; }
C
spice
0
null
null
null
https://github.com/chromium/chromium/commit/f84286649c35f951996885aebd0400ea0c3c44cb
f84286649c35f951996885aebd0400ea0c3c44cb
Revert "OnionSoup: Move mojom files from public/platform/web to public/mojom folder" This reverts commit e656908dbda6ced2f4743a9b5c2ed926dc6b5b67. Reason for revert: Appears to cause build failure on Android [71296/78273] ACTION //content/public/android:content_java__process_prebuilt__bytecode_rewrite(//build/toolchain/android:android_clang_arm) FAILED: obj/content/public/android/content_java__process_prebuilt-bytecode-rewritten.jar python ../../build/android/gyp/bytecode_processor.py --script bin/helper/java_bytecode_rewriter [...removed for brevity, see link...] Missing 2 classes missing in direct classpath. To fix, add GN deps for: gen/third_party/blink/public/mojom/android_mojo_bindings_java.javac.jar Traceback (most recent call last): File "../../build/android/gyp/bytecode_processor.py", line 76, in <module> sys.exit(main(sys.argv)) File "../../build/android/gyp/bytecode_processor.py", line 72, in main subprocess.check_call(cmd) File "/b/swarming/w/ir/cipd_bin_packages/lib/python2.7/subprocess.py", line 186, in check_call raise CalledProcessError(retcode, cmd) (https://ci.chromium.org/p/chromium/builders/ci/android-rel/9664) Original change's description: > OnionSoup: Move mojom files from public/platform/web to public/mojom folder > > This CL moves window_features.mojom, commit_result.mojom, > devtools_frontend.mojom, selection_menu_behavior.mojom and > remote_objects.mojom from public/platform/web to public/mojom/ > to gather mojom files to mojom folder and updates paths for these > mojom files. > > Bug: 919393 > Change-Id: If6df031ed39d70e700986bd13a40d0598257e009 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1514434 > Reviewed-by: Scott Violet <[email protected]> > Reviewed-by: Kentaro Hara <[email protected]> > Reviewed-by: Kinuko Yasuda <[email protected]> > Reviewed-by: Dmitry Gozman <[email protected]> > Commit-Queue: Julie Jeongeun Kim <[email protected]> > Cr-Commit-Position: refs/heads/master@{#640633} [email protected],[email protected],[email protected],[email protected],[email protected] Change-Id: I5744072dbaeffba5706f329838e37d74c065ae27 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 919393 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1523386 Reviewed-by: Fredrik Söderquist <[email protected]> Commit-Queue: Fredrik Söderquist <[email protected]> Cr-Commit-Position: refs/heads/master@{#640688}
static bool NeedsHistoryItemRestore(WebFrameLoadType type) { return type == WebFrameLoadType::kBackForward || IsReloadLoadType(type); }
static bool NeedsHistoryItemRestore(WebFrameLoadType type) { return type == WebFrameLoadType::kBackForward || IsReloadLoadType(type); }
C
Chrome
0
CVE-2016-7568
https://www.cvedetails.com/cve/CVE-2016-7568/
CWE-190
https://github.com/php/php-src/commit/c18263e0e0769faee96a5d0ee04b750c442783c6
c18263e0e0769faee96a5d0ee04b750c442783c6
Merge branch 'PHP-5.6' into PHP-7.0
gdImagePtr gdImageCreateFromWebpPtr (int size, void *data) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); if (!in) return 0; im = gdImageCreateFromWebpCtx(in); in->gd_free(in); return im; }
gdImagePtr gdImageCreateFromWebpPtr (int size, void *data) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); if (!in) return 0; im = gdImageCreateFromWebpCtx(in); in->gd_free(in); return im; }
C
libgd
0
CVE-2017-11328
https://www.cvedetails.com/cve/CVE-2017-11328/
CWE-119
https://github.com/VirusTotal/yara/commit/4a342f01e5439b9bb901aff1c6c23c536baeeb3f
4a342f01e5439b9bb901aff1c6c23c536baeeb3f
Fix heap overflow (reported by Jurriaan Bremer) When setting a new array item with yr_object_array_set_item() the array size is doubled if the index for the new item is larger than the already allocated ones. No further checks were made to ensure that the index fits into the array after doubling its capacity. If the array capacity was for example 64, and a new object is assigned to an index larger than 128 the overflow occurs. As yr_object_array_set_item() is usually invoked with indexes that increase monotonically by one, this bug never triggered before. But the new "dotnet" module has the potential to allow the exploitation of this bug by scanning a specially crafted .NET binary.
int yr_object_has_undefined_value( YR_OBJECT* object, const char* field, ...) { YR_OBJECT* field_obj; va_list args; va_start(args, field); if (field != NULL) field_obj = _yr_object_lookup(object, 0, field, args); else field_obj = object; va_end(args); if (field_obj == NULL) return TRUE; switch(field_obj->type) { case OBJECT_TYPE_FLOAT: return isnan(field_obj->value.d); case OBJECT_TYPE_STRING: return field_obj->value.ss == NULL; case OBJECT_TYPE_INTEGER: return field_obj->value.i == UNDEFINED; } return FALSE; }
int yr_object_has_undefined_value( YR_OBJECT* object, const char* field, ...) { YR_OBJECT* field_obj; va_list args; va_start(args, field); if (field != NULL) field_obj = _yr_object_lookup(object, 0, field, args); else field_obj = object; va_end(args); if (field_obj == NULL) return TRUE; switch(field_obj->type) { case OBJECT_TYPE_FLOAT: return isnan(field_obj->value.d); case OBJECT_TYPE_STRING: return field_obj->value.ss == NULL; case OBJECT_TYPE_INTEGER: return field_obj->value.i == UNDEFINED; } return FALSE; }
C
yara
0
CVE-2011-2351
https://www.cvedetails.com/cve/CVE-2011-2351/
CWE-399
https://github.com/chromium/chromium/commit/bf381d8a02c3d272d4dd879ac719d8993dfb5ad6
bf381d8a02c3d272d4dd879ac719d8993dfb5ad6
Enable HistoryModelWorker by default, now that bug 69561 is fixed. BUG=69561 TEST=Run sync manually and run integration tests, sync should not crash. Review URL: http://codereview.chromium.org/7016007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85211 0039d316-1c4b-4281-b951-d872f2087c98
void SyncBackendHost::Core::DoProcessMessage( const std::string& name, const JsArgList& args, const JsEventHandler* sender) { DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop()); syncapi_->GetJsBackend()->ProcessMessage(name, args, sender); }
void SyncBackendHost::Core::DoProcessMessage( const std::string& name, const JsArgList& args, const JsEventHandler* sender) { DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop()); syncapi_->GetJsBackend()->ProcessMessage(name, args, sender); }
C
Chrome
0
CVE-2013-0840
https://www.cvedetails.com/cve/CVE-2013-0840/
null
https://github.com/chromium/chromium/commit/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d
7f48b71cb22bb2fc9fcec2013e9eaff55381a43d
Filter more incoming URLs in the CreateWindow path. BUG=170532 Review URL: https://chromiumcodereview.appspot.com/12036002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178728 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewHostImpl::OnCancelDesktopNotification(int notification_id) { GetContentClient()->browser()->CancelDesktopNotification( GetProcess()->GetID(), GetRoutingID(), notification_id); }
void RenderViewHostImpl::OnCancelDesktopNotification(int notification_id) { GetContentClient()->browser()->CancelDesktopNotification( GetProcess()->GetID(), GetRoutingID(), notification_id); }
C
Chrome
0
CVE-2016-2487
https://www.cvedetails.com/cve/CVE-2016-2487/
CWE-20
https://android.googlesource.com/platform/frameworks/av/+/4e32001e4196f39ddd0b86686ae0231c8f5ed944
4e32001e4196f39ddd0b86686ae0231c8f5ed944
DO NOT MERGE codecs: check OMX buffer size before use in (vorbis|opus)dec Bug: 27833616 Change-Id: I1ccdd16a00741da072527a6d13e87fd7c7fe8c54
void SoftOpus::onPortFlushCompleted(OMX_U32 portIndex) { if (portIndex == 0 && mDecoder != NULL) { mNumFramesOutput = 0; opus_multistream_decoder_ctl(mDecoder, OPUS_RESET_STATE); mAnchorTimeUs = 0; mSamplesToDiscard = mSeekPreRoll; } }
void SoftOpus::onPortFlushCompleted(OMX_U32 portIndex) { if (portIndex == 0 && mDecoder != NULL) { mNumFramesOutput = 0; opus_multistream_decoder_ctl(mDecoder, OPUS_RESET_STATE); mAnchorTimeUs = 0; mSamplesToDiscard = mSeekPreRoll; } }
C
Android
0
CVE-2017-0402
https://www.cvedetails.com/cve/CVE-2017-0402/
CWE-200
https://android.googlesource.com/platform/hardware/qcom/audio/+/d72ea85c78a1a68bf99fd5804ad9784b4102fe57
d72ea85c78a1a68bf99fd5804ad9784b4102fe57
Fix security vulnerability: Equalizer command might allow negative indexes Bug: 32247948 Bug: 32438598 Bug: 32436341 Test: use POC on bug or cts security test Change-Id: I56a92582687599b5b313dea1abcb8bcb19c7fc0e (cherry picked from commit 3f37d4ef89f4f0eef9e201c5a91b7b2c77ed1071) (cherry picked from commit ceb7b2d7a4c4cb8d03f166c61f5c7551c6c760aa)
int equalizer_set_band_level(equalizer_context_t *context, int32_t band, int32_t level) { ALOGV("%s: band: %d, level: %d", __func__, band, level); if (level > 0) { level = (int)((level+50)/100); } else { level = (int)((level-50)/100); } context->band_levels[band] = level; context->preset = PRESET_CUSTOM; offload_eq_set_preset(&(context->offload_eq), PRESET_CUSTOM); offload_eq_set_bands_level(&(context->offload_eq), NUM_EQ_BANDS, equalizer_band_presets_freq, context->band_levels); if (context->ctl) offload_eq_send_params(context->ctl, &context->offload_eq, OFFLOAD_SEND_EQ_ENABLE_FLAG | OFFLOAD_SEND_EQ_BANDS_LEVEL); return 0; }
int equalizer_set_band_level(equalizer_context_t *context, int32_t band, int32_t level) { ALOGV("%s: band: %d, level: %d", __func__, band, level); if (level > 0) { level = (int)((level+50)/100); } else { level = (int)((level-50)/100); } context->band_levels[band] = level; context->preset = PRESET_CUSTOM; offload_eq_set_preset(&(context->offload_eq), PRESET_CUSTOM); offload_eq_set_bands_level(&(context->offload_eq), NUM_EQ_BANDS, equalizer_band_presets_freq, context->band_levels); if (context->ctl) offload_eq_send_params(context->ctl, &context->offload_eq, OFFLOAD_SEND_EQ_ENABLE_FLAG | OFFLOAD_SEND_EQ_BANDS_LEVEL); return 0; }
C
Android
0
CVE-2018-10184
https://www.cvedetails.com/cve/CVE-2018-10184/
CWE-119
https://git.haproxy.org/?p=haproxy.git;a=commit;h=3f0e1ec70173593f4c2b3681b26c04a4ed5fc588
3f0e1ec70173593f4c2b3681b26c04a4ed5fc588
null
static inline __maybe_unused void h2c_error(struct h2c *h2c, enum h2_err err) { h2c->errcode = err; h2c->st0 = H2_CS_ERROR; }
static inline __maybe_unused void h2c_error(struct h2c *h2c, enum h2_err err) { h2c->errcode = err; h2c->st0 = H2_CS_ERROR; }
C
haproxy
0
CVE-2016-4072
https://www.cvedetails.com/cve/CVE-2016-4072/
CWE-20
https://git.php.net/?p=php-src.git;a=commit;h=1e9b175204e3286d64dfd6c9f09151c31b5e099a
1e9b175204e3286d64dfd6c9f09151c31b5e099a
null
PHP_METHOD(Phar, getMetadata) { PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters_none() == FAILURE) { return; } if (Z_TYPE(phar_obj->archive->metadata) != IS_UNDEF) { if (phar_obj->archive->is_persistent) { char *buf = estrndup((char *) Z_PTR(phar_obj->archive->metadata), phar_obj->archive->metadata_len); /* assume success, we would have failed before */ phar_parse_metadata(&buf, return_value, phar_obj->archive->metadata_len); efree(buf); } else { ZVAL_COPY(return_value, &phar_obj->archive->metadata); } } }
PHP_METHOD(Phar, getMetadata) { PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters_none() == FAILURE) { return; } if (Z_TYPE(phar_obj->archive->metadata) != IS_UNDEF) { if (phar_obj->archive->is_persistent) { char *buf = estrndup((char *) Z_PTR(phar_obj->archive->metadata), phar_obj->archive->metadata_len); /* assume success, we would have failed before */ phar_parse_metadata(&buf, return_value, phar_obj->archive->metadata_len); efree(buf); } else { ZVAL_COPY(return_value, &phar_obj->archive->metadata); } } }
C
php
0
CVE-2018-19045
https://www.cvedetails.com/cve/CVE-2018-19045/
CWE-200
https://github.com/acassen/keepalived/commit/c6247a9ef2c7b33244ab1d3aa5d629ec49f0a067
c6247a9ef2c7b33244ab1d3aa5d629ec49f0a067
Add command line and configuration option to set umask Issue #1048 identified that files created by keepalived are created with mode 0666. This commit changes the default to 0644, and also allows the umask to be specified in the configuration or as a command line option. Signed-off-by: Quentin Armitage <[email protected]>
get_priority(vector_t *strvec, const char *process) { int priority; if (vector_size(strvec) < 2) { report_config_error(CONFIG_GENERAL_ERROR, "No %s process priority specified", process); return 0; } if (!read_int_strvec(strvec, 1, &priority, -20, 19, true)) { report_config_error(CONFIG_GENERAL_ERROR, "Invalid %s process priority specified", process); return 0; } return (int8_t)priority; }
get_priority(vector_t *strvec, const char *process) { int priority; if (vector_size(strvec) < 2) { report_config_error(CONFIG_GENERAL_ERROR, "No %s process priority specified", process); return 0; } if (!read_int_strvec(strvec, 1, &priority, -20, 19, true)) { report_config_error(CONFIG_GENERAL_ERROR, "Invalid %s process priority specified", process); return 0; } return (int8_t)priority; }
C
keepalived
0
CVE-2018-6033
https://www.cvedetails.com/cve/CVE-2018-6033/
CWE-20
https://github.com/chromium/chromium/commit/a8d6ae61d266d8bc44c3dd2d08bda32db701e359
a8d6ae61d266d8bc44c3dd2d08bda32db701e359
Downloads : Fixed an issue of opening incorrect download file When one download overwrites another completed download, calling download.open in the old download causes the new download to open, which could be dangerous and undesirable. In this CL, we are trying to avoid this by blocking the opening of the old download. Bug: 793620 Change-Id: Ic948175756700ad7c08489c3cc347330daedb6f8 Reviewed-on: https://chromium-review.googlesource.com/826477 Reviewed-by: David Trainor <[email protected]> Reviewed-by: Xing Liu <[email protected]> Reviewed-by: John Abd-El-Malek <[email protected]> Commit-Queue: Shakti Sahu <[email protected]> Cr-Commit-Position: refs/heads/master@{#525810}
ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { DCHECK(!download_manager_); }
ChromeDownloadManagerDelegate::~ChromeDownloadManagerDelegate() { DCHECK(!download_manager_); }
C
Chrome
0
CVE-2016-7538
https://www.cvedetails.com/cve/CVE-2016-7538/
CWE-787
https://github.com/ImageMagick/ImageMagick/commit/53c1dcd34bed85181b901bfce1a2322f85a59472
53c1dcd34bed85181b901bfce1a2322f85a59472
https://github.com/ImageMagick/ImageMagick/issues/148
static MagickBooleanType ReadPSDChannelRLE(Image *image,const PSDInfo *psd_info, const ssize_t type,MagickOffsetType *offsets,ExceptionInfo *exception) { MagickBooleanType status; size_t length, row_size; ssize_t count, y; unsigned char *compact_pixels, *pixels; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " layer data is RLE compressed"); row_size=GetPSDRowSize(image); pixels=(unsigned char *) AcquireQuantumMemory(row_size,sizeof(*pixels)); if (pixels == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); length=0; for (y=0; y < (ssize_t) image->rows; y++) if ((MagickOffsetType) length < offsets[y]) length=(size_t) offsets[y]; compact_pixels=(unsigned char *) AcquireQuantumMemory(length,sizeof(*pixels)); if (compact_pixels == (unsigned char *) NULL) { pixels=(unsigned char *) RelinquishMagickMemory(pixels); ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } (void) ResetMagickMemory(compact_pixels,0,length*sizeof(*compact_pixels)); status=MagickTrue; for (y=0; y < (ssize_t) image->rows; y++) { status=MagickFalse; count=ReadBlob(image,(size_t) offsets[y],compact_pixels); if (count != (ssize_t) offsets[y]) break; count=DecodePSDPixels((size_t) offsets[y],compact_pixels, (ssize_t) (image->depth == 1 ? 123456 : image->depth),row_size,pixels); if (count != (ssize_t) row_size) break; status=ReadPSDChannelPixels(image,psd_info->channels,y,type,pixels, exception); if (status == MagickFalse) break; } compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels); pixels=(unsigned char *) RelinquishMagickMemory(pixels); return(status); }
static MagickBooleanType ReadPSDChannelRLE(Image *image,const PSDInfo *psd_info, const ssize_t type,MagickOffsetType *offsets,ExceptionInfo *exception) { MagickBooleanType status; size_t length, row_size; ssize_t count, y; unsigned char *compact_pixels, *pixels; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " layer data is RLE compressed"); row_size=GetPSDRowSize(image); pixels=(unsigned char *) AcquireQuantumMemory(row_size,sizeof(*pixels)); if (pixels == (unsigned char *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); length=0; for (y=0; y < (ssize_t) image->rows; y++) if ((MagickOffsetType) length < offsets[y]) length=(size_t) offsets[y]; compact_pixels=(unsigned char *) AcquireQuantumMemory(length,sizeof(*pixels)); if (compact_pixels == (unsigned char *) NULL) { pixels=(unsigned char *) RelinquishMagickMemory(pixels); ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } (void) ResetMagickMemory(compact_pixels,0,length*sizeof(*compact_pixels)); status=MagickTrue; for (y=0; y < (ssize_t) image->rows; y++) { status=MagickFalse; count=ReadBlob(image,(size_t) offsets[y],compact_pixels); if (count != (ssize_t) offsets[y]) break; count=DecodePSDPixels((size_t) offsets[y],compact_pixels, (ssize_t) (image->depth == 1 ? 123456 : image->depth),row_size,pixels); if (count != (ssize_t) row_size) break; status=ReadPSDChannelPixels(image,psd_info->channels,y,type,pixels, exception); if (status == MagickFalse) break; } compact_pixels=(unsigned char *) RelinquishMagickMemory(compact_pixels); pixels=(unsigned char *) RelinquishMagickMemory(pixels); return(status); }
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
~DragTargetDropAckNotificationObserver() {}
~DragTargetDropAckNotificationObserver() {}
C
Chrome
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 int check_object(struct kmem_cache *s, struct page *page, void *object, int active) { u8 *p = object; u8 *endobject = object + s->objsize; if (s->flags & SLAB_RED_ZONE) { unsigned int red = active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE; if (!check_bytes_and_report(s, page, object, "Redzone", endobject, red, s->inuse - s->objsize)) return 0; } else { if ((s->flags & SLAB_POISON) && s->objsize < s->inuse) { check_bytes_and_report(s, page, p, "Alignment padding", endobject, POISON_INUSE, s->inuse - s->objsize); } } if (s->flags & SLAB_POISON) { if (!active && (s->flags & __OBJECT_POISON) && (!check_bytes_and_report(s, page, p, "Poison", p, POISON_FREE, s->objsize - 1) || !check_bytes_and_report(s, page, p, "Poison", p + s->objsize - 1, POISON_END, 1))) return 0; /* * check_pad_bytes cleans up on its own. */ check_pad_bytes(s, page, p); } if (!s->offset && active) /* * Object and freepointer overlap. Cannot check * freepointer while object is allocated. */ return 1; /* Check free pointer validity */ if (!check_valid_pointer(s, page, get_freepointer(s, p))) { object_err(s, page, p, "Freepointer corrupt"); /* * No choice but to zap it and thus loose the remainder * of the free objects in this slab. May cause * another error because the object count is now wrong. */ set_freepointer(s, p, NULL); return 0; } return 1; }
static int check_object(struct kmem_cache *s, struct page *page, void *object, int active) { u8 *p = object; u8 *endobject = object + s->objsize; if (s->flags & SLAB_RED_ZONE) { unsigned int red = active ? SLUB_RED_ACTIVE : SLUB_RED_INACTIVE; if (!check_bytes_and_report(s, page, object, "Redzone", endobject, red, s->inuse - s->objsize)) return 0; } else { if ((s->flags & SLAB_POISON) && s->objsize < s->inuse) { check_bytes_and_report(s, page, p, "Alignment padding", endobject, POISON_INUSE, s->inuse - s->objsize); } } if (s->flags & SLAB_POISON) { if (!active && (s->flags & __OBJECT_POISON) && (!check_bytes_and_report(s, page, p, "Poison", p, POISON_FREE, s->objsize - 1) || !check_bytes_and_report(s, page, p, "Poison", p + s->objsize - 1, POISON_END, 1))) return 0; /* * check_pad_bytes cleans up on its own. */ check_pad_bytes(s, page, p); } if (!s->offset && active) /* * Object and freepointer overlap. Cannot check * freepointer while object is allocated. */ return 1; /* Check free pointer validity */ if (!check_valid_pointer(s, page, get_freepointer(s, p))) { object_err(s, page, p, "Freepointer corrupt"); /* * No choice but to zap it and thus loose the remainder * of the free objects in this slab. May cause * another error because the object count is now wrong. */ set_freepointer(s, p, NULL); return 0; } return 1; }
C
linux
0
CVE-2016-5200
https://www.cvedetails.com/cve/CVE-2016-5200/
CWE-119
https://github.com/chromium/chromium/commit/2f19869af13bbfdcfd682a55c0d2c61c6e102475
2f19869af13bbfdcfd682a55c0d2c61c6e102475
chrome/browser/ui/webauthn: long domains may cause a line break. As requested by UX in [1], allow long host names to split a title into two lines. This allows us to show more of the name before eliding, although sufficiently long names will still trigger elision. Screenshot at https://drive.google.com/open?id=1_V6t2CeZDAVazy3Px-OET2LnB__aEW1r. [1] https://docs.google.com/presentation/d/1TtxkPUchyVZulqgdMcfui-68B0W-DWaFFVJEffGIbLA/edit#slide=id.g5913c4105f_1_12 Change-Id: I70f6541e0db3e9942239304de43b487a7561ca34 Bug: 870892 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1601812 Auto-Submit: Adam Langley <[email protected]> Commit-Queue: Nina Satragno <[email protected]> Reviewed-by: Nina Satragno <[email protected]> Cr-Commit-Position: refs/heads/master@{#658114}
bool AuthenticatorBlePairingBeginSheetModel::IsAcceptButtonVisible() const { return true; }
bool AuthenticatorBlePairingBeginSheetModel::IsAcceptButtonVisible() const { return true; }
C
Chrome
0
CVE-2013-7449
https://www.cvedetails.com/cve/CVE-2013-7449/
CWE-310
https://github.com/hexchat/hexchat/commit/c9b63f7f9be01692b03fa15275135a4910a7e02d
c9b63f7f9be01692b03fa15275135a4910a7e02d
ssl: Validate hostnames Closes #524
tcp_send_len (server *serv, char *buf, int len) { char *dbuf; int noqueue = !serv->outbound_queue; if (!prefs.hex_net_throttle) return server_send_real (serv, buf, len); dbuf = malloc (len + 2); /* first byte is the priority */ dbuf[0] = 2; /* pri 2 for most things */ memcpy (dbuf + 1, buf, len); dbuf[len + 1] = 0; /* privmsg and notice get a lower priority */ if (g_ascii_strncasecmp (dbuf + 1, "PRIVMSG", 7) == 0 || g_ascii_strncasecmp (dbuf + 1, "NOTICE", 6) == 0) { dbuf[0] = 1; } else { /* WHO/MODE get the lowest priority */ if (g_ascii_strncasecmp (dbuf + 1, "WHO ", 4) == 0 || /* but only MODE queries, not changes */ (g_ascii_strncasecmp (dbuf + 1, "MODE", 4) == 0 && strchr (dbuf, '-') == NULL && strchr (dbuf, '+') == NULL)) dbuf[0] = 0; } serv->outbound_queue = g_slist_append (serv->outbound_queue, dbuf); serv->sendq_len += len; /* tcp_send_queue uses strlen */ if (tcp_send_queue (serv) && noqueue) fe_timeout_add (500, tcp_send_queue, serv); return 1; }
tcp_send_len (server *serv, char *buf, int len) { char *dbuf; int noqueue = !serv->outbound_queue; if (!prefs.hex_net_throttle) return server_send_real (serv, buf, len); dbuf = malloc (len + 2); /* first byte is the priority */ dbuf[0] = 2; /* pri 2 for most things */ memcpy (dbuf + 1, buf, len); dbuf[len + 1] = 0; /* privmsg and notice get a lower priority */ if (g_ascii_strncasecmp (dbuf + 1, "PRIVMSG", 7) == 0 || g_ascii_strncasecmp (dbuf + 1, "NOTICE", 6) == 0) { dbuf[0] = 1; } else { /* WHO/MODE get the lowest priority */ if (g_ascii_strncasecmp (dbuf + 1, "WHO ", 4) == 0 || /* but only MODE queries, not changes */ (g_ascii_strncasecmp (dbuf + 1, "MODE", 4) == 0 && strchr (dbuf, '-') == NULL && strchr (dbuf, '+') == NULL)) dbuf[0] = 0; } serv->outbound_queue = g_slist_append (serv->outbound_queue, dbuf); serv->sendq_len += len; /* tcp_send_queue uses strlen */ if (tcp_send_queue (serv) && noqueue) fe_timeout_add (500, tcp_send_queue, serv); return 1; }
C
hexchat
0
CVE-2012-2875
https://www.cvedetails.com/cve/CVE-2012-2875/
null
https://github.com/chromium/chromium/commit/d345af9ed62ee5f431be327967f41c3cc3fe936a
d345af9ed62ee5f431be327967f41c3cc3fe936a
[BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API https://bugs.webkit.org/show_bug.cgi?id=105143 RIM PR 171941 Reviewed by Rob Buis. Internally reviewed by George Staikos. Source/WebCore: TouchPoint instances now provide document coordinates for the viewport and content position of the touch event. The pixel coordinates stored in the TouchPoint should no longer be needed in WebKit. Also adapt to new method names and encapsulation of TouchPoint data members. No change in behavior, no new tests. * platform/blackberry/PlatformTouchPointBlackBerry.cpp: (WebCore::PlatformTouchPoint::PlatformTouchPoint): Source/WebKit/blackberry: TouchPoint instances now provide document coordinates for the viewport and content position of the touch event. The pixel coordinates stored in the TouchPoint should no longer be needed in WebKit. One exception is when passing events to a full screen plugin. Also adapt to new method names and encapsulation of TouchPoint data members. * Api/WebPage.cpp: (BlackBerry::WebKit::WebPage::touchEvent): (BlackBerry::WebKit::WebPage::touchPointAsMouseEvent): (BlackBerry::WebKit::WebPagePrivate::dispatchTouchEventToFullScreenPlugin): (BlackBerry::WebKit::WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin): * WebKitSupport/InputHandler.cpp: (BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint): * WebKitSupport/InputHandler.h: (InputHandler): * WebKitSupport/TouchEventHandler.cpp: (BlackBerry::WebKit::TouchEventHandler::doFatFingers): (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint): * WebKitSupport/TouchEventHandler.h: (TouchEventHandler): Tools: Adapt to new method names and encapsulation of TouchPoint data members. * DumpRenderTree/blackberry/EventSender.cpp: (addTouchPointCallback): (updateTouchPointCallback): (touchEndCallback): (releaseTouchPointCallback): (sendTouchEvent): git-svn-id: svn://svn.chromium.org/blink/trunk@137880 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void WebPage::enableDNSPrefetch() { d->m_page->settings()->setDNSPrefetchingEnabled(true); }
void WebPage::enableDNSPrefetch() { d->m_page->settings()->setDNSPrefetchingEnabled(true); }
C
Chrome
0
CVE-2017-7177
https://www.cvedetails.com/cve/CVE-2017-7177/
CWE-358
https://github.com/inliniac/suricata/commit/4a04f814b15762eb446a5ead4d69d021512df6f8
4a04f814b15762eb446a5ead4d69d021512df6f8
defrag - take protocol into account during re-assembly The IP protocol was not being used to match fragments with their packets allowing a carefully constructed packet with a different protocol to be matched, allowing re-assembly to complete, creating a packet that would not be re-assembled by the destination host.
IPV6DefragInOrderSimpleTest(void) { Packet *p1 = NULL, *p2 = NULL, *p3 = NULL; Packet *reassembled = NULL; int id = 12; int i; int ret = 0; DefragInit(); p1 = IPV6BuildTestPacket(IPPROTO_ICMPV6, id, 0, 1, 'A', 8); if (p1 == NULL) goto end; p2 = IPV6BuildTestPacket(IPPROTO_ICMPV6, id, 1, 1, 'B', 8); if (p2 == NULL) goto end; p3 = IPV6BuildTestPacket(IPPROTO_ICMPV6, id, 2, 0, 'C', 3); if (p3 == NULL) goto end; if (Defrag(NULL, NULL, p1, NULL) != NULL) goto end; if (Defrag(NULL, NULL, p2, NULL) != NULL) goto end; reassembled = Defrag(NULL, NULL, p3, NULL); if (reassembled == NULL) goto end; if (IPV6_GET_PLEN(reassembled) != 19) goto end; /* 40 bytes in we should find 8 bytes of A. */ for (i = 40; i < 40 + 8; i++) { if (GET_PKT_DATA(reassembled)[i] != 'A') goto end; } /* 28 bytes in we should find 8 bytes of B. */ for (i = 48; i < 48 + 8; i++) { if (GET_PKT_DATA(reassembled)[i] != 'B') goto end; } /* And 36 bytes in we should find 3 bytes of C. */ for (i = 56; i < 56 + 3; i++) { if (GET_PKT_DATA(reassembled)[i] != 'C') goto end; } ret = 1; end: if (p1 != NULL) SCFree(p1); if (p2 != NULL) SCFree(p2); if (p3 != NULL) SCFree(p3); if (reassembled != NULL) SCFree(reassembled); DefragDestroy(); return ret; }
IPV6DefragInOrderSimpleTest(void) { Packet *p1 = NULL, *p2 = NULL, *p3 = NULL; Packet *reassembled = NULL; int id = 12; int i; int ret = 0; DefragInit(); p1 = IPV6BuildTestPacket(id, 0, 1, 'A', 8); if (p1 == NULL) goto end; p2 = IPV6BuildTestPacket(id, 1, 1, 'B', 8); if (p2 == NULL) goto end; p3 = IPV6BuildTestPacket(id, 2, 0, 'C', 3); if (p3 == NULL) goto end; if (Defrag(NULL, NULL, p1, NULL) != NULL) goto end; if (Defrag(NULL, NULL, p2, NULL) != NULL) goto end; reassembled = Defrag(NULL, NULL, p3, NULL); if (reassembled == NULL) goto end; if (IPV6_GET_PLEN(reassembled) != 19) goto end; /* 40 bytes in we should find 8 bytes of A. */ for (i = 40; i < 40 + 8; i++) { if (GET_PKT_DATA(reassembled)[i] != 'A') goto end; } /* 28 bytes in we should find 8 bytes of B. */ for (i = 48; i < 48 + 8; i++) { if (GET_PKT_DATA(reassembled)[i] != 'B') goto end; } /* And 36 bytes in we should find 3 bytes of C. */ for (i = 56; i < 56 + 3; i++) { if (GET_PKT_DATA(reassembled)[i] != 'C') goto end; } ret = 1; end: if (p1 != NULL) SCFree(p1); if (p2 != NULL) SCFree(p2); if (p3 != NULL) SCFree(p3); if (reassembled != NULL) SCFree(reassembled); DefragDestroy(); return ret; }
C
suricata
1
CVE-2013-0839
https://www.cvedetails.com/cve/CVE-2013-0839/
CWE-399
https://github.com/chromium/chromium/commit/dd3b6fe574edad231c01c78e4647a74c38dc4178
dd3b6fe574edad231c01c78e4647a74c38dc4178
Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry. * Move common code from GDataFile::InitFromDocumentEntry and GDataDirectory::InitFromDocumentEntry to GDataEntry::InitFromDocumentEntry. * Add GDataDirectoryService::FromDocumentEntry and use this everywhere. * Make ctors of GDataFile, GDataDirectory private, so these must be created by GDataDirectoryService's CreateGDataFile and CreateGDataDirectory. Make GDataEntry ctor protected. BUG=141494 TEST=unit tests. Review URL: https://chromiumcodereview.appspot.com/10854083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151008 0039d316-1c4b-4281-b951-d872f2087c98
void GDataFileSystem::OnGetAvailableSpace( const GetAvailableSpaceCallback& callback, GDataErrorCode status, scoped_ptr<base::Value> data) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); GDataFileError error = util::GDataToGDataFileError(status); if (error != GDATA_FILE_OK) { callback.Run(error, -1, -1); return; } scoped_ptr<AccountMetadataFeed> feed; if (data.get()) feed = AccountMetadataFeed::CreateFrom(*data); if (!feed.get()) { callback.Run(GDATA_FILE_ERROR_FAILED, -1, -1); return; } callback.Run(GDATA_FILE_OK, feed->quota_bytes_total(), feed->quota_bytes_used()); }
void GDataFileSystem::OnGetAvailableSpace( const GetAvailableSpaceCallback& callback, GDataErrorCode status, scoped_ptr<base::Value> data) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); GDataFileError error = util::GDataToGDataFileError(status); if (error != GDATA_FILE_OK) { callback.Run(error, -1, -1); return; } scoped_ptr<AccountMetadataFeed> feed; if (data.get()) feed = AccountMetadataFeed::CreateFrom(*data); if (!feed.get()) { callback.Run(GDATA_FILE_ERROR_FAILED, -1, -1); return; } callback.Run(GDATA_FILE_OK, feed->quota_bytes_total(), feed->quota_bytes_used()); }
C
Chrome
0
CVE-2015-8816
https://www.cvedetails.com/cve/CVE-2015-8816/
null
https://github.com/torvalds/linux/commit/e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
USB: fix invalid memory access in hub_activate() Commit 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") changed the hub_activate() routine to make part of it run in a workqueue. However, the commit failed to take a reference to the usb_hub structure or to lock the hub interface while doing so. As a result, if a hub is plugged in and quickly unplugged before the work routine can run, the routine will try to access memory that has been deallocated. Or, if the hub is unplugged while the routine is running, the memory may be deallocated while it is in active use. This patch fixes the problem by taking a reference to the usb_hub at the start of hub_activate() and releasing it at the end (when the work is finished), and by locking the hub interface while the work routine is running. It also adds a check at the start of the routine to see if the hub has already been disconnected, in which nothing should be done. Signed-off-by: Alan Stern <[email protected]> Reported-by: Alexandru Cornea <[email protected]> Tested-by: Alexandru Cornea <[email protected]> Fixes: 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static void hub_irq(struct urb *urb) { struct usb_hub *hub = urb->context; int status = urb->status; unsigned i; unsigned long bits; switch (status) { case -ENOENT: /* synchronous unlink */ case -ECONNRESET: /* async unlink */ case -ESHUTDOWN: /* hardware going away */ return; default: /* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ dev_dbg(hub->intfdev, "transfer --> %d\n", status); if ((++hub->nerrors < 10) || hub->error) goto resubmit; hub->error = status; /* FALL THROUGH */ /* let hub_wq handle things */ case 0: /* we got data: port status changed */ bits = 0; for (i = 0; i < urb->actual_length; ++i) bits |= ((unsigned long) ((*hub->buffer)[i])) << (i*8); hub->event_bits[0] = bits; break; } hub->nerrors = 0; /* Something happened, let hub_wq figure it out */ kick_hub_wq(hub); resubmit: if (hub->quiescing) return; status = usb_submit_urb(hub->urb, GFP_ATOMIC); if (status != 0 && status != -ENODEV && status != -EPERM) dev_err(hub->intfdev, "resubmit --> %d\n", status); }
static void hub_irq(struct urb *urb) { struct usb_hub *hub = urb->context; int status = urb->status; unsigned i; unsigned long bits; switch (status) { case -ENOENT: /* synchronous unlink */ case -ECONNRESET: /* async unlink */ case -ESHUTDOWN: /* hardware going away */ return; default: /* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ dev_dbg(hub->intfdev, "transfer --> %d\n", status); if ((++hub->nerrors < 10) || hub->error) goto resubmit; hub->error = status; /* FALL THROUGH */ /* let hub_wq handle things */ case 0: /* we got data: port status changed */ bits = 0; for (i = 0; i < urb->actual_length; ++i) bits |= ((unsigned long) ((*hub->buffer)[i])) << (i*8); hub->event_bits[0] = bits; break; } hub->nerrors = 0; /* Something happened, let hub_wq figure it out */ kick_hub_wq(hub); resubmit: if (hub->quiescing) return; status = usb_submit_urb(hub->urb, GFP_ATOMIC); if (status != 0 && status != -ENODEV && status != -EPERM) dev_err(hub->intfdev, "resubmit --> %d\n", status); }
C
linux
0
CVE-2011-3084
https://www.cvedetails.com/cve/CVE-2011-3084/
CWE-264
https://github.com/chromium/chromium/commit/744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126949 0039d316-1c4b-4281-b951-d872f2087c98
skia::PlatformCanvas* MockRenderProcess::GetDrawingCanvas( TransportDIB** memory, const gfx::Rect& rect) { size_t stride = skia::PlatformCanvas::StrideForWidth(rect.width()); size_t size = stride * rect.height(); *memory = TransportDIB::Create(size, transport_dib_next_sequence_number_++); if (!*memory) return NULL; return (*memory)->GetPlatformCanvas(rect.width(), rect.height()); }
skia::PlatformCanvas* MockRenderProcess::GetDrawingCanvas( TransportDIB** memory, const gfx::Rect& rect) { size_t stride = skia::PlatformCanvas::StrideForWidth(rect.width()); size_t size = stride * rect.height(); *memory = TransportDIB::Create(size, transport_dib_next_sequence_number_++); if (!*memory) return NULL; return (*memory)->GetPlatformCanvas(rect.width(), rect.height()); }
C
Chrome
0
CVE-2016-1615
https://www.cvedetails.com/cve/CVE-2016-1615/
CWE-254
https://github.com/chromium/chromium/commit/b399a05453d7b3e2dfdec67865fefe6953bcc59e
b399a05453d7b3e2dfdec67865fefe6953bcc59e
Allocate a FrameSinkId for RenderWidgetHostViewAura in mus+ash RenderWidgetHostViewChildFrame expects its parent to have a valid FrameSinkId. Make sure RenderWidgetHostViewAura has a FrameSinkId even if DelegatedFrameHost is not used (in mus+ash). BUG=706553 [email protected] Review-Url: https://codereview.chromium.org/2847253003 Cr-Commit-Position: refs/heads/master@{#468179}
void RenderWidgetHostViewAura::InsertText(const base::string16& text) { DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE); if (text_input_manager_ && text_input_manager_->GetActiveWidget()) { if (text.length()) text_input_manager_->GetActiveWidget()->ImeCommitText( text, std::vector<blink::WebCompositionUnderline>(), gfx::Range::InvalidRange(), 0); else if (has_composition_text_) text_input_manager_->GetActiveWidget()->ImeFinishComposingText(false); } has_composition_text_ = false; }
void RenderWidgetHostViewAura::InsertText(const base::string16& text) { DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE); if (text_input_manager_ && text_input_manager_->GetActiveWidget()) { if (text.length()) text_input_manager_->GetActiveWidget()->ImeCommitText( text, std::vector<blink::WebCompositionUnderline>(), gfx::Range::InvalidRange(), 0); else if (has_composition_text_) text_input_manager_->GetActiveWidget()->ImeFinishComposingText(false); } has_composition_text_ = false; }
C
Chrome
0
CVE-2013-6368
https://www.cvedetails.com/cve/CVE-2013-6368/
CWE-20
https://github.com/torvalds/linux/commit/fda4e2e85589191b123d31cdc21fd33ee70f50fd
fda4e2e85589191b123d31cdc21fd33ee70f50fd
KVM: x86: Convert vapic synchronization to _cached functions (CVE-2013-6368) In kvm_lapic_sync_from_vapic and kvm_lapic_sync_to_vapic there is the potential to corrupt kernel memory if userspace provides an address that is at the end of a page. This patches concerts those functions to use kvm_write_guest_cached and kvm_read_guest_cached. It also checks the vapic_address specified by userspace during ioctl processing and returns an error to userspace if the address is not a valid GPA. This is generally not guest triggerable, because the required write is done by firmware that runs before the guest. Also, it only affects AMD processors and oldish Intel that do not have the FlexPriority feature (unless you disable FlexPriority, of course; then newer processors are also affected). Fixes: b93463aa59d6 ('KVM: Accelerated apic support') Reported-by: Andrew Honig <[email protected]> Cc: [email protected] Signed-off-by: Andrew Honig <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
static void kvm_gen_update_masterclock(struct kvm *kvm) { #ifdef CONFIG_X86_64 int i; struct kvm_vcpu *vcpu; struct kvm_arch *ka = &kvm->arch; spin_lock(&ka->pvclock_gtod_sync_lock); kvm_make_mclock_inprogress_request(kvm); /* no guest entries from this point */ pvclock_update_vm_gtod_copy(kvm); kvm_for_each_vcpu(i, vcpu, kvm) set_bit(KVM_REQ_CLOCK_UPDATE, &vcpu->requests); /* guest entries allowed */ kvm_for_each_vcpu(i, vcpu, kvm) clear_bit(KVM_REQ_MCLOCK_INPROGRESS, &vcpu->requests); spin_unlock(&ka->pvclock_gtod_sync_lock); #endif }
static void kvm_gen_update_masterclock(struct kvm *kvm) { #ifdef CONFIG_X86_64 int i; struct kvm_vcpu *vcpu; struct kvm_arch *ka = &kvm->arch; spin_lock(&ka->pvclock_gtod_sync_lock); kvm_make_mclock_inprogress_request(kvm); /* no guest entries from this point */ pvclock_update_vm_gtod_copy(kvm); kvm_for_each_vcpu(i, vcpu, kvm) set_bit(KVM_REQ_CLOCK_UPDATE, &vcpu->requests); /* guest entries allowed */ kvm_for_each_vcpu(i, vcpu, kvm) clear_bit(KVM_REQ_MCLOCK_INPROGRESS, &vcpu->requests); spin_unlock(&ka->pvclock_gtod_sync_lock); #endif }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/19190765882e272a6a2162c89acdb29110f7e3cf
19190765882e272a6a2162c89acdb29110f7e3cf
Revert 102184 - [Sync] use base::Time in sync Make EntryKernel/Entry/BaseNode use base::Time instead of int64s. Add sync/util/time.h, with utility functions to manage the sync proto time format. Store times on disk in proto format instead of the local system. This requires a database version bump (to 77). Update SessionChangeProcessor/SessionModelAssociator to use base::Time, too. Remove hackish Now() function. Remove ZeroFields() function, and instead zero-initialize in EntryKernel::EntryKernel() directly. BUG= TEST= Review URL: http://codereview.chromium.org/7981006 [email protected] Review URL: http://codereview.chromium.org/7977034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102186 0039d316-1c4b-4281-b951-d872f2087c98
int DirectoryBackingStore::CreateTables() { VLOG(1) << "First run, creating tables"; int result = ExecQuery(load_dbhandle_, "CREATE TABLE share_version (" "id VARCHAR(128) primary key, data INT)"); if (result != SQLITE_DONE) return result; { sqlite_utils::SQLStatement statement; statement.prepare(load_dbhandle_, "INSERT INTO share_version VALUES(?, ?)"); statement.bind_string(0, dir_name_); statement.bind_int(1, kCurrentDBVersion); result = statement.step(); } if (result != SQLITE_DONE) return result; const bool kCreateAsTempShareInfo = false; result = CreateShareInfoTable(kCreateAsTempShareInfo); if (result != SQLITE_DONE) return result; { sqlite_utils::SQLStatement statement; statement.prepare(load_dbhandle_, "INSERT INTO share_info VALUES" "(?, " // id "?, " // name "?, " // store_birthday "?, " // db_create_version "?, " // db_create_time "-2, " // next_id "?, " // cache_guid "?);"); // notification_state statement.bind_string(0, dir_name_); // id statement.bind_string(1, dir_name_); // name statement.bind_string(2, ""); // store_birthday statement.bind_string(3, SYNC_ENGINE_VERSION_STRING); // db_create_version statement.bind_int(4, static_cast<int32>(time(0))); // db_create_time statement.bind_string(5, GenerateCacheGUID()); // cache_guid statement.bind_blob(11, NULL, 0); // notification_state result = statement.step(); } if (result != SQLITE_DONE) return result; result = CreateModelsTable(); if (result != SQLITE_DONE) return result; result = CreateMetasTable(false); if (result != SQLITE_DONE) return result; { const int64 now = Now(); sqlite_utils::SQLStatement statement; statement.prepare(load_dbhandle_, "INSERT INTO metas " "( id, metahandle, is_dir, ctime, mtime) " "VALUES ( \"r\", 1, 1, ?, ?)"); statement.bind_int64(0, now); statement.bind_int64(1, now); result = statement.step(); } return result; }
int DirectoryBackingStore::CreateTables() { VLOG(1) << "First run, creating tables"; int result = ExecQuery(load_dbhandle_, "CREATE TABLE share_version (" "id VARCHAR(128) primary key, data INT)"); if (result != SQLITE_DONE) return result; { sqlite_utils::SQLStatement statement; statement.prepare(load_dbhandle_, "INSERT INTO share_version VALUES(?, ?)"); statement.bind_string(0, dir_name_); statement.bind_int(1, kCurrentDBVersion); result = statement.step(); } if (result != SQLITE_DONE) return result; const bool kCreateAsTempShareInfo = false; result = CreateShareInfoTable(kCreateAsTempShareInfo); if (result != SQLITE_DONE) return result; { sqlite_utils::SQLStatement statement; statement.prepare(load_dbhandle_, "INSERT INTO share_info VALUES" "(?, " // id "?, " // name "?, " // store_birthday "?, " // db_create_version "?, " // db_create_time "-2, " // next_id "?, " // cache_guid "?);"); // notification_state statement.bind_string(0, dir_name_); // id statement.bind_string(1, dir_name_); // name statement.bind_string(2, ""); // store_birthday statement.bind_string(3, SYNC_ENGINE_VERSION_STRING); // db_create_version statement.bind_int(4, static_cast<int32>(time(0))); // db_create_time statement.bind_string(5, GenerateCacheGUID()); // cache_guid statement.bind_blob(11, NULL, 0); // notification_state result = statement.step(); } if (result != SQLITE_DONE) return result; result = CreateModelsTable(); if (result != SQLITE_DONE) return result; result = CreateMetasTable(false); if (result != SQLITE_DONE) return result; { const int64 now = browser_sync::TimeToProtoTime(base::Time::Now()); sqlite_utils::SQLStatement statement; statement.prepare(load_dbhandle_, "INSERT INTO metas " "( id, metahandle, is_dir, ctime, mtime) " "VALUES ( \"r\", 1, 1, ?, ?)"); statement.bind_int64(0, now); statement.bind_int64(1, now); result = statement.step(); } return result; }
C
Chrome
1
CVE-2011-3927
https://www.cvedetails.com/cve/CVE-2011-3927/
CWE-19
https://github.com/chromium/chromium/commit/58ffd25567098d8ce9443b7c977382929d163b3d
58ffd25567098d8ce9443b7c977382929d163b3d
[skia] not all convex paths are convex, so recompute convexity for the problematic ones https://bugs.webkit.org/show_bug.cgi?id=75960 Reviewed by Stephen White. No new tests. See related chrome issue http://code.google.com/p/chromium/issues/detail?id=108605 * platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::setPathFromConvexPoints): git-svn-id: svn://svn.chromium.org/blink/trunk@104609 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static void setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatPoint* points) { path->incReserve(numPoints); path->moveTo(WebCoreFloatToSkScalar(points[0].x()), WebCoreFloatToSkScalar(points[0].y())); for (size_t i = 1; i < numPoints; ++i) { path->lineTo(WebCoreFloatToSkScalar(points[i].x()), WebCoreFloatToSkScalar(points[i].y())); } /* The code used to just blindly call this path->setIsConvex(true); But webkit can sometimes send us non-convex 4-point values, so we mark the path's convexity as unknown, so it will get computed by skia at draw time. See crbug.com 108605 */ SkPath::Convexity convexity = SkPath::kConvex_Convexity; if (numPoints == 4) convexity = SkPath::kUnknown_Convexity; path->setConvexity(convexity); }
static void setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatPoint* points) { path->incReserve(numPoints); path->moveTo(WebCoreFloatToSkScalar(points[0].x()), WebCoreFloatToSkScalar(points[0].y())); for (size_t i = 1; i < numPoints; ++i) { path->lineTo(WebCoreFloatToSkScalar(points[i].x()), WebCoreFloatToSkScalar(points[i].y())); } path->setIsConvex(true); }
C
Chrome
1
CVE-2017-15397
https://www.cvedetails.com/cve/CVE-2017-15397/
CWE-311
https://github.com/chromium/chromium/commit/0579ed631fb37de5704b54ed2ee466bf29630ad0
0579ed631fb37de5704b54ed2ee466bf29630ad0
Replace base::MakeUnique with std::make_unique in net/. base/memory/ptr_util.h includes will be cleaned up later. Bug: 755727 Change-Id: Ibaf46f05c9b02b76f9a91e819984b087a8c0d434 Reviewed-on: https://chromium-review.googlesource.com/627300 Commit-Queue: Jeremy Roman <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Bence Béky <[email protected]> Cr-Commit-Position: refs/heads/master@{#498123}
ChunkedUploadDataStream::Writer::Writer( base::WeakPtr<ChunkedUploadDataStream> upload_data_stream) : upload_data_stream_(upload_data_stream) {}
ChunkedUploadDataStream::Writer::Writer( base::WeakPtr<ChunkedUploadDataStream> upload_data_stream) : upload_data_stream_(upload_data_stream) {}
C
Chrome
0
CVE-2018-1000127
https://www.cvedetails.com/cve/CVE-2018-1000127/
CWE-190
https://github.com/memcached/memcached/commit/a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00
a8c4a82787b8b6c256d61bd5c42fb7f92d1bae00
Don't overflow item refcount on get Counts as a miss if the refcount is too high. ASCII multigets are the only time refcounts can be held for so long. doing a dirty read of refcount. is aligned. trying to avoid adding an extra refcount branch for all calls of item_get due to performance. might be able to move it in there after logging refactoring simplifies some of the branches.
void conn_close_idle(conn *c) { if (settings.idle_timeout > 0 && (current_time - c->last_cmd_time) > settings.idle_timeout) { if (c->state != conn_new_cmd && c->state != conn_read) { if (settings.verbose > 1) fprintf(stderr, "fd %d wants to timeout, but isn't in read state", c->sfd); return; } if (settings.verbose > 1) fprintf(stderr, "Closing idle fd %d\n", c->sfd); c->thread->stats.idle_kicks++; conn_set_state(c, conn_closing); drive_machine(c); } }
void conn_close_idle(conn *c) { if (settings.idle_timeout > 0 && (current_time - c->last_cmd_time) > settings.idle_timeout) { if (c->state != conn_new_cmd && c->state != conn_read) { if (settings.verbose > 1) fprintf(stderr, "fd %d wants to timeout, but isn't in read state", c->sfd); return; } if (settings.verbose > 1) fprintf(stderr, "Closing idle fd %d\n", c->sfd); c->thread->stats.idle_kicks++; conn_set_state(c, conn_closing); drive_machine(c); } }
C
memcached
0
CVE-2018-20182
https://www.cvedetails.com/cve/CVE-2018-20182/
CWE-119
https://github.com/rdesktop/rdesktop/commit/4dca546d04321a610c1835010b5dad85163b65e1
4dca546d04321a610c1835010b5dad85163b65e1
Malicious RDP server security fixes This commit includes fixes for a set of 21 vulnerabilities in rdesktop when a malicious RDP server is used. All vulnerabilities was identified and reported by Eyal Itkin. * Add rdp_protocol_error function that is used in several fixes * Refactor of process_bitmap_updates * Fix possible integer overflow in s_check_rem() on 32bit arch * Fix memory corruption in process_bitmap_data - CVE-2018-8794 * Fix remote code execution in process_bitmap_data - CVE-2018-8795 * Fix remote code execution in process_plane - CVE-2018-8797 * Fix Denial of Service in mcs_recv_connect_response - CVE-2018-20175 * Fix Denial of Service in mcs_parse_domain_params - CVE-2018-20175 * Fix Denial of Service in sec_parse_crypt_info - CVE-2018-20176 * Fix Denial of Service in sec_recv - CVE-2018-20176 * Fix minor information leak in rdpdr_process - CVE-2018-8791 * Fix Denial of Service in cssp_read_tsrequest - CVE-2018-8792 * Fix remote code execution in cssp_read_tsrequest - CVE-2018-8793 * Fix Denial of Service in process_bitmap_data - CVE-2018-8796 * Fix minor information leak in rdpsnd_process_ping - CVE-2018-8798 * Fix Denial of Service in process_secondary_order - CVE-2018-8799 * Fix remote code execution in in ui_clip_handle_data - CVE-2018-8800 * Fix major information leak in ui_clip_handle_data - CVE-2018-20174 * Fix memory corruption in rdp_in_unistr - CVE-2018-20177 * Fix Denial of Service in process_demand_active - CVE-2018-20178 * Fix remote code execution in lspci_process - CVE-2018-20179 * Fix remote code execution in rdpsnddbg_process - CVE-2018-20180 * Fix remote code execution in seamless_process - CVE-2018-20181 * Fix remote code execution in seamless_process_line - CVE-2018-20182
process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, RD_BOOL delta) { RD_HBITMAP bitmap; BRUSH brush; if (present & 0x000001) { in_uint8(s, os->cache_id); in_uint8(s, os->colour_table); } if (present & 0x000002) rdp_in_coord(s, &os->x, delta); if (present & 0x000004) rdp_in_coord(s, &os->y, delta); if (present & 0x000008) rdp_in_coord(s, &os->cx, delta); if (present & 0x000010) rdp_in_coord(s, &os->cy, delta); if (present & 0x000020) in_uint8(s, os->opcode); if (present & 0x000040) rdp_in_coord(s, &os->srcx, delta); if (present & 0x000080) rdp_in_coord(s, &os->srcy, delta); if (present & 0x000100) rdp_in_colour(s, &os->bgcolour); if (present & 0x000200) rdp_in_colour(s, &os->fgcolour); rdp_parse_brush(s, &os->brush, present >> 10); if (present & 0x008000) in_uint16_le(s, os->cache_idx); if (present & 0x010000) in_uint16_le(s, os->unknown); logger(Graphics, Debug, "process_triblt(), op=0x%x, x=%d, y=%d, cx=%d, cy=%d, id=%d, idx=%d, bs=%d, bg=0x%x, fg=0x%x", os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id, os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour); bitmap = cache_get_bitmap(os->cache_id, os->cache_idx); if (bitmap == NULL) return; setup_brush(&brush, &os->brush); ui_triblt(os->opcode, os->x, os->y, os->cx, os->cy, bitmap, os->srcx, os->srcy, &brush, os->bgcolour, os->fgcolour); }
process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, RD_BOOL delta) { RD_HBITMAP bitmap; BRUSH brush; if (present & 0x000001) { in_uint8(s, os->cache_id); in_uint8(s, os->colour_table); } if (present & 0x000002) rdp_in_coord(s, &os->x, delta); if (present & 0x000004) rdp_in_coord(s, &os->y, delta); if (present & 0x000008) rdp_in_coord(s, &os->cx, delta); if (present & 0x000010) rdp_in_coord(s, &os->cy, delta); if (present & 0x000020) in_uint8(s, os->opcode); if (present & 0x000040) rdp_in_coord(s, &os->srcx, delta); if (present & 0x000080) rdp_in_coord(s, &os->srcy, delta); if (present & 0x000100) rdp_in_colour(s, &os->bgcolour); if (present & 0x000200) rdp_in_colour(s, &os->fgcolour); rdp_parse_brush(s, &os->brush, present >> 10); if (present & 0x008000) in_uint16_le(s, os->cache_idx); if (present & 0x010000) in_uint16_le(s, os->unknown); logger(Graphics, Debug, "process_triblt(), op=0x%x, x=%d, y=%d, cx=%d, cy=%d, id=%d, idx=%d, bs=%d, bg=0x%x, fg=0x%x", os->opcode, os->x, os->y, os->cx, os->cy, os->cache_id, os->cache_idx, os->brush.style, os->bgcolour, os->fgcolour); bitmap = cache_get_bitmap(os->cache_id, os->cache_idx); if (bitmap == NULL) return; setup_brush(&brush, &os->brush); ui_triblt(os->opcode, os->x, os->y, os->cx, os->cy, bitmap, os->srcx, os->srcy, &brush, os->bgcolour, os->fgcolour); }
C
rdesktop
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
LRESULT WebView::onShowWindowEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled) { if (!lParam) { m_isVisible = wParam; if (m_page) m_page->viewStateDidChange(WebPageProxy::ViewIsVisible); } handled = false; return 0; }
LRESULT WebView::onShowWindowEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled) { if (!lParam) { m_isVisible = wParam; if (m_page) m_page->viewStateDidChange(WebPageProxy::ViewIsVisible); } handled = false; return 0; }
C
Chrome
0
CVE-2013-6381
https://www.cvedetails.com/cve/CVE-2013-6381/
CWE-119
https://github.com/torvalds/linux/commit/6fb392b1a63ae36c31f62bc3fc8630b49d602b62
6fb392b1a63ae36c31f62bc3fc8630b49d602b62
qeth: avoid buffer overflow in snmp ioctl Check user-defined length in snmp ioctl request and allow request only if it fits into a qeth command buffer. Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: Frank Blaschka <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Reported-by: Nico Golde <[email protected]> Reported-by: Fabian Yamaguchi <[email protected]> Cc: <[email protected]> Signed-off-by: David S. Miller <[email protected]>
int qeth_get_elements_no(struct qeth_card *card, struct sk_buff *skb, int elems) { int dlen = skb->len - skb->data_len; int elements_needed = PFN_UP((unsigned long)skb->data + dlen - 1) - PFN_DOWN((unsigned long)skb->data); elements_needed += qeth_get_elements_for_frags(skb); if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) { QETH_DBF_MESSAGE(2, "Invalid size of IP packet " "(Number=%d / Length=%d). Discarded.\n", (elements_needed+elems), skb->len); return 0; } return elements_needed; }
int qeth_get_elements_no(struct qeth_card *card, struct sk_buff *skb, int elems) { int dlen = skb->len - skb->data_len; int elements_needed = PFN_UP((unsigned long)skb->data + dlen - 1) - PFN_DOWN((unsigned long)skb->data); elements_needed += qeth_get_elements_for_frags(skb); if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) { QETH_DBF_MESSAGE(2, "Invalid size of IP packet " "(Number=%d / Length=%d). Discarded.\n", (elements_needed+elems), skb->len); return 0; } return elements_needed; }
C
linux
0
CVE-2014-1747
https://www.cvedetails.com/cve/CVE-2014-1747/
CWE-79
https://github.com/chromium/chromium/commit/1924f747637265f563892b8f56a64391f6208194
1924f747637265f563892b8f56a64391f6208194
Allow the cast tray to function as expected when the installed extension is missing API methods. BUG=489445 Review URL: https://codereview.chromium.org/1145833003 Cr-Commit-Position: refs/heads/master@{#330663}
void StopCast() {
void StopCast() { CastConfigDelegate* cast_config = Shell::GetInstance()->system_tray_delegate()->GetCastConfigDelegate(); if (cast_config && cast_config->HasCastExtension()) { cast_config->GetReceiversAndActivities( base::Bind(&StopCastCallback, cast_config)); } }
C
Chrome
1
CVE-2014-7822
https://www.cvedetails.com/cve/CVE-2014-7822/
CWE-264
https://github.com/torvalds/linux/commit/8d0207652cbe27d1f962050737848e5ad4671958
8d0207652cbe27d1f962050737848e5ad4671958
->splice_write() via ->write_iter() iter_file_splice_write() - a ->splice_write() instance that gathers the pipe buffers, builds a bio_vec-based iov_iter covering those and feeds it to ->write_iter(). A bunch of simple cases coverted to that... [AV: fixed the braino spotted by Cyrill] Signed-off-by: Al Viro <[email protected]>
int thaw_bdev(struct block_device *bdev, struct super_block *sb) { int error = -EINVAL; mutex_lock(&bdev->bd_fsfreeze_mutex); if (!bdev->bd_fsfreeze_count) goto out; error = 0; if (--bdev->bd_fsfreeze_count > 0) goto out; if (!sb) goto out; error = thaw_super(sb); if (error) { bdev->bd_fsfreeze_count++; mutex_unlock(&bdev->bd_fsfreeze_mutex); return error; } out: mutex_unlock(&bdev->bd_fsfreeze_mutex); return 0; }
int thaw_bdev(struct block_device *bdev, struct super_block *sb) { int error = -EINVAL; mutex_lock(&bdev->bd_fsfreeze_mutex); if (!bdev->bd_fsfreeze_count) goto out; error = 0; if (--bdev->bd_fsfreeze_count > 0) goto out; if (!sb) goto out; error = thaw_super(sb); if (error) { bdev->bd_fsfreeze_count++; mutex_unlock(&bdev->bd_fsfreeze_mutex); return error; } out: mutex_unlock(&bdev->bd_fsfreeze_mutex); return 0; }
C
linux
0
CVE-2011-4112
https://www.cvedetails.com/cve/CVE-2011-4112/
CWE-264
https://github.com/torvalds/linux/commit/550fd08c2cebad61c548def135f67aba284c6162
550fd08c2cebad61c548def135f67aba284c6162
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There are a handful of drivers that violate this assumption of course, and need to be fixed up. This patch identifies those drivers, and marks them as not being able to support the safe transmission of skbs by clearning the IFF_TX_SKB_SHARING flag in priv_flags Signed-off-by: Neil Horman <[email protected]> CC: Karsten Keil <[email protected]> CC: "David S. Miller" <[email protected]> CC: Jay Vosburgh <[email protected]> CC: Andy Gospodarek <[email protected]> CC: Patrick McHardy <[email protected]> CC: Krzysztof Halasa <[email protected]> CC: "John W. Linville" <[email protected]> CC: Greg Kroah-Hartman <[email protected]> CC: Marcel Holtmann <[email protected]> CC: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void proc_config_on_close(struct inode *inode, struct file *file) { struct proc_data *data = file->private_data; struct proc_dir_entry *dp = PDE(inode); struct net_device *dev = dp->data; struct airo_info *ai = dev->ml_priv; char *line; if ( !data->writelen ) return; readConfigRid(ai, 1); set_bit (FLAG_COMMIT, &ai->flags); line = data->wbuffer; while( line[0] ) { /*** Mode processing */ if ( !strncmp( line, "Mode: ", 6 ) ) { line += 6; if (sniffing_mode(ai)) set_bit (FLAG_RESET, &ai->flags); ai->config.rmode &= ~RXMODE_FULL_MASK; clear_bit (FLAG_802_11, &ai->flags); ai->config.opmode &= ~MODE_CFG_MASK; ai->config.scanMode = SCANMODE_ACTIVE; if ( line[0] == 'a' ) { ai->config.opmode |= MODE_STA_IBSS; } else { ai->config.opmode |= MODE_STA_ESS; if ( line[0] == 'r' ) { ai->config.rmode |= RXMODE_RFMON | RXMODE_DISABLE_802_3_HEADER; ai->config.scanMode = SCANMODE_PASSIVE; set_bit (FLAG_802_11, &ai->flags); } else if ( line[0] == 'y' ) { ai->config.rmode |= RXMODE_RFMON_ANYBSS | RXMODE_DISABLE_802_3_HEADER; ai->config.scanMode = SCANMODE_PASSIVE; set_bit (FLAG_802_11, &ai->flags); } else if ( line[0] == 'l' ) ai->config.rmode |= RXMODE_LANMON; } set_bit (FLAG_COMMIT, &ai->flags); } /*** Radio status */ else if (!strncmp(line,"Radio: ", 7)) { line += 7; if (!strncmp(line,"off",3)) { set_bit (FLAG_RADIO_OFF, &ai->flags); } else { clear_bit (FLAG_RADIO_OFF, &ai->flags); } } /*** NodeName processing */ else if ( !strncmp( line, "NodeName: ", 10 ) ) { int j; line += 10; memset( ai->config.nodeName, 0, 16 ); /* Do the name, assume a space between the mode and node name */ for( j = 0; j < 16 && line[j] != '\n'; j++ ) { ai->config.nodeName[j] = line[j]; } set_bit (FLAG_COMMIT, &ai->flags); } /*** PowerMode processing */ else if ( !strncmp( line, "PowerMode: ", 11 ) ) { line += 11; if ( !strncmp( line, "PSPCAM", 6 ) ) { ai->config.powerSaveMode = POWERSAVE_PSPCAM; set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "PSP", 3 ) ) { ai->config.powerSaveMode = POWERSAVE_PSP; set_bit (FLAG_COMMIT, &ai->flags); } else { ai->config.powerSaveMode = POWERSAVE_CAM; set_bit (FLAG_COMMIT, &ai->flags); } } else if ( !strncmp( line, "DataRates: ", 11 ) ) { int v, i = 0, k = 0; /* i is index into line, k is index to rates */ line += 11; while((v = get_dec_u16(line, &i, 3))!=-1) { ai->config.rates[k++] = (u8)v; line += i + 1; i = 0; } set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "Channel: ", 9 ) ) { int v, i = 0; line += 9; v = get_dec_u16(line, &i, i+3); if ( v != -1 ) { ai->config.channelSet = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } } else if ( !strncmp( line, "XmitPower: ", 11 ) ) { int v, i = 0; line += 11; v = get_dec_u16(line, &i, i+3); if ( v != -1 ) { ai->config.txPower = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } } else if ( !strncmp( line, "WEP: ", 5 ) ) { line += 5; switch( line[0] ) { case 's': ai->config.authType = AUTH_SHAREDKEY; break; case 'e': ai->config.authType = AUTH_ENCRYPT; break; default: ai->config.authType = AUTH_OPEN; break; } set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "LongRetryLimit: ", 16 ) ) { int v, i = 0; line += 16; v = get_dec_u16(line, &i, 3); v = (v<0) ? 0 : ((v>255) ? 255 : v); ai->config.longRetryLimit = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "ShortRetryLimit: ", 17 ) ) { int v, i = 0; line += 17; v = get_dec_u16(line, &i, 3); v = (v<0) ? 0 : ((v>255) ? 255 : v); ai->config.shortRetryLimit = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "RTSThreshold: ", 14 ) ) { int v, i = 0; line += 14; v = get_dec_u16(line, &i, 4); v = (v<0) ? 0 : ((v>AIRO_DEF_MTU) ? AIRO_DEF_MTU : v); ai->config.rtsThres = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "TXMSDULifetime: ", 16 ) ) { int v, i = 0; line += 16; v = get_dec_u16(line, &i, 5); v = (v<0) ? 0 : v; ai->config.txLifetime = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "RXMSDULifetime: ", 16 ) ) { int v, i = 0; line += 16; v = get_dec_u16(line, &i, 5); v = (v<0) ? 0 : v; ai->config.rxLifetime = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "TXDiversity: ", 13 ) ) { ai->config.txDiversity = (line[13]=='l') ? 1 : ((line[13]=='r')? 2: 3); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "RXDiversity: ", 13 ) ) { ai->config.rxDiversity = (line[13]=='l') ? 1 : ((line[13]=='r')? 2: 3); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "FragThreshold: ", 15 ) ) { int v, i = 0; line += 15; v = get_dec_u16(line, &i, 4); v = (v<256) ? 256 : ((v>AIRO_DEF_MTU) ? AIRO_DEF_MTU : v); v = v & 0xfffe; /* Make sure its even */ ai->config.fragThresh = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if (!strncmp(line, "Modulation: ", 12)) { line += 12; switch(*line) { case 'd': ai->config.modulation=MOD_DEFAULT; set_bit(FLAG_COMMIT, &ai->flags); break; case 'c': ai->config.modulation=MOD_CCK; set_bit(FLAG_COMMIT, &ai->flags); break; case 'm': ai->config.modulation=MOD_MOK; set_bit(FLAG_COMMIT, &ai->flags); break; default: airo_print_warn(ai->dev->name, "Unknown modulation"); } } else if (!strncmp(line, "Preamble: ", 10)) { line += 10; switch(*line) { case 'a': ai->config.preamble=PREAMBLE_AUTO; set_bit(FLAG_COMMIT, &ai->flags); break; case 'l': ai->config.preamble=PREAMBLE_LONG; set_bit(FLAG_COMMIT, &ai->flags); break; case 's': ai->config.preamble=PREAMBLE_SHORT; set_bit(FLAG_COMMIT, &ai->flags); break; default: airo_print_warn(ai->dev->name, "Unknown preamble"); } } else { airo_print_warn(ai->dev->name, "Couldn't figure out %s", line); } while( line[0] && line[0] != '\n' ) line++; if ( line[0] ) line++; } airo_config_commit(dev, NULL, NULL, NULL); }
static void proc_config_on_close(struct inode *inode, struct file *file) { struct proc_data *data = file->private_data; struct proc_dir_entry *dp = PDE(inode); struct net_device *dev = dp->data; struct airo_info *ai = dev->ml_priv; char *line; if ( !data->writelen ) return; readConfigRid(ai, 1); set_bit (FLAG_COMMIT, &ai->flags); line = data->wbuffer; while( line[0] ) { /*** Mode processing */ if ( !strncmp( line, "Mode: ", 6 ) ) { line += 6; if (sniffing_mode(ai)) set_bit (FLAG_RESET, &ai->flags); ai->config.rmode &= ~RXMODE_FULL_MASK; clear_bit (FLAG_802_11, &ai->flags); ai->config.opmode &= ~MODE_CFG_MASK; ai->config.scanMode = SCANMODE_ACTIVE; if ( line[0] == 'a' ) { ai->config.opmode |= MODE_STA_IBSS; } else { ai->config.opmode |= MODE_STA_ESS; if ( line[0] == 'r' ) { ai->config.rmode |= RXMODE_RFMON | RXMODE_DISABLE_802_3_HEADER; ai->config.scanMode = SCANMODE_PASSIVE; set_bit (FLAG_802_11, &ai->flags); } else if ( line[0] == 'y' ) { ai->config.rmode |= RXMODE_RFMON_ANYBSS | RXMODE_DISABLE_802_3_HEADER; ai->config.scanMode = SCANMODE_PASSIVE; set_bit (FLAG_802_11, &ai->flags); } else if ( line[0] == 'l' ) ai->config.rmode |= RXMODE_LANMON; } set_bit (FLAG_COMMIT, &ai->flags); } /*** Radio status */ else if (!strncmp(line,"Radio: ", 7)) { line += 7; if (!strncmp(line,"off",3)) { set_bit (FLAG_RADIO_OFF, &ai->flags); } else { clear_bit (FLAG_RADIO_OFF, &ai->flags); } } /*** NodeName processing */ else if ( !strncmp( line, "NodeName: ", 10 ) ) { int j; line += 10; memset( ai->config.nodeName, 0, 16 ); /* Do the name, assume a space between the mode and node name */ for( j = 0; j < 16 && line[j] != '\n'; j++ ) { ai->config.nodeName[j] = line[j]; } set_bit (FLAG_COMMIT, &ai->flags); } /*** PowerMode processing */ else if ( !strncmp( line, "PowerMode: ", 11 ) ) { line += 11; if ( !strncmp( line, "PSPCAM", 6 ) ) { ai->config.powerSaveMode = POWERSAVE_PSPCAM; set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "PSP", 3 ) ) { ai->config.powerSaveMode = POWERSAVE_PSP; set_bit (FLAG_COMMIT, &ai->flags); } else { ai->config.powerSaveMode = POWERSAVE_CAM; set_bit (FLAG_COMMIT, &ai->flags); } } else if ( !strncmp( line, "DataRates: ", 11 ) ) { int v, i = 0, k = 0; /* i is index into line, k is index to rates */ line += 11; while((v = get_dec_u16(line, &i, 3))!=-1) { ai->config.rates[k++] = (u8)v; line += i + 1; i = 0; } set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "Channel: ", 9 ) ) { int v, i = 0; line += 9; v = get_dec_u16(line, &i, i+3); if ( v != -1 ) { ai->config.channelSet = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } } else if ( !strncmp( line, "XmitPower: ", 11 ) ) { int v, i = 0; line += 11; v = get_dec_u16(line, &i, i+3); if ( v != -1 ) { ai->config.txPower = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } } else if ( !strncmp( line, "WEP: ", 5 ) ) { line += 5; switch( line[0] ) { case 's': ai->config.authType = AUTH_SHAREDKEY; break; case 'e': ai->config.authType = AUTH_ENCRYPT; break; default: ai->config.authType = AUTH_OPEN; break; } set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "LongRetryLimit: ", 16 ) ) { int v, i = 0; line += 16; v = get_dec_u16(line, &i, 3); v = (v<0) ? 0 : ((v>255) ? 255 : v); ai->config.longRetryLimit = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "ShortRetryLimit: ", 17 ) ) { int v, i = 0; line += 17; v = get_dec_u16(line, &i, 3); v = (v<0) ? 0 : ((v>255) ? 255 : v); ai->config.shortRetryLimit = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "RTSThreshold: ", 14 ) ) { int v, i = 0; line += 14; v = get_dec_u16(line, &i, 4); v = (v<0) ? 0 : ((v>AIRO_DEF_MTU) ? AIRO_DEF_MTU : v); ai->config.rtsThres = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "TXMSDULifetime: ", 16 ) ) { int v, i = 0; line += 16; v = get_dec_u16(line, &i, 5); v = (v<0) ? 0 : v; ai->config.txLifetime = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "RXMSDULifetime: ", 16 ) ) { int v, i = 0; line += 16; v = get_dec_u16(line, &i, 5); v = (v<0) ? 0 : v; ai->config.rxLifetime = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "TXDiversity: ", 13 ) ) { ai->config.txDiversity = (line[13]=='l') ? 1 : ((line[13]=='r')? 2: 3); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "RXDiversity: ", 13 ) ) { ai->config.rxDiversity = (line[13]=='l') ? 1 : ((line[13]=='r')? 2: 3); set_bit (FLAG_COMMIT, &ai->flags); } else if ( !strncmp( line, "FragThreshold: ", 15 ) ) { int v, i = 0; line += 15; v = get_dec_u16(line, &i, 4); v = (v<256) ? 256 : ((v>AIRO_DEF_MTU) ? AIRO_DEF_MTU : v); v = v & 0xfffe; /* Make sure its even */ ai->config.fragThresh = cpu_to_le16(v); set_bit (FLAG_COMMIT, &ai->flags); } else if (!strncmp(line, "Modulation: ", 12)) { line += 12; switch(*line) { case 'd': ai->config.modulation=MOD_DEFAULT; set_bit(FLAG_COMMIT, &ai->flags); break; case 'c': ai->config.modulation=MOD_CCK; set_bit(FLAG_COMMIT, &ai->flags); break; case 'm': ai->config.modulation=MOD_MOK; set_bit(FLAG_COMMIT, &ai->flags); break; default: airo_print_warn(ai->dev->name, "Unknown modulation"); } } else if (!strncmp(line, "Preamble: ", 10)) { line += 10; switch(*line) { case 'a': ai->config.preamble=PREAMBLE_AUTO; set_bit(FLAG_COMMIT, &ai->flags); break; case 'l': ai->config.preamble=PREAMBLE_LONG; set_bit(FLAG_COMMIT, &ai->flags); break; case 's': ai->config.preamble=PREAMBLE_SHORT; set_bit(FLAG_COMMIT, &ai->flags); break; default: airo_print_warn(ai->dev->name, "Unknown preamble"); } } else { airo_print_warn(ai->dev->name, "Couldn't figure out %s", line); } while( line[0] && line[0] != '\n' ) line++; if ( line[0] ) line++; } airo_config_commit(dev, NULL, NULL, NULL); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/e93dc535728da259ec16d1c3cc393f80b25f64ae
e93dc535728da259ec16d1c3cc393f80b25f64ae
Add a unit test that filenames aren't unintentionally converted to URLs. Also fixes two issues in OSExchangeDataProviderWin: - It used a disjoint set of clipboard formats when handling GetUrl(..., true /* filename conversion */) vs GetFilenames(...), so the actual returned results would vary depending on which one was called. - It incorrectly used ::DragFinish() instead of ::ReleaseStgMedium(). ::DragFinish() is only meant to be used in conjunction with WM_DROPFILES. BUG=346135 Review URL: https://codereview.chromium.org/380553002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283226 0039d316-1c4b-4281-b951-d872f2087c98
void OSExchangeDataProviderWin::SetDragImage( const gfx::ImageSkia& image, const gfx::Vector2d& cursor_offset) { drag_image_ = image; drag_image_offset_ = cursor_offset; }
void OSExchangeDataProviderWin::SetDragImage( const gfx::ImageSkia& image, const gfx::Vector2d& cursor_offset) { drag_image_ = image; drag_image_offset_ = cursor_offset; }
C
Chrome
0
CVE-2013-2915
https://www.cvedetails.com/cve/CVE-2013-2915/
null
https://github.com/chromium/chromium/commit/b12eb22a27110f49a2ad54b9e4ffd0ccb6cf9ce9
b12eb22a27110f49a2ad54b9e4ffd0ccb6cf9ce9
Delete unneeded pending entries in DidFailProvisionalLoad to prevent a spoof. BUG=280512 BUG=278899 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/23978003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222146 0039d316-1c4b-4281-b951-d872f2087c98
NavigationType NavigationControllerImpl::ClassifyNavigation( const ViewHostMsg_FrameNavigate_Params& params) const { if (params.page_id == -1) { return NAVIGATION_TYPE_NAV_IGNORE; } if (params.page_id > web_contents_->GetMaxPageID()) { if (PageTransitionIsMainFrame(params.transition)) return NAVIGATION_TYPE_NEW_PAGE; if (!GetLastCommittedEntry()) return NAVIGATION_TYPE_NAV_IGNORE; return NAVIGATION_TYPE_NEW_SUBFRAME; } DCHECK(!params.history_list_was_cleared); int existing_entry_index = GetEntryIndexWithPageID( web_contents_->GetSiteInstance(), params.page_id); if (existing_entry_index == -1) { NOTREACHED(); LOG(ERROR) << "terminating renderer for bad navigation: " << params.url; RecordAction(UserMetricsAction("BadMessageTerminate_NC")); std::string temp = params.url.spec(); temp.append("#page"); temp.append(base::IntToString(params.page_id)); temp.append("#max"); temp.append(base::IntToString(web_contents_->GetMaxPageID())); temp.append("#frame"); temp.append(base::IntToString(params.frame_id)); temp.append("#ids"); for (int i = 0; i < static_cast<int>(entries_.size()); ++i) { temp.append(base::IntToString(entries_[i]->GetPageID())); temp.append("_"); if (entries_[i]->site_instance()) temp.append(base::IntToString(entries_[i]->site_instance()->GetId())); else temp.append("N"); if (entries_[i]->site_instance() != web_contents_->GetSiteInstance()) temp.append("x"); temp.append(","); } GURL url(temp); static_cast<RenderViewHostImpl*>( web_contents_->GetRenderViewHost())->Send( new ViewMsg_TempCrashWithData(url)); return NAVIGATION_TYPE_NAV_IGNORE; } NavigationEntryImpl* existing_entry = entries_[existing_entry_index].get(); if (!PageTransitionIsMainFrame(params.transition)) { DCHECK(GetLastCommittedEntry()); return NAVIGATION_TYPE_AUTO_SUBFRAME; } if (pending_entry_ && !pending_entry_->is_renderer_initiated() && existing_entry != pending_entry_ && pending_entry_->GetPageID() == -1 && existing_entry == GetLastCommittedEntry()) { return NAVIGATION_TYPE_SAME_PAGE; } if (AreURLsInPageNavigation(existing_entry->GetURL(), params.url, params.was_within_same_page, NAVIGATION_TYPE_UNKNOWN)) { return NAVIGATION_TYPE_IN_PAGE; } return NAVIGATION_TYPE_EXISTING_PAGE; }
NavigationType NavigationControllerImpl::ClassifyNavigation( const ViewHostMsg_FrameNavigate_Params& params) const { if (params.page_id == -1) { return NAVIGATION_TYPE_NAV_IGNORE; } if (params.page_id > web_contents_->GetMaxPageID()) { if (PageTransitionIsMainFrame(params.transition)) return NAVIGATION_TYPE_NEW_PAGE; if (!GetLastCommittedEntry()) return NAVIGATION_TYPE_NAV_IGNORE; return NAVIGATION_TYPE_NEW_SUBFRAME; } DCHECK(!params.history_list_was_cleared); int existing_entry_index = GetEntryIndexWithPageID( web_contents_->GetSiteInstance(), params.page_id); if (existing_entry_index == -1) { NOTREACHED(); LOG(ERROR) << "terminating renderer for bad navigation: " << params.url; RecordAction(UserMetricsAction("BadMessageTerminate_NC")); std::string temp = params.url.spec(); temp.append("#page"); temp.append(base::IntToString(params.page_id)); temp.append("#max"); temp.append(base::IntToString(web_contents_->GetMaxPageID())); temp.append("#frame"); temp.append(base::IntToString(params.frame_id)); temp.append("#ids"); for (int i = 0; i < static_cast<int>(entries_.size()); ++i) { temp.append(base::IntToString(entries_[i]->GetPageID())); temp.append("_"); if (entries_[i]->site_instance()) temp.append(base::IntToString(entries_[i]->site_instance()->GetId())); else temp.append("N"); if (entries_[i]->site_instance() != web_contents_->GetSiteInstance()) temp.append("x"); temp.append(","); } GURL url(temp); static_cast<RenderViewHostImpl*>( web_contents_->GetRenderViewHost())->Send( new ViewMsg_TempCrashWithData(url)); return NAVIGATION_TYPE_NAV_IGNORE; } NavigationEntryImpl* existing_entry = entries_[existing_entry_index].get(); if (!PageTransitionIsMainFrame(params.transition)) { DCHECK(GetLastCommittedEntry()); return NAVIGATION_TYPE_AUTO_SUBFRAME; } if (pending_entry_ && !pending_entry_->is_renderer_initiated() && existing_entry != pending_entry_ && pending_entry_->GetPageID() == -1 && existing_entry == GetLastCommittedEntry()) { return NAVIGATION_TYPE_SAME_PAGE; } if (AreURLsInPageNavigation(existing_entry->GetURL(), params.url, params.was_within_same_page, NAVIGATION_TYPE_UNKNOWN)) { return NAVIGATION_TYPE_IN_PAGE; } return NAVIGATION_TYPE_EXISTING_PAGE; }
C
Chrome
0
CVE-2015-5366
https://www.cvedetails.com/cve/CVE-2015-5366/
CWE-399
https://github.com/torvalds/linux/commit/beb39db59d14990e401e235faf66a6b9b31240b0
beb39db59d14990e401e235faf66a6b9b31240b0
udp: fix behavior of wrong checksums We have two problems in UDP stack related to bogus checksums : 1) We return -EAGAIN to application even if receive queue is not empty. This breaks applications using edge trigger epoll() 2) Under UDP flood, we can loop forever without yielding to other processes, potentially hanging the host, especially on non SMP. This patch is an attempt to make things better. We might in the future add extra support for rt applications wanting to better control time spent doing a recv() in a hostile environment. For example we could validate checksums before queuing packets in socket receive queue. Signed-off-by: Eric Dumazet <[email protected]> Cc: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6) { struct sock *sk = skb->sk; struct udphdr *uh; int err = 0; int is_udplite = IS_UDPLITE(sk); __wsum csum = 0; int offset = skb_transport_offset(skb); int len = skb->len - offset; /* * Create a UDP header */ uh = udp_hdr(skb); uh->source = fl6->fl6_sport; uh->dest = fl6->fl6_dport; uh->len = htons(len); uh->check = 0; if (is_udplite) csum = udplite_csum(skb); else if (udp_sk(sk)->no_check6_tx) { /* UDP csum disabled */ skb->ip_summed = CHECKSUM_NONE; goto send; } else if (skb->ip_summed == CHECKSUM_PARTIAL) { /* UDP hardware csum */ udp6_hwcsum_outgoing(sk, skb, &fl6->saddr, &fl6->daddr, len); goto send; } else csum = udp_csum(skb); /* add protocol-dependent pseudo-header */ uh->check = csum_ipv6_magic(&fl6->saddr, &fl6->daddr, len, fl6->flowi6_proto, csum); if (uh->check == 0) uh->check = CSUM_MANGLED_0; send: err = ip6_send_skb(skb); if (err) { if (err == -ENOBUFS && !inet6_sk(sk)->recverr) { UDP6_INC_STATS_USER(sock_net(sk), UDP_MIB_SNDBUFERRORS, is_udplite); err = 0; } } else UDP6_INC_STATS_USER(sock_net(sk), UDP_MIB_OUTDATAGRAMS, is_udplite); return err; }
static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6) { struct sock *sk = skb->sk; struct udphdr *uh; int err = 0; int is_udplite = IS_UDPLITE(sk); __wsum csum = 0; int offset = skb_transport_offset(skb); int len = skb->len - offset; /* * Create a UDP header */ uh = udp_hdr(skb); uh->source = fl6->fl6_sport; uh->dest = fl6->fl6_dport; uh->len = htons(len); uh->check = 0; if (is_udplite) csum = udplite_csum(skb); else if (udp_sk(sk)->no_check6_tx) { /* UDP csum disabled */ skb->ip_summed = CHECKSUM_NONE; goto send; } else if (skb->ip_summed == CHECKSUM_PARTIAL) { /* UDP hardware csum */ udp6_hwcsum_outgoing(sk, skb, &fl6->saddr, &fl6->daddr, len); goto send; } else csum = udp_csum(skb); /* add protocol-dependent pseudo-header */ uh->check = csum_ipv6_magic(&fl6->saddr, &fl6->daddr, len, fl6->flowi6_proto, csum); if (uh->check == 0) uh->check = CSUM_MANGLED_0; send: err = ip6_send_skb(skb); if (err) { if (err == -ENOBUFS && !inet6_sk(sk)->recverr) { UDP6_INC_STATS_USER(sock_net(sk), UDP_MIB_SNDBUFERRORS, is_udplite); err = 0; } } else UDP6_INC_STATS_USER(sock_net(sk), UDP_MIB_OUTDATAGRAMS, is_udplite); return err; }
C
linux
0
CVE-2015-1285
https://www.cvedetails.com/cve/CVE-2015-1285/
CWE-200
https://github.com/chromium/chromium/commit/39595f8d4dffcb644d438106dcb64a30c139ff0e
39595f8d4dffcb644d438106dcb64a30c139ff0e
[reland] Do not set default wallpaper unless it should do so. [email protected], [email protected] Bug: 751382 Change-Id: Id0793dfe467f737526a95b1e66ed01fbb8860bda Reviewed-on: https://chromium-review.googlesource.com/619754 Commit-Queue: Xiaoqian Dai <[email protected]> Reviewed-by: Alexander Alekseev <[email protected]> Reviewed-by: Biao She <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#498325} Reviewed-on: https://chromium-review.googlesource.com/646430 Cr-Commit-Position: refs/heads/master@{#498982}
base::FilePath GetCustomizedWallpaperDefaultRescaledFileName( const std::string& suffix) { const base::FilePath default_downloaded_file_name = ServicesCustomizationDocument::GetCustomizedWallpaperDownloadedFileName(); const base::FilePath default_cache_dir = ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir(); if (default_downloaded_file_name.empty() || default_cache_dir.empty()) return base::FilePath(); return default_cache_dir.Append( default_downloaded_file_name.BaseName().value() + suffix); }
base::FilePath GetCustomizedWallpaperDefaultRescaledFileName( const std::string& suffix) { const base::FilePath default_downloaded_file_name = ServicesCustomizationDocument::GetCustomizedWallpaperDownloadedFileName(); const base::FilePath default_cache_dir = ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir(); if (default_downloaded_file_name.empty() || default_cache_dir.empty()) return base::FilePath(); return default_cache_dir.Append( default_downloaded_file_name.BaseName().value() + suffix); }
C
Chrome
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_get_next_body_rx_descr(VMXNET3State *s, struct Vmxnet3_RxDesc *d, uint32_t *didx, uint32_t *ridx) { vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_HEAD_BODY_RING, d, didx); /* Try to find corresponding descriptor in head/body ring */ if (d->gen == vmxnet3_get_rx_ring_gen(s, RXQ_IDX, RX_HEAD_BODY_RING)) { /* Only read after generation field verification */ smp_rmb(); /* Re-read to be sure we got the latest version */ vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_HEAD_BODY_RING, d, didx); if (d->btype == VMXNET3_RXD_BTYPE_BODY) { vmxnet3_inc_rx_consumption_counter(s, RXQ_IDX, RX_HEAD_BODY_RING); *ridx = RX_HEAD_BODY_RING; return true; } } /* * If there is no free descriptors on head/body ring or next free * descriptor is a head descriptor switch to body only ring */ vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_BODY_ONLY_RING, d, didx); /* If no more free descriptors - return */ if (d->gen == vmxnet3_get_rx_ring_gen(s, RXQ_IDX, RX_BODY_ONLY_RING)) { /* Only read after generation field verification */ smp_rmb(); /* Re-read to be sure we got the latest version */ vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_BODY_ONLY_RING, d, didx); assert(d->btype == VMXNET3_RXD_BTYPE_BODY); *ridx = RX_BODY_ONLY_RING; vmxnet3_inc_rx_consumption_counter(s, RXQ_IDX, RX_BODY_ONLY_RING); return true; } return false; }
vmxnet3_get_next_body_rx_descr(VMXNET3State *s, struct Vmxnet3_RxDesc *d, uint32_t *didx, uint32_t *ridx) { vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_HEAD_BODY_RING, d, didx); /* Try to find corresponding descriptor in head/body ring */ if (d->gen == vmxnet3_get_rx_ring_gen(s, RXQ_IDX, RX_HEAD_BODY_RING)) { /* Only read after generation field verification */ smp_rmb(); /* Re-read to be sure we got the latest version */ vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_HEAD_BODY_RING, d, didx); if (d->btype == VMXNET3_RXD_BTYPE_BODY) { vmxnet3_inc_rx_consumption_counter(s, RXQ_IDX, RX_HEAD_BODY_RING); *ridx = RX_HEAD_BODY_RING; return true; } } /* * If there is no free descriptors on head/body ring or next free * descriptor is a head descriptor switch to body only ring */ vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_BODY_ONLY_RING, d, didx); /* If no more free descriptors - return */ if (d->gen == vmxnet3_get_rx_ring_gen(s, RXQ_IDX, RX_BODY_ONLY_RING)) { /* Only read after generation field verification */ smp_rmb(); /* Re-read to be sure we got the latest version */ vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_BODY_ONLY_RING, d, didx); assert(d->btype == VMXNET3_RXD_BTYPE_BODY); *ridx = RX_BODY_ONLY_RING; vmxnet3_inc_rx_consumption_counter(s, RXQ_IDX, RX_BODY_ONLY_RING); return true; } return false; }
C
qemu
0
CVE-2017-0375
https://www.cvedetails.com/cve/CVE-2017-0375/
CWE-617
https://github.com/torproject/tor/commit/79b59a2dfcb68897ee89d98587d09e55f07e68d7
79b59a2dfcb68897ee89d98587d09e55f07e68d7
TROVE-2017-004: Fix assertion failure in relay_send_end_cell_from_edge_ This fixes an assertion failure in relay_send_end_cell_from_edge_() when an origin circuit and a cpath_layer = NULL were passed. A service rendezvous circuit could do such a thing when a malformed BEGIN cell is received but shouldn't in the first place because the service needs to send an END cell on the circuit for which it can not do without a cpath_layer. Fixes #22493 Reported-by: Roger Dingledine <[email protected]> Signed-off-by: David Goulet <[email protected]>
connection_edge_end_errno(edge_connection_t *conn) { uint8_t reason; tor_assert(conn); reason = errno_to_stream_end_reason(tor_socket_errno(conn->base_.s)); return connection_edge_end(conn, reason); }
connection_edge_end_errno(edge_connection_t *conn) { uint8_t reason; tor_assert(conn); reason = errno_to_stream_end_reason(tor_socket_errno(conn->base_.s)); return connection_edge_end(conn, reason); }
C
tor
0
CVE-2016-3078
https://www.cvedetails.com/cve/CVE-2016-3078/
CWE-190
https://github.com/php/php-src/commit/3b8d4de300854b3517c7acb239b84f7726c1353c?w=1
3b8d4de300854b3517c7acb239b84f7726c1353c?w=1
Fix bug #71923 - integer overflow in ZipArchive::getFrom*
static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */ { ze_zip_object *obj; zval tmp_member; zval *retval = NULL; zip_prop_handler *hnd = NULL; zend_object_handlers *std_hnd; if (Z_TYPE_P(member) != IS_STRING) { ZVAL_COPY(&tmp_member, member); convert_to_string(&tmp_member); member = &tmp_member; cache_slot = NULL; } obj = Z_ZIP_P(object); if (obj->prop_handler != NULL) { hnd = zend_hash_find_ptr(obj->prop_handler, Z_STR_P(member)); } if (hnd == NULL) { std_hnd = zend_get_std_object_handlers(); retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot); } if (member == &tmp_member) { zval_dtor(member); } return retval; } /* }}} */
static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */ { ze_zip_object *obj; zval tmp_member; zval *retval = NULL; zip_prop_handler *hnd = NULL; zend_object_handlers *std_hnd; if (Z_TYPE_P(member) != IS_STRING) { ZVAL_COPY(&tmp_member, member); convert_to_string(&tmp_member); member = &tmp_member; cache_slot = NULL; } obj = Z_ZIP_P(object); if (obj->prop_handler != NULL) { hnd = zend_hash_find_ptr(obj->prop_handler, Z_STR_P(member)); } if (hnd == NULL) { std_hnd = zend_get_std_object_handlers(); retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot); } if (member == &tmp_member) { zval_dtor(member); } return retval; } /* }}} */
C
php-src
0
CVE-2018-20182
https://www.cvedetails.com/cve/CVE-2018-20182/
CWE-119
https://github.com/rdesktop/rdesktop/commit/4dca546d04321a610c1835010b5dad85163b65e1
4dca546d04321a610c1835010b5dad85163b65e1
Malicious RDP server security fixes This commit includes fixes for a set of 21 vulnerabilities in rdesktop when a malicious RDP server is used. All vulnerabilities was identified and reported by Eyal Itkin. * Add rdp_protocol_error function that is used in several fixes * Refactor of process_bitmap_updates * Fix possible integer overflow in s_check_rem() on 32bit arch * Fix memory corruption in process_bitmap_data - CVE-2018-8794 * Fix remote code execution in process_bitmap_data - CVE-2018-8795 * Fix remote code execution in process_plane - CVE-2018-8797 * Fix Denial of Service in mcs_recv_connect_response - CVE-2018-20175 * Fix Denial of Service in mcs_parse_domain_params - CVE-2018-20175 * Fix Denial of Service in sec_parse_crypt_info - CVE-2018-20176 * Fix Denial of Service in sec_recv - CVE-2018-20176 * Fix minor information leak in rdpdr_process - CVE-2018-8791 * Fix Denial of Service in cssp_read_tsrequest - CVE-2018-8792 * Fix remote code execution in cssp_read_tsrequest - CVE-2018-8793 * Fix Denial of Service in process_bitmap_data - CVE-2018-8796 * Fix minor information leak in rdpsnd_process_ping - CVE-2018-8798 * Fix Denial of Service in process_secondary_order - CVE-2018-8799 * Fix remote code execution in in ui_clip_handle_data - CVE-2018-8800 * Fix major information leak in ui_clip_handle_data - CVE-2018-20174 * Fix memory corruption in rdp_in_unistr - CVE-2018-20177 * Fix Denial of Service in process_demand_active - CVE-2018-20178 * Fix remote code execution in lspci_process - CVE-2018-20179 * Fix remote code execution in rdpsnddbg_process - CVE-2018-20180 * Fix remote code execution in seamless_process - CVE-2018-20181 * Fix remote code execution in seamless_process_line - CVE-2018-20182
process_desksave(STREAM s, DESKSAVE_ORDER * os, uint32 present, RD_BOOL delta) { int width, height; if (present & 0x01) in_uint32_le(s, os->offset); if (present & 0x02) rdp_in_coord(s, &os->left, delta); if (present & 0x04) rdp_in_coord(s, &os->top, delta); if (present & 0x08) rdp_in_coord(s, &os->right, delta); if (present & 0x10) rdp_in_coord(s, &os->bottom, delta); if (present & 0x20) in_uint8(s, os->action); logger(Graphics, Debug, "process_desksave(), l=%d, t=%d, r=%d, b=%d, off=%d, op=%d", os->left, os->top, os->right, os->bottom, os->offset, os->action); width = os->right - os->left + 1; height = os->bottom - os->top + 1; if (os->action == 0) ui_desktop_save(os->offset, os->left, os->top, width, height); else ui_desktop_restore(os->offset, os->left, os->top, width, height); }
process_desksave(STREAM s, DESKSAVE_ORDER * os, uint32 present, RD_BOOL delta) { int width, height; if (present & 0x01) in_uint32_le(s, os->offset); if (present & 0x02) rdp_in_coord(s, &os->left, delta); if (present & 0x04) rdp_in_coord(s, &os->top, delta); if (present & 0x08) rdp_in_coord(s, &os->right, delta); if (present & 0x10) rdp_in_coord(s, &os->bottom, delta); if (present & 0x20) in_uint8(s, os->action); logger(Graphics, Debug, "process_desksave(), l=%d, t=%d, r=%d, b=%d, off=%d, op=%d", os->left, os->top, os->right, os->bottom, os->offset, os->action); width = os->right - os->left + 1; height = os->bottom - os->top + 1; if (os->action == 0) ui_desktop_save(os->offset, os->left, os->top, width, height); else ui_desktop_restore(os->offset, os->left, os->top, width, height); }
C
rdesktop
0
CVE-2011-3053
https://www.cvedetails.com/cve/CVE-2011-3053/
CWE-399
https://github.com/chromium/chromium/commit/c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without aura TBR=sky Review URL: http://codereview.chromium.org/9125006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116746 0039d316-1c4b-4281-b951-d872f2087c98
bool AutolaunchInfoBarDelegate::ShouldExpire( const content::LoadCommittedDetails& details) const { return details.is_navigation_to_different_page() && should_expire_; }
bool AutolaunchInfoBarDelegate::ShouldExpire( const content::LoadCommittedDetails& details) const { return details.is_navigation_to_different_page() && should_expire_; }
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
Cluster::GetEntry( const BlockEntry* Cluster::GetEntry(const CuePoint& cp, const CuePoint::TrackPosition& tp) const { assert(m_pSegment); #if 0 LoadBlockEntries(); if (m_entries == NULL) return NULL; const long long count = m_entries_count; if (count <= 0) return NULL; const long long tc = cp.GetTimeCode(); if ((tp.m_block > 0) && (tp.m_block <= count)) { const size_t block = static_cast<size_t>(tp.m_block); const size_t index = block - 1; const BlockEntry* const pEntry = m_entries[index]; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if ((pBlock->GetTrackNumber() == tp.m_track) && (pBlock->GetTimeCode(this) == tc)) { return pEntry; } } const BlockEntry* const* i = m_entries; const BlockEntry* const* const j = i + count; while (i != j) { #ifdef _DEBUG const ptrdiff_t idx = i - m_entries; idx; #endif const BlockEntry* const pEntry = *i++; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if (pBlock->GetTrackNumber() != tp.m_track) continue; const long long tc_ = pBlock->GetTimeCode(this); assert(tc_ >= 0); if (tc_ < tc) continue; if (tc_ > tc) return NULL; const Tracks* const pTracks = m_pSegment->GetTracks(); assert(pTracks); const long tn = static_cast<long>(tp.m_track); const Track* const pTrack = pTracks->GetTrackByNumber(tn); if (pTrack == NULL) return NULL; const long long type = pTrack->GetType(); if (type == 2) //audio return pEntry; if (type != 1) //not video return NULL; if (!pBlock->IsKey()) return NULL; return pEntry; } return NULL; #else const long long tc = cp.GetTimeCode(); if (tp.m_block > 0) { const long block = static_cast<long>(tp.m_block); const long index = block - 1; while (index >= m_entries_count) { long long pos; long len; const long status = Parse(pos, len); if (status < 0) // TODO: can this happen? return NULL; if (status > 0) // nothing remains to be parsed return NULL; } const BlockEntry* const pEntry = m_entries[index]; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if ((pBlock->GetTrackNumber() == tp.m_track) && (pBlock->GetTimeCode(this) == tc)) { return pEntry; } } long index = 0; for (;;) { if (index >= m_entries_count) { long long pos; long len; const long status = Parse(pos, len); if (status < 0) // TODO: can this happen? return NULL; if (status > 0) // nothing remains to be parsed return NULL; assert(m_entries); assert(index < m_entries_count); } const BlockEntry* const pEntry = m_entries[index]; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if (pBlock->GetTrackNumber() != tp.m_track) { ++index; continue; } const long long tc_ = pBlock->GetTimeCode(this); if (tc_ < tc) { ++index; continue; } if (tc_ > tc) return NULL; const Tracks* const pTracks = m_pSegment->GetTracks(); assert(pTracks); const long tn = static_cast<long>(tp.m_track); const Track* const pTrack = pTracks->GetTrackByNumber(tn); if (pTrack == NULL) return NULL; const long long type = pTrack->GetType(); if (type == 2) // audio return pEntry; if (type != 1) // not video return NULL; if (!pBlock->IsKey()) return NULL; return pEntry; } #endif }
Cluster::GetEntry( const CuePoint& cp, const CuePoint::TrackPosition& tp) const { assert(m_pSegment); #if 0 LoadBlockEntries(); if (m_entries == NULL) return NULL; const long long count = m_entries_count; if (count <= 0) return NULL; const long long tc = cp.GetTimeCode(); if ((tp.m_block > 0) && (tp.m_block <= count)) { const size_t block = static_cast<size_t>(tp.m_block); const size_t index = block - 1; const BlockEntry* const pEntry = m_entries[index]; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if ((pBlock->GetTrackNumber() == tp.m_track) && (pBlock->GetTimeCode(this) == tc)) { return pEntry; } } const BlockEntry* const* i = m_entries; const BlockEntry* const* const j = i + count; while (i != j) { #ifdef _DEBUG const ptrdiff_t idx = i - m_entries; idx; #endif const BlockEntry* const pEntry = *i++; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if (pBlock->GetTrackNumber() != tp.m_track) continue; const long long tc_ = pBlock->GetTimeCode(this); assert(tc_ >= 0); if (tc_ < tc) continue; if (tc_ > tc) return NULL; const Tracks* const pTracks = m_pSegment->GetTracks(); assert(pTracks); const long tn = static_cast<long>(tp.m_track); const Track* const pTrack = pTracks->GetTrackByNumber(tn); if (pTrack == NULL) return NULL; const long long type = pTrack->GetType(); if (type == 2) //audio return pEntry; if (type != 1) //not video return NULL; if (!pBlock->IsKey()) return NULL; return pEntry; } return NULL; #else const long long tc = cp.GetTimeCode(); if (tp.m_block > 0) { const long block = static_cast<long>(tp.m_block); const long index = block - 1; while (index >= m_entries_count) { long long pos; long len; const long status = Parse(pos, len); if (status < 0) //TODO: can this happen? return NULL; if (status > 0) //nothing remains to be parsed return NULL; } const BlockEntry* const pEntry = m_entries[index]; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if ((pBlock->GetTrackNumber() == tp.m_track) && (pBlock->GetTimeCode(this) == tc)) { return pEntry; } } long index = 0; for (;;) { if (index >= m_entries_count) { long long pos; long len; const long status = Parse(pos, len); if (status < 0) //TODO: can this happen? return NULL; if (status > 0) //nothing remains to be parsed return NULL; assert(m_entries); assert(index < m_entries_count); } const BlockEntry* const pEntry = m_entries[index]; assert(pEntry); assert(!pEntry->EOS()); const Block* const pBlock = pEntry->GetBlock(); assert(pBlock); if (pBlock->GetTrackNumber() != tp.m_track) { ++index; continue; } const long long tc_ = pBlock->GetTimeCode(this); if (tc_ < tc) { ++index; continue; } if (tc_ > tc) return NULL; const Tracks* const pTracks = m_pSegment->GetTracks(); assert(pTracks); const long tn = static_cast<long>(tp.m_track); const Track* const pTrack = pTracks->GetTrackByNumber(tn); if (pTrack == NULL) return NULL; const long long type = pTrack->GetType(); if (type == 2) //audio return pEntry; if (type != 1) //not video return NULL; if (!pBlock->IsKey()) return NULL; return pEntry; } #endif }
C
Android
1
CVE-2018-20855
https://www.cvedetails.com/cve/CVE-2018-20855/
CWE-119
https://github.com/torvalds/linux/commit/0625b4ba1a5d4703c7fb01c497bd6c156908af00
0625b4ba1a5d4703c7fb01c497bd6c156908af00
IB/mlx5: Fix leaking stack memory to userspace mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes were written. Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp") Cc: <[email protected]> Acked-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
void mlx5_ib_free_bfreg(struct mlx5_ib_dev *dev, struct mlx5_bfreg_info *bfregi, int bfregn) { mutex_lock(&bfregi->lock); bfregi->count[bfregn]--; mutex_unlock(&bfregi->lock); }
void mlx5_ib_free_bfreg(struct mlx5_ib_dev *dev, struct mlx5_bfreg_info *bfregi, int bfregn) { mutex_lock(&bfregi->lock); bfregi->count[bfregn]--; mutex_unlock(&bfregi->lock); }
C
linux
0
CVE-2011-2491
https://www.cvedetails.com/cve/CVE-2011-2491/
CWE-399
https://github.com/torvalds/linux/commit/0b760113a3a155269a3fba93a409c640031dd68f
0b760113a3a155269a3fba93a409c640031dd68f
NLM: Don't hang forever on NLM unlock requests If the NLM daemon is killed on the NFS server, we can currently end up hanging forever on an 'unlock' request, instead of aborting. Basically, if the rpcbind request fails, or the server keeps returning garbage, we really want to quit instead of retrying. Tested-by: Vasily Averin <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> Cc: [email protected]
void *rpc_malloc(struct rpc_task *task, size_t size) { struct rpc_buffer *buf; gfp_t gfp = RPC_IS_SWAPPER(task) ? GFP_ATOMIC : GFP_NOWAIT; size += sizeof(struct rpc_buffer); if (size <= RPC_BUFFER_MAXSIZE) buf = mempool_alloc(rpc_buffer_mempool, gfp); else buf = kmalloc(size, gfp); if (!buf) return NULL; buf->len = size; dprintk("RPC: %5u allocated buffer of size %zu at %p\n", task->tk_pid, size, buf); return &buf->data; }
void *rpc_malloc(struct rpc_task *task, size_t size) { struct rpc_buffer *buf; gfp_t gfp = RPC_IS_SWAPPER(task) ? GFP_ATOMIC : GFP_NOWAIT; size += sizeof(struct rpc_buffer); if (size <= RPC_BUFFER_MAXSIZE) buf = mempool_alloc(rpc_buffer_mempool, gfp); else buf = kmalloc(size, gfp); if (!buf) return NULL; buf->len = size; dprintk("RPC: %5u allocated buffer of size %zu at %p\n", task->tk_pid, size, buf); return &buf->data; }
C
linux
0
CVE-2016-7398
https://www.cvedetails.com/cve/CVE-2016-7398/
CWE-704
https://github.com/m6w6/ext-http/commit/17137d4ab1ce81a2cee0fae842340a344ef3da83
17137d4ab1ce81a2cee0fae842340a344ef3da83
fix bug #73055
static inline void prepare_key(unsigned flags, char *old_key, size_t old_len, char **new_key, size_t *new_len TSRMLS_DC) { zval zv; INIT_PZVAL(&zv); ZVAL_STRINGL(&zv, old_key, old_len, 1); if (flags & PHP_HTTP_PARAMS_URLENCODED) { prepare_urlencoded(&zv TSRMLS_CC); } if (flags & PHP_HTTP_PARAMS_ESCAPED) { if (flags & PHP_HTTP_PARAMS_RFC5988) { prepare_rfc5988(&zv TSRMLS_CC); } else { prepare_escaped(&zv TSRMLS_CC); } } *new_key = Z_STRVAL(zv); *new_len = Z_STRLEN(zv); }
static inline void prepare_key(unsigned flags, char *old_key, size_t old_len, char **new_key, size_t *new_len TSRMLS_DC) { zval zv; INIT_PZVAL(&zv); ZVAL_STRINGL(&zv, old_key, old_len, 1); if (flags & PHP_HTTP_PARAMS_URLENCODED) { prepare_urlencoded(&zv TSRMLS_CC); } if (flags & PHP_HTTP_PARAMS_ESCAPED) { if (flags & PHP_HTTP_PARAMS_RFC5988) { prepare_rfc5988(&zv TSRMLS_CC); } else { prepare_escaped(&zv TSRMLS_CC); } } *new_key = Z_STRVAL(zv); *new_len = Z_STRLEN(zv); }
C
ext-http
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)
file_setpos(struct file *file, const fpos_t *pos) { if (fsetpos(file->file, pos)) { perror(file->file_name); stop(file, READ_ERROR_CODE, "fsetpos"); } }
file_setpos(struct file *file, const fpos_t *pos) { if (fsetpos(file->file, pos)) { perror(file->file_name); stop(file, READ_ERROR_CODE, "fsetpos"); } }
C
Android
0
CVE-2018-16427
https://www.cvedetails.com/cve/CVE-2018-16427/
CWE-125
https://github.com/OpenSC/OpenSC/pull/1447/commits/8fe377e93b4b56060e5bbfb6f3142ceaeca744fa
8fe377e93b4b56060e5bbfb6f3142ceaeca744fa
fixed out of bounds reads Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.
pgp_delete_file(sc_card_t *card, const sc_path_t *path) { struct pgp_priv_data *priv = DRVDATA(card); pgp_blob_t *blob; sc_file_t *file; int r; LOG_FUNC_CALLED(card->ctx); /* sc_pkcs15init_delete_by_path() sets the path type to SC_PATH_TYPE_FILE_ID */ r = pgp_select_file(card, path, &file); LOG_TEST_RET(card->ctx, r, "Cannot select file."); /* save "current" blob */ blob = priv->current; /* don't try to delete MF */ if (blob == priv->mf) LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED); if (card->type != SC_CARD_TYPE_OPENPGP_GNUK && (file->id == DO_SIGN_SYM || file->id == DO_ENCR_SYM || file->id == DO_AUTH_SYM)) { /* These tags are just symbolic. We don't really delete them. */ r = SC_SUCCESS; } else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_SIGN_SYM) { r = gnuk_delete_key(card, 1); } else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_ENCR_SYM) { r = gnuk_delete_key(card, 2); } else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_AUTH_SYM) { r = gnuk_delete_key(card, 3); } else { /* call pgp_put_data() with zero-sized NULL-buffer to zap the DO contents */ r = pgp_put_data(card, file->id, NULL, 0); } /* set "current" blob to parent */ priv->current = blob->parent; LOG_FUNC_RETURN(card->ctx, r); }
pgp_delete_file(sc_card_t *card, const sc_path_t *path) { struct pgp_priv_data *priv = DRVDATA(card); pgp_blob_t *blob; sc_file_t *file; int r; LOG_FUNC_CALLED(card->ctx); /* sc_pkcs15init_delete_by_path() sets the path type to SC_PATH_TYPE_FILE_ID */ r = pgp_select_file(card, path, &file); LOG_TEST_RET(card->ctx, r, "Cannot select file."); /* save "current" blob */ blob = priv->current; /* don't try to delete MF */ if (blob == priv->mf) LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED); if (card->type != SC_CARD_TYPE_OPENPGP_GNUK && (file->id == DO_SIGN_SYM || file->id == DO_ENCR_SYM || file->id == DO_AUTH_SYM)) { /* These tags are just symbolic. We don't really delete them. */ r = SC_SUCCESS; } else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_SIGN_SYM) { r = gnuk_delete_key(card, 1); } else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_ENCR_SYM) { r = gnuk_delete_key(card, 2); } else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_AUTH_SYM) { r = gnuk_delete_key(card, 3); } else { /* call pgp_put_data() with zero-sized NULL-buffer to zap the DO contents */ r = pgp_put_data(card, file->id, NULL, 0); } /* set "current" blob to parent */ priv->current = blob->parent; LOG_FUNC_RETURN(card->ctx, r); }
C
OpenSC
0
CVE-2015-7509
https://www.cvedetails.com/cve/CVE-2015-7509/
CWE-20
https://github.com/torvalds/linux/commit/c9b92530a723ac5ef8e352885a1862b18f31b2f5
c9b92530a723ac5ef8e352885a1862b18f31b2f5
ext4: make orphan functions be no-op in no-journal mode Instead of checking whether the handle is valid, we check if journal is enabled. This avoids taking the s_orphan_lock mutex in all cases when there is no journal in use, including the error paths where ext4_orphan_del() is called with a handle set to NULL. Signed-off-by: Anatol Pomozov <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct qstr *d_name, struct ext4_dir_entry_2 **res_dir, int *err) { struct super_block * sb = dir->i_sb; struct dx_hash_info hinfo; struct dx_frame frames[2], *frame; struct buffer_head *bh; ext4_lblk_t block; int retval; if (!(frame = dx_probe(d_name, dir, &hinfo, frames, err))) return NULL; do { block = dx_get_block(frame->at); if (!(bh = ext4_bread(NULL, dir, block, 0, err))) goto errout; if (!buffer_verified(bh) && !ext4_dirent_csum_verify(dir, (struct ext4_dir_entry *)bh->b_data)) { EXT4_ERROR_INODE(dir, "checksumming directory " "block %lu", (unsigned long)block); brelse(bh); *err = -EIO; goto errout; } set_buffer_verified(bh); retval = search_dirblock(bh, dir, d_name, block << EXT4_BLOCK_SIZE_BITS(sb), res_dir); if (retval == 1) { /* Success! */ dx_release(frames); return bh; } brelse(bh); if (retval == -1) { *err = ERR_BAD_DX_DIR; goto errout; } /* Check to see if we should continue to search */ retval = ext4_htree_next_block(dir, hinfo.hash, frame, frames, NULL); if (retval < 0) { ext4_warning(sb, "error reading index page in directory #%lu", dir->i_ino); *err = retval; goto errout; } } while (retval == 1); *err = -ENOENT; errout: dxtrace(printk(KERN_DEBUG "%s not found\n", d_name->name)); dx_release (frames); return NULL; }
static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct qstr *d_name, struct ext4_dir_entry_2 **res_dir, int *err) { struct super_block * sb = dir->i_sb; struct dx_hash_info hinfo; struct dx_frame frames[2], *frame; struct buffer_head *bh; ext4_lblk_t block; int retval; if (!(frame = dx_probe(d_name, dir, &hinfo, frames, err))) return NULL; do { block = dx_get_block(frame->at); if (!(bh = ext4_bread(NULL, dir, block, 0, err))) goto errout; if (!buffer_verified(bh) && !ext4_dirent_csum_verify(dir, (struct ext4_dir_entry *)bh->b_data)) { EXT4_ERROR_INODE(dir, "checksumming directory " "block %lu", (unsigned long)block); brelse(bh); *err = -EIO; goto errout; } set_buffer_verified(bh); retval = search_dirblock(bh, dir, d_name, block << EXT4_BLOCK_SIZE_BITS(sb), res_dir); if (retval == 1) { /* Success! */ dx_release(frames); return bh; } brelse(bh); if (retval == -1) { *err = ERR_BAD_DX_DIR; goto errout; } /* Check to see if we should continue to search */ retval = ext4_htree_next_block(dir, hinfo.hash, frame, frames, NULL); if (retval < 0) { ext4_warning(sb, "error reading index page in directory #%lu", dir->i_ino); *err = retval; goto errout; } } while (retval == 1); *err = -ENOENT; errout: dxtrace(printk(KERN_DEBUG "%s not found\n", d_name->name)); dx_release (frames); return NULL; }
C
linux
0
CVE-2017-18233
https://www.cvedetails.com/cve/CVE-2017-18233/
CWE-190
https://cgit.freedesktop.org/exempi/commit/?id=65a8492832b7335ffabd01f5f64d89dec757c260
65a8492832b7335ffabd01f5f64d89dec757c260
null
ContainerChunk::ContainerChunk( ContainerChunk* parent, RIFF_MetaHandler* handler ) : Chunk( parent, handler, false, chunk_CONTAINER ) { bool repairMode = ( 0 != ( handler->parent->openFlags & kXMPFiles_OpenRepairFile )); try { XMP_IO* file = handler->parent->ioRef; XMP_Uns8 level = handler->level; this->containerType = XIO::ReadUns32_LE( file ); if ( level == 0 && handler->riffChunks.size() > 0 ) { XMP_Validate( handler->parent->format == kXMP_AVIFile, "only AVI may have multiple top-level chunks", kXMPErr_BadFileFormat ); XMP_Validate( this->containerType == kType_AVIX, "all chunks beyond main chunk must be type AVIX", kXMPErr_BadFileFormat ); } bool hasSubChunks = ( ( this->id == kChunk_RIFF ) || ( this->id == kChunk_LIST && this->containerType == kType_INFO ) || ( this->id == kChunk_LIST && this->containerType == kType_Tdat ) ); XMP_Int64 endOfChunk = this->oldPos + this->oldSize; if ( (level == 0) && repairMode && (endOfChunk > handler->oldFileSize) ) { endOfChunk = handler->oldFileSize; // assign actual file size this->oldSize = endOfChunk - this->oldPos; //reversely calculate correct oldSize } XMP_Validate( endOfChunk <= handler->oldFileSize, "offset beyond EoF", kXMPErr_BadFileFormat ); Chunk* curChild = 0; if ( hasSubChunks ) { handler->level++; while ( file->Offset() < endOfChunk ) { curChild = RIFF::getChunk( this, handler ); if ( file->Offset() % 2 == 1 ) { XMP_Uns8 pad; file->Read ( &pad, 1 ); // Read the pad, tolerate being at EOF. } if ( (containerType== kType_INFO || containerType == kType_Tdat) && ( curChild->chunkType == chunk_JUNK ) ) { this->children.pop_back(); delete curChild; } // for other chunks: join neighouring Junk chunks into one else if ( (curChild->chunkType == chunk_JUNK) && ( this->children.size() >= 2 ) ) { Chunk* prevChunk = this->children.at( this->children.size() - 2 ); if ( prevChunk->chunkType == chunk_JUNK ) { prevChunk->oldSize += curChild->oldSize; prevChunk->newSize += curChild->newSize; XMP_Enforce( prevChunk->oldSize == prevChunk->newSize ); this->children.pop_back(); delete curChild; } } } handler->level--; XMP_Validate( file->Offset() == endOfChunk, "subchunks exceed outer chunk size", kXMPErr_BadFileFormat ); if ( level==1 && this->id==kChunk_LIST && this->containerType == kType_INFO ) handler->listInfoChunk = this; if ( level==1 && this->id==kChunk_LIST && this->containerType == kType_Tdat ) handler->listTdatChunk = this; } else // skip non-interest container chunk { file->Seek ( (this->oldSize - 8 - 4), kXMP_SeekFromCurrent ); } // if - else } // try catch (XMP_Error& e) { this->release(); // free resources if ( this->parent != 0) this->parent->children.pop_back(); // hereby taken care of, so removing myself... throw e; // re-throw } }
ContainerChunk::ContainerChunk( ContainerChunk* parent, RIFF_MetaHandler* handler ) : Chunk( parent, handler, false, chunk_CONTAINER ) { bool repairMode = ( 0 != ( handler->parent->openFlags & kXMPFiles_OpenRepairFile )); try { XMP_IO* file = handler->parent->ioRef; XMP_Uns8 level = handler->level; this->containerType = XIO::ReadUns32_LE( file ); if ( level == 0 && handler->riffChunks.size() > 0 ) { XMP_Validate( handler->parent->format == kXMP_AVIFile, "only AVI may have multiple top-level chunks", kXMPErr_BadFileFormat ); XMP_Validate( this->containerType == kType_AVIX, "all chunks beyond main chunk must be type AVIX", kXMPErr_BadFileFormat ); } bool hasSubChunks = ( ( this->id == kChunk_RIFF ) || ( this->id == kChunk_LIST && this->containerType == kType_INFO ) || ( this->id == kChunk_LIST && this->containerType == kType_Tdat ) ); XMP_Int64 endOfChunk = this->oldPos + this->oldSize; if ( (level == 0) && repairMode && (endOfChunk > handler->oldFileSize) ) { endOfChunk = handler->oldFileSize; // assign actual file size this->oldSize = endOfChunk - this->oldPos; //reversely calculate correct oldSize } XMP_Validate( endOfChunk <= handler->oldFileSize, "offset beyond EoF", kXMPErr_BadFileFormat ); Chunk* curChild = 0; if ( hasSubChunks ) { handler->level++; while ( file->Offset() < endOfChunk ) { curChild = RIFF::getChunk( this, handler ); if ( file->Offset() % 2 == 1 ) { XMP_Uns8 pad; file->Read ( &pad, 1 ); // Read the pad, tolerate being at EOF. } if ( (containerType== kType_INFO || containerType == kType_Tdat) && ( curChild->chunkType == chunk_JUNK ) ) { this->children.pop_back(); delete curChild; } // for other chunks: join neighouring Junk chunks into one else if ( (curChild->chunkType == chunk_JUNK) && ( this->children.size() >= 2 ) ) { Chunk* prevChunk = this->children.at( this->children.size() - 2 ); if ( prevChunk->chunkType == chunk_JUNK ) { prevChunk->oldSize += curChild->oldSize; prevChunk->newSize += curChild->newSize; XMP_Enforce( prevChunk->oldSize == prevChunk->newSize ); this->children.pop_back(); delete curChild; } } } handler->level--; XMP_Validate( file->Offset() == endOfChunk, "subchunks exceed outer chunk size", kXMPErr_BadFileFormat ); if ( level==1 && this->id==kChunk_LIST && this->containerType == kType_INFO ) handler->listInfoChunk = this; if ( level==1 && this->id==kChunk_LIST && this->containerType == kType_Tdat ) handler->listTdatChunk = this; } else // skip non-interest container chunk { file->Seek ( (this->oldSize - 8 - 4), kXMP_SeekFromCurrent ); } // if - else } // try catch (XMP_Error& e) { this->release(); // free resources if ( this->parent != 0) this->parent->children.pop_back(); // hereby taken care of, so removing myself... throw e; // re-throw } }
CPP
exempi
0
CVE-2015-8543
https://www.cvedetails.com/cve/CVE-2015-8543/
null
https://github.com/torvalds/linux/commit/79462ad02e861803b3840cc782248c7359451cd9
79462ad02e861803b3840cc782248c7359451cd9
net: add validation for the socket syscall protocol argument 郭永刚 reported that one could simply crash the kernel as root by using a simple program: int socket_fd; struct sockaddr_in addr; addr.sin_port = 0; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_family = 10; socket_fd = socket(10,3,0x40000000); connect(socket_fd , &addr,16); AF_INET, AF_INET6 sockets actually only support 8-bit protocol identifiers. inet_sock's skc_protocol field thus is sized accordingly, thus larger protocol identifiers simply cut off the higher bits and store a zero in the protocol fields. This could lead to e.g. NULL function pointer because as a result of the cut off inet_num is zero and we call down to inet_autobind, which is NULL for raw sockets. kernel: Call Trace: kernel: [<ffffffff816db90e>] ? inet_autobind+0x2e/0x70 kernel: [<ffffffff816db9a4>] inet_dgram_connect+0x54/0x80 kernel: [<ffffffff81645069>] SYSC_connect+0xd9/0x110 kernel: [<ffffffff810ac51b>] ? ptrace_notify+0x5b/0x80 kernel: [<ffffffff810236d8>] ? syscall_trace_enter_phase2+0x108/0x200 kernel: [<ffffffff81645e0e>] SyS_connect+0xe/0x10 kernel: [<ffffffff81779515>] tracesys_phase2+0x84/0x89 I found no particular commit which introduced this problem. CVE: CVE-2015-8543 Cc: Cong Wang <[email protected]> Reported-by: 郭永刚 <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
unsigned long snmp_fold_field(void __percpu *mib, int offt) { unsigned long res = 0; int i; for_each_possible_cpu(i) res += snmp_get_cpu_field(mib, i, offt); return res; }
unsigned long snmp_fold_field(void __percpu *mib, int offt) { unsigned long res = 0; int i; for_each_possible_cpu(i) res += snmp_get_cpu_field(mib, i, offt); return res; }
C
linux
0
CVE-2019-14463
https://www.cvedetails.com/cve/CVE-2019-14463/
CWE-125
https://github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc
5ccdf5ef79d742640355d1132fa9e2abc7fbaefc
Fix VD-1301 and VD-1302 vulnerabilities This patch was contributed by Maor Vermucht and Or Peles from VDOO Connected Trust.
int modbus_connect(modbus_t *ctx) { if (ctx == NULL) { errno = EINVAL; return -1; } return ctx->backend->connect(ctx); }
int modbus_connect(modbus_t *ctx) { if (ctx == NULL) { errno = EINVAL; return -1; } return ctx->backend->connect(ctx); }
C
libmodbus
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
void hinf_del(GF_Box *s) { GF_HintInfoBox *hinf = (GF_HintInfoBox *)s; gf_free(hinf); }
void hinf_del(GF_Box *s) { GF_HintInfoBox *hinf = (GF_HintInfoBox *)s; gf_free(hinf); }
C
gpac
0
CVE-2013-0890
https://www.cvedetails.com/cve/CVE-2013-0890/
CWE-119
https://github.com/chromium/chromium/commit/e9c887a80115ddc5c011380f132fe4b36359caf0
e9c887a80115ddc5c011380f132fe4b36359caf0
Fix crash when creating an ImageBitmap from an invalid canvas BUG=354356 Review URL: https://codereview.chromium.org/211313003 git-svn-id: svn://svn.chromium.org/blink/trunk@169973 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ImageBitmapFactories::ImageBitmapLoader::ImageBitmapLoader(ImageBitmapFactories& factory, PassRefPtr<ScriptPromiseResolver> resolver, const IntRect& cropRect) : m_scriptState(ScriptState::current()) , m_loader(FileReaderLoader::ReadAsArrayBuffer, this) , m_factory(&factory) , m_resolver(resolver) , m_cropRect(cropRect) { }
ImageBitmapFactories::ImageBitmapLoader::ImageBitmapLoader(ImageBitmapFactories& factory, PassRefPtr<ScriptPromiseResolver> resolver, const IntRect& cropRect) : m_scriptState(ScriptState::current()) , m_loader(FileReaderLoader::ReadAsArrayBuffer, this) , m_factory(&factory) , m_resolver(resolver) , m_cropRect(cropRect) { }
C
Chrome
0
CVE-2015-5302
https://www.cvedetails.com/cve/CVE-2015-5302/
CWE-200
https://github.com/abrt/libreport/commit/257578a23d1537a2d235aaa2b1488ee4f818e360
257578a23d1537a2d235aaa2b1488ee4f818e360
wizard: fix save users changes after reviewing dump dir files If the user reviewed the dump dir's files during reporting the crash, the changes was thrown away and original data was passed to the bugzilla bug report. report-gtk saves the first text view buffer and then reloads data from the reported problem directory, which causes that the changes made to those text views are thrown away. Function save_text_if_changed(), except of saving text, also reload the files from dump dir and update gui state from the dump dir. The commit moves the reloading and updating gui functions away from this function. Related to rhbz#1270235 Signed-off-by: Matej Habrnal <[email protected]>
static void remove_tabs_from_notebook(GtkNotebook *notebook) { gint n_pages = gtk_notebook_get_n_pages(notebook); int ii; for (ii = 0; ii < n_pages; ii++) { /* removing a page changes the indices, so we always need to remove * page 0 */ gtk_notebook_remove_page(notebook, 0); //we need to always the page 0 } /* Turn off the changed callback during the update */ g_signal_handler_block(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr); g_current_highlighted_word = NULL; GtkTreeIter iter; gboolean valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_sensitive_list), &iter); while (valid) { char *text = NULL; search_item_t *word = NULL; gtk_tree_model_get(GTK_TREE_MODEL(g_ls_sensitive_list), &iter, SEARCH_COLUMN_TEXT, &text, SEARCH_COLUMN_ITEM, &word, -1); free(text); free(word); valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(g_ls_sensitive_list), &iter); } gtk_list_store_clear(g_ls_sensitive_list); g_signal_handler_unblock(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr); }
static void remove_tabs_from_notebook(GtkNotebook *notebook) { gint n_pages = gtk_notebook_get_n_pages(notebook); int ii; for (ii = 0; ii < n_pages; ii++) { /* removing a page changes the indices, so we always need to remove * page 0 */ gtk_notebook_remove_page(notebook, 0); //we need to always the page 0 } /* Turn off the changed callback during the update */ g_signal_handler_block(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr); g_current_highlighted_word = NULL; GtkTreeIter iter; gboolean valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_sensitive_list), &iter); while (valid) { char *text = NULL; search_item_t *word = NULL; gtk_tree_model_get(GTK_TREE_MODEL(g_ls_sensitive_list), &iter, SEARCH_COLUMN_TEXT, &text, SEARCH_COLUMN_ITEM, &word, -1); free(text); free(word); valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(g_ls_sensitive_list), &iter); } gtk_list_store_clear(g_ls_sensitive_list); g_signal_handler_unblock(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr); }
C
libreport
0
CVE-2015-6806
https://www.cvedetails.com/cve/CVE-2015-6806/
CWE-119
https://git.savannah.gnu.org/cgit/screen.git/commit/?id=b7484c224738247b510ed0d268cd577076958f1b
b7484c224738247b510ed0d268cd577076958f1b
null
ClearToEOS() { register int y = curr->w_y, x = curr->w_x; if (x == 0 && y == 0) { ClearScreen(); RestorePosRendition(); return; } LClearArea(&curr->w_layer, x, y, cols - 1, rows - 1, CURR_BCE, 1); MClearArea(curr, x, y, cols - 1, rows - 1, CURR_BCE); RestorePosRendition(); }
ClearToEOS() { register int y = curr->w_y, x = curr->w_x; if (x == 0 && y == 0) { ClearScreen(); RestorePosRendition(); return; } LClearArea(&curr->w_layer, x, y, cols - 1, rows - 1, CURR_BCE, 1); MClearArea(curr, x, y, cols - 1, rows - 1, CURR_BCE); RestorePosRendition(); }
C
savannah
0
CVE-2011-2840
https://www.cvedetails.com/cve/CVE-2011-2840/
CWE-20
https://github.com/chromium/chromium/commit/2db5a2048dfcacfe5ad4311c2b1e435c4c67febc
2db5a2048dfcacfe5ad4311c2b1e435c4c67febc
chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify bug per bug report. Review URL: http://codereview.chromium.org/6882058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83031 0039d316-1c4b-4281-b951-d872f2087c98
void Browser::Exit() { UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_); #if defined(OS_CHROMEOS) chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); const char kLogoutStarted[] = "logout-started"; chromeos::BootTimesLoader::Get()->RecordCurrentStats(kLogoutStarted); PrefService* state = g_browser_process->local_state(); if (state) { std::string owner_locale = state->GetString(prefs::kOwnerLocale); if (!owner_locale.empty() && state->GetString(prefs::kApplicationLocale) != owner_locale && !state->IsManagedPreference(prefs::kApplicationLocale)) { state->SetString(prefs::kApplicationLocale, owner_locale); state->ScheduleSavePersistentPrefs(); } } #endif BrowserList::Exit(); }
void Browser::Exit() { UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_); #if defined(OS_CHROMEOS) chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); const char kLogoutStarted[] = "logout-started"; chromeos::BootTimesLoader::Get()->RecordCurrentStats(kLogoutStarted); PrefService* state = g_browser_process->local_state(); if (state) { std::string owner_locale = state->GetString(prefs::kOwnerLocale); if (!owner_locale.empty() && state->GetString(prefs::kApplicationLocale) != owner_locale && !state->IsManagedPreference(prefs::kApplicationLocale)) { state->SetString(prefs::kApplicationLocale, owner_locale); state->ScheduleSavePersistentPrefs(); } } #endif BrowserList::Exit(); }
C
Chrome
0
CVE-2016-1705
https://www.cvedetails.com/cve/CVE-2016-1705/
null
https://github.com/chromium/chromium/commit/4afb628e068367d5b73440537555902cd12416f8
4afb628e068367d5b73440537555902cd12416f8
gpu/android : Add support for partial swap with surface control. Add support for PostSubBuffer to GLSurfaceEGLSurfaceControl. This should allow the display compositor to draw the minimum sub-rect necessary from the damage tracking in BufferQueue on the client-side, and also to pass this damage rect to the framework. [email protected] Bug: 926020 Change-Id: I73d3320cab68250d4c6865bf21c5531682d8bf61 Reviewed-on: https://chromium-review.googlesource.com/c/1457467 Commit-Queue: Khushal <[email protected]> Commit-Queue: Antoine Labour <[email protected]> Reviewed-by: Antoine Labour <[email protected]> Auto-Submit: Khushal <[email protected]> Cr-Commit-Position: refs/heads/master@{#629852}
void CompositorImpl::SetNeedsComposite() { if (!host_->IsVisible()) return; TRACE_EVENT0("compositor", "Compositor::SetNeedsComposite"); host_->SetNeedsAnimate(); }
void CompositorImpl::SetNeedsComposite() { if (!host_->IsVisible()) return; TRACE_EVENT0("compositor", "Compositor::SetNeedsComposite"); host_->SetNeedsAnimate(); }
C
Chrome
0
CVE-2015-2304
https://www.cvedetails.com/cve/CVE-2015-2304/
CWE-22
https://github.com/libarchive/libarchive/commit/59357157706d47c365b2227739e17daba3607526
59357157706d47c365b2227739e17daba3607526
Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option This fixes a directory traversal in the cpio tool.
passphrase_free(char *ppbuff) { if (ppbuff != NULL) { memset(ppbuff, 0, PPBUFF_SIZE); free(ppbuff); } }
passphrase_free(char *ppbuff) { if (ppbuff != NULL) { memset(ppbuff, 0, PPBUFF_SIZE); free(ppbuff); } }
C
libarchive
0
CVE-2018-16078
https://www.cvedetails.com/cve/CVE-2018-16078/
null
https://github.com/chromium/chromium/commit/b025e82307a8490501bb030266cd955c391abcb7
b025e82307a8490501bb030266cd955c391abcb7
[AF] Don't simplify/dedupe suggestions for (partially) filled sections. Since Autofill does not fill field by field anymore, this simplifying and deduping of suggestions is not useful anymore. Bug: 858820 Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I36f7cfe425a0bdbf5ba7503a3d96773b405cc19b Reviewed-on: https://chromium-review.googlesource.com/1128255 Reviewed-by: Roger McFarlane <[email protected]> Commit-Queue: Sebastien Seguin-Gagnon <[email protected]> Cr-Commit-Position: refs/heads/master@{#573315}
void AutofillManager::OnQueryFormFieldAutofillImpl( int query_id, const FormData& form, const FormFieldData& field, const gfx::RectF& transformed_box, bool autoselect_first_suggestion) { external_delegate_->OnQuery(query_id, form, field, transformed_box); std::vector<Suggestion> suggestions; SuggestionsContext context; GetAvailableSuggestions(form, field, &suggestions, &context); if (context.is_autofill_available) { switch (context.suppress_reason) { case SuppressReason::kNotSuppressed: break; case SuppressReason::kCreditCardsAblation: enable_ablation_logging_ = true; autocomplete_history_manager_->CancelPendingQuery(); external_delegate_->OnSuggestionsReturned(query_id, suggestions, autoselect_first_suggestion); return; case SuppressReason::kAutocompleteOff: return; } if (!suggestions.empty()) { if (context.is_filling_credit_card) { AutofillMetrics::LogIsQueriedCreditCardFormSecure( context.is_context_secure); } if (!has_logged_address_suggestions_count_) { AutofillMetrics::LogAddressSuggestionsCount(suggestions.size()); has_logged_address_suggestions_count_ = true; } } } if (suggestions.empty() && !ShouldShowCreditCardSigninPromo(form, field) && field.should_autocomplete && !(context.focused_field && (IsCreditCardExpirationType( context.focused_field->Type().GetStorableType()) || context.focused_field->Type().html_type() == HTML_TYPE_UNRECOGNIZED || context.focused_field->Type().GetStorableType() == CREDIT_CARD_NUMBER || context.focused_field->Type().GetStorableType() == CREDIT_CARD_VERIFICATION_CODE))) { autocomplete_history_manager_->OnGetAutocompleteSuggestions( query_id, field.name, field.value, field.form_control_type); return; } autocomplete_history_manager_->CancelPendingQuery(); external_delegate_->OnSuggestionsReturned(query_id, suggestions, autoselect_first_suggestion, context.is_all_server_suggestions); }
void AutofillManager::OnQueryFormFieldAutofillImpl( int query_id, const FormData& form, const FormFieldData& field, const gfx::RectF& transformed_box, bool autoselect_first_suggestion) { external_delegate_->OnQuery(query_id, form, field, transformed_box); std::vector<Suggestion> suggestions; SuggestionsContext context; GetAvailableSuggestions(form, field, &suggestions, &context); if (context.is_autofill_available) { switch (context.suppress_reason) { case SuppressReason::kNotSuppressed: break; case SuppressReason::kCreditCardsAblation: enable_ablation_logging_ = true; autocomplete_history_manager_->CancelPendingQuery(); external_delegate_->OnSuggestionsReturned(query_id, suggestions, autoselect_first_suggestion); return; case SuppressReason::kAutocompleteOff: return; } if (!suggestions.empty()) { if (context.is_filling_credit_card) { AutofillMetrics::LogIsQueriedCreditCardFormSecure( context.is_context_secure); } if (!has_logged_address_suggestions_count_ && !context.section_has_autofilled_field) { AutofillMetrics::LogAddressSuggestionsCount(suggestions.size()); has_logged_address_suggestions_count_ = true; } } } if (suggestions.empty() && !ShouldShowCreditCardSigninPromo(form, field) && field.should_autocomplete && !(context.focused_field && (IsCreditCardExpirationType( context.focused_field->Type().GetStorableType()) || context.focused_field->Type().html_type() == HTML_TYPE_UNRECOGNIZED || context.focused_field->Type().GetStorableType() == CREDIT_CARD_NUMBER || context.focused_field->Type().GetStorableType() == CREDIT_CARD_VERIFICATION_CODE))) { autocomplete_history_manager_->OnGetAutocompleteSuggestions( query_id, field.name, field.value, field.form_control_type); return; } autocomplete_history_manager_->CancelPendingQuery(); external_delegate_->OnSuggestionsReturned(query_id, suggestions, autoselect_first_suggestion, context.is_all_server_suggestions); }
C
Chrome
1
CVE-2016-5158
https://www.cvedetails.com/cve/CVE-2016-5158/
CWE-190
https://github.com/chromium/chromium/commit/6a310d99a741f9ba5e4e537c5ec49d3adbe5876f
6a310d99a741f9ba5e4e537c5ec49d3adbe5876f
Position info (item n of m) incorrect if hidden focusable items in list Bug: 836997 Change-Id: I971fa7076f72d51829b36af8e379260d48ca25ec Reviewed-on: https://chromium-review.googlesource.com/c/1450235 Commit-Queue: Aaron Leventhal <[email protected]> Reviewed-by: Nektarios Paisios <[email protected]> Cr-Commit-Position: refs/heads/master@{#628890}
void RunCSSTest(const base::FilePath::CharType* file_path) { base::FilePath test_path = GetTestFilePath("accessibility", "css"); { base::ScopedAllowBlockingForTesting allow_blocking; ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName(); } base::FilePath css_file = test_path.Append(base::FilePath(file_path)); RunTest(css_file, "accessibility/css"); }
void RunCSSTest(const base::FilePath::CharType* file_path) { base::FilePath test_path = GetTestFilePath("accessibility", "css"); { base::ScopedAllowBlockingForTesting allow_blocking; ASSERT_TRUE(base::PathExists(test_path)) << test_path.LossyDisplayName(); } base::FilePath css_file = test_path.Append(base::FilePath(file_path)); RunTest(css_file, "accessibility/css"); }
C
Chrome
0
CVE-2017-15391
https://www.cvedetails.com/cve/CVE-2017-15391/
null
https://github.com/chromium/chromium/commit/f1afce25b3f94d8bddec69b08ffbc29b989ad844
f1afce25b3f94d8bddec69b08ffbc29b989ad844
[Extensions] Update navigations across hypothetical extension extents Update code to treat navigations across hypothetical extension extents (e.g. for nonexistent extensions) the same as we do for navigations crossing installed extension extents. Bug: 598265 Change-Id: Ibdf2f563ce1fd108ead279077901020a24de732b Reviewed-on: https://chromium-review.googlesource.com/617180 Commit-Queue: Devlin <[email protected]> Reviewed-by: Alex Moshchuk <[email protected]> Reviewed-by: Nasko Oskov <[email protected]> Cr-Commit-Position: refs/heads/master@{#495779}
GURL ChromeContentBrowserClientExtensionsPart::GetEffectiveURL( Profile* profile, const GURL& url) { ExtensionRegistry* registry = ExtensionRegistry::Get(profile); if (!registry) return url; const Extension* extension = registry->enabled_extensions().GetHostedAppByURL(url); if (!extension) return url; if (extension->from_bookmark()) return url; return extension->GetResourceURL(url.path()); }
GURL ChromeContentBrowserClientExtensionsPart::GetEffectiveURL( Profile* profile, const GURL& url) { ExtensionRegistry* registry = ExtensionRegistry::Get(profile); if (!registry) return url; const Extension* extension = registry->enabled_extensions().GetHostedAppByURL(url); if (!extension) return url; if (extension->from_bookmark()) return url; return extension->GetResourceURL(url.path()); }
C
Chrome
0
CVE-2015-8126
https://www.cvedetails.com/cve/CVE-2015-8126/
CWE-119
https://github.com/chromium/chromium/commit/7f3d85b096f66870a15b37c2f40b219b2e292693
7f3d85b096f66870a15b37c2f40b219b2e292693
third_party/libpng: update to 1.2.54 [email protected] BUG=560291 Review URL: https://codereview.chromium.org/1467263003 Cr-Commit-Position: refs/heads/master@{#362298}
png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) { png_uint_32 i; png_uint_32 row_width = row_info->width; png_debug(1, "in png_do_gray_to_rgb"); if (row_info->bit_depth >= 8 && #ifdef PNG_USELESS_TESTS_SUPPORTED row != NULL && row_info != NULL && #endif !(row_info->color_type & PNG_COLOR_MASK_COLOR)) { if (row_info->color_type == PNG_COLOR_TYPE_GRAY) { if (row_info->bit_depth == 8) { png_bytep sp = row + (png_size_t)row_width - 1; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(dp--) = *sp; *(dp--) = *sp; *(dp--) = *(sp--); } } else { png_bytep sp = row + (png_size_t)row_width * 2 - 1; png_bytep dp = sp + (png_size_t)row_width * 4; for (i = 0; i < row_width; i++) { *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *(sp--); *(dp--) = *(sp--); } } } else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { if (row_info->bit_depth == 8) { png_bytep sp = row + (png_size_t)row_width * 2 - 1; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(dp--) = *(sp--); *(dp--) = *sp; *(dp--) = *sp; *(dp--) = *(sp--); } } else { png_bytep sp = row + (png_size_t)row_width * 4 - 1; png_bytep dp = sp + (png_size_t)row_width * 4; for (i = 0; i < row_width; i++) { *(dp--) = *(sp--); *(dp--) = *(sp--); *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *(sp--); *(dp--) = *(sp--); } } } row_info->channels += (png_byte)2; row_info->color_type |= PNG_COLOR_MASK_COLOR; row_info->pixel_depth = (png_byte)(row_info->channels * row_info->bit_depth); row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); } }
png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) { png_uint_32 i; png_uint_32 row_width = row_info->width; png_debug(1, "in png_do_gray_to_rgb"); if (row_info->bit_depth >= 8 && #ifdef PNG_USELESS_TESTS_SUPPORTED row != NULL && row_info != NULL && #endif !(row_info->color_type & PNG_COLOR_MASK_COLOR)) { if (row_info->color_type == PNG_COLOR_TYPE_GRAY) { if (row_info->bit_depth == 8) { png_bytep sp = row + (png_size_t)row_width - 1; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(dp--) = *sp; *(dp--) = *sp; *(dp--) = *(sp--); } } else { png_bytep sp = row + (png_size_t)row_width * 2 - 1; png_bytep dp = sp + (png_size_t)row_width * 4; for (i = 0; i < row_width; i++) { *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *(sp--); *(dp--) = *(sp--); } } } else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { if (row_info->bit_depth == 8) { png_bytep sp = row + (png_size_t)row_width * 2 - 1; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { *(dp--) = *(sp--); *(dp--) = *sp; *(dp--) = *sp; *(dp--) = *(sp--); } } else { png_bytep sp = row + (png_size_t)row_width * 4 - 1; png_bytep dp = sp + (png_size_t)row_width * 4; for (i = 0; i < row_width; i++) { *(dp--) = *(sp--); *(dp--) = *(sp--); *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *sp; *(dp--) = *(sp - 1); *(dp--) = *(sp--); *(dp--) = *(sp--); } } } row_info->channels += (png_byte)2; row_info->color_type |= PNG_COLOR_MASK_COLOR; row_info->pixel_depth = (png_byte)(row_info->channels * row_info->bit_depth); row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); } }
C
Chrome
0
CVE-2016-6198
https://www.cvedetails.com/cve/CVE-2016-6198/
CWE-284
https://github.com/torvalds/linux/commit/54d5ca871e72f2bb172ec9323497f01cd5091ec7
54d5ca871e72f2bb172ec9323497f01cd5091ec7
vfs: add vfs_select_inode() helper Signed-off-by: Miklos Szeredi <[email protected]> Cc: <[email protected]> # v4.2+
SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) { struct fd f = fdget(fd); int error = -EBADF; if (!f.file) goto out; error = mnt_want_write_file(f.file); if (error) goto out_fput; audit_file(f.file); error = chown_common(&f.file->f_path, user, group); mnt_drop_write_file(f.file); out_fput: fdput(f); out: return error; }
SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) { struct fd f = fdget(fd); int error = -EBADF; if (!f.file) goto out; error = mnt_want_write_file(f.file); if (error) goto out_fput; audit_file(f.file); error = chown_common(&f.file->f_path, user, group); mnt_drop_write_file(f.file); out_fput: fdput(f); out: return error; }
C
linux
0
CVE-2012-2891
https://www.cvedetails.com/cve/CVE-2012-2891/
CWE-200
https://github.com/chromium/chromium/commit/116d0963cadfbf55ef2ec3d13781987c4d80517a
116d0963cadfbf55ef2ec3d13781987c4d80517a
Print preview: Use an ID instead of memory pointer string in WebUI. BUG=144051 Review URL: https://chromiumcodereview.appspot.com/10870003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153342 0039d316-1c4b-4281-b951-d872f2087c98
void PrintPreviewUI::OnInitiatorTabClosed() { TabContents* preview_tab = TabContents::FromWebContents(web_ui()->GetWebContents()); printing::BackgroundPrintingManager* background_printing_manager = g_browser_process->background_printing_manager(); if (background_printing_manager->HasPrintPreviewTab(preview_tab)) web_ui()->CallJavascriptFunction("cancelPendingPrintRequest"); else OnClosePrintPreviewTab(); }
void PrintPreviewUI::OnInitiatorTabClosed() { TabContents* preview_tab = TabContents::FromWebContents(web_ui()->GetWebContents()); printing::BackgroundPrintingManager* background_printing_manager = g_browser_process->background_printing_manager(); if (background_printing_manager->HasPrintPreviewTab(preview_tab)) web_ui()->CallJavascriptFunction("cancelPendingPrintRequest"); else OnClosePrintPreviewTab(); }
C
Chrome
0
CVE-2018-6138
https://www.cvedetails.com/cve/CVE-2018-6138/
CWE-20
https://github.com/chromium/chromium/commit/0aca6bc05a263ea9eafee515fc6ba14da94c1964
0aca6bc05a263ea9eafee515fc6ba14da94c1964
[Extensions] Restrict tabs.captureVisibleTab() Modify the permissions for tabs.captureVisibleTab(). Instead of just checking for <all_urls> and assuming its safe, do the following: - If the page is a "normal" web page (e.g., http/https), allow the capture if the extension has activeTab granted or <all_urls>. - If the page is a file page (file:///), allow the capture if the extension has file access *and* either of the <all_urls> or activeTab permissions. - If the page is a chrome:// page, allow the capture only if the extension has activeTab granted. Bug: 810220 Change-Id: I1e2f71281e2f331d641ba0e435df10d66d721304 Reviewed-on: https://chromium-review.googlesource.com/981195 Commit-Queue: Devlin <[email protected]> Reviewed-by: Karan Bhatia <[email protected]> Cr-Commit-Position: refs/heads/master@{#548891}
ExtensionFunction::ResponseAction WindowsRemoveFunction::Run() { std::unique_ptr<windows::Remove::Params> params( windows::Remove::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); Browser* browser = nullptr; std::string error; if (!windows_util::GetBrowserFromWindowID(this, params->window_id, WindowController::kNoWindowFilter, &browser, &error)) { return RespondNow(Error(error)); } #if defined(OS_CHROMEOS) if (ash::IsWindowTrustedPinned(browser->window()) && !ExtensionHasLockedFullscreenPermission(extension())) { return RespondNow( Error(keys::kMissingLockWindowFullscreenPrivatePermission)); } #endif WindowController* controller = browser->extension_window_controller(); WindowController::Reason reason; if (!controller->CanClose(&reason)) { return RespondNow(Error(reason == WindowController::REASON_NOT_EDITABLE ? keys::kTabStripNotEditableError : kUnknownErrorDoNotUse)); } controller->window()->Close(); return RespondNow(NoArguments()); }
ExtensionFunction::ResponseAction WindowsRemoveFunction::Run() { std::unique_ptr<windows::Remove::Params> params( windows::Remove::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); Browser* browser = nullptr; std::string error; if (!windows_util::GetBrowserFromWindowID(this, params->window_id, WindowController::kNoWindowFilter, &browser, &error)) { return RespondNow(Error(error)); } #if defined(OS_CHROMEOS) if (ash::IsWindowTrustedPinned(browser->window()) && !ExtensionHasLockedFullscreenPermission(extension())) { return RespondNow( Error(keys::kMissingLockWindowFullscreenPrivatePermission)); } #endif WindowController* controller = browser->extension_window_controller(); WindowController::Reason reason; if (!controller->CanClose(&reason)) { return RespondNow(Error(reason == WindowController::REASON_NOT_EDITABLE ? keys::kTabStripNotEditableError : kUnknownErrorDoNotUse)); } controller->window()->Close(); return RespondNow(NoArguments()); }
C
Chrome
0
CVE-2016-7948
https://www.cvedetails.com/cve/CVE-2016-7948/
CWE-787
https://cgit.freedesktop.org/xorg/lib/libXrandr/commit/?id=a0df3e1c7728205e5c7650b2e6dce684139254a6
a0df3e1c7728205e5c7650b2e6dce684139254a6
null
XRRAllocateMonitor(Display *dpy, int noutput) { XRRMonitorInfo *monitor = calloc(1, sizeof (XRRMonitorInfo) + noutput * sizeof (RROutput)); if (!monitor) return NULL; monitor->outputs = (RROutput *) (monitor + 1); monitor->noutput = noutput; return monitor; }
XRRAllocateMonitor(Display *dpy, int noutput) { XRRMonitorInfo *monitor = calloc(1, sizeof (XRRMonitorInfo) + noutput * sizeof (RROutput)); if (!monitor) return NULL; monitor->outputs = (RROutput *) (monitor + 1); monitor->noutput = noutput; return monitor; }
C
libXrandr
0
CVE-2011-4326
https://www.cvedetails.com/cve/CVE-2011-4326/
CWE-399
https://github.com/torvalds/linux/commit/a9cf73ea7ff78f52662c8658d93c226effbbedde
a9cf73ea7ff78f52662c8658d93c226effbbedde
ipv6: udp: fix the wrong headroom check At this point, skb->data points to skb_transport_header. So, headroom check is wrong. For some case:bridge(UFO is on) + eth device(UFO is off), there is no enough headroom for IPv6 frag head. But headroom check is always false. This will bring about data be moved to there prior to skb->head, when adding IPv6 frag header to skb. Signed-off-by: Shan Wei <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static inline int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto) { int err; UDP_SKB_CB(skb)->partial_cov = 0; UDP_SKB_CB(skb)->cscov = skb->len; if (proto == IPPROTO_UDPLITE) { err = udplite_checksum_init(skb, uh); if (err) return err; } if (uh->check == 0) { /* RFC 2460 section 8.1 says that we SHOULD log this error. Well, it is reasonable. */ LIMIT_NETDEBUG(KERN_INFO "IPv6: udp checksum is 0\n"); return 1; } if (skb->ip_summed == CHECKSUM_COMPLETE && !csum_ipv6_magic(&ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, skb->len, proto, skb->csum)) skb->ip_summed = CHECKSUM_UNNECESSARY; if (!skb_csum_unnecessary(skb)) skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, skb->len, proto, 0)); return 0; }
static inline int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto) { int err; UDP_SKB_CB(skb)->partial_cov = 0; UDP_SKB_CB(skb)->cscov = skb->len; if (proto == IPPROTO_UDPLITE) { err = udplite_checksum_init(skb, uh); if (err) return err; } if (uh->check == 0) { /* RFC 2460 section 8.1 says that we SHOULD log this error. Well, it is reasonable. */ LIMIT_NETDEBUG(KERN_INFO "IPv6: udp checksum is 0\n"); return 1; } if (skb->ip_summed == CHECKSUM_COMPLETE && !csum_ipv6_magic(&ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, skb->len, proto, skb->csum)) skb->ip_summed = CHECKSUM_UNNECESSARY; if (!skb_csum_unnecessary(skb)) skb->csum = ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr, skb->len, proto, 0)); return 0; }
C
linux
0
CVE-2018-20182
https://www.cvedetails.com/cve/CVE-2018-20182/
CWE-119
https://github.com/rdesktop/rdesktop/commit/4dca546d04321a610c1835010b5dad85163b65e1
4dca546d04321a610c1835010b5dad85163b65e1
Malicious RDP server security fixes This commit includes fixes for a set of 21 vulnerabilities in rdesktop when a malicious RDP server is used. All vulnerabilities was identified and reported by Eyal Itkin. * Add rdp_protocol_error function that is used in several fixes * Refactor of process_bitmap_updates * Fix possible integer overflow in s_check_rem() on 32bit arch * Fix memory corruption in process_bitmap_data - CVE-2018-8794 * Fix remote code execution in process_bitmap_data - CVE-2018-8795 * Fix remote code execution in process_plane - CVE-2018-8797 * Fix Denial of Service in mcs_recv_connect_response - CVE-2018-20175 * Fix Denial of Service in mcs_parse_domain_params - CVE-2018-20175 * Fix Denial of Service in sec_parse_crypt_info - CVE-2018-20176 * Fix Denial of Service in sec_recv - CVE-2018-20176 * Fix minor information leak in rdpdr_process - CVE-2018-8791 * Fix Denial of Service in cssp_read_tsrequest - CVE-2018-8792 * Fix remote code execution in cssp_read_tsrequest - CVE-2018-8793 * Fix Denial of Service in process_bitmap_data - CVE-2018-8796 * Fix minor information leak in rdpsnd_process_ping - CVE-2018-8798 * Fix Denial of Service in process_secondary_order - CVE-2018-8799 * Fix remote code execution in in ui_clip_handle_data - CVE-2018-8800 * Fix major information leak in ui_clip_handle_data - CVE-2018-20174 * Fix memory corruption in rdp_in_unistr - CVE-2018-20177 * Fix Denial of Service in process_demand_active - CVE-2018-20178 * Fix remote code execution in lspci_process - CVE-2018-20179 * Fix remote code execution in rdpsnddbg_process - CVE-2018-20180 * Fix remote code execution in seamless_process - CVE-2018-20181 * Fix remote code execution in seamless_process_line - CVE-2018-20182
cssp_gss_get_service_name(char *server, gss_name_t * name) { gss_buffer_desc output; OM_uint32 major_status, minor_status; const char service_name[] = "TERMSRV"; gss_OID type = (gss_OID) GSS_C_NT_HOSTBASED_SERVICE; int size = (strlen(service_name) + 1 + strlen(server) + 1); output.value = malloc(size); snprintf(output.value, size, "%s@%s", service_name, server); output.length = strlen(output.value) + 1; major_status = gss_import_name(&minor_status, &output, type, name); if (GSS_ERROR(major_status)) { cssp_gss_report_error(GSS_C_GSS_CODE, "Failed to create service principal name", major_status, minor_status); return False; } gss_release_buffer(&minor_status, &output); return True; }
cssp_gss_get_service_name(char *server, gss_name_t * name) { gss_buffer_desc output; OM_uint32 major_status, minor_status; const char service_name[] = "TERMSRV"; gss_OID type = (gss_OID) GSS_C_NT_HOSTBASED_SERVICE; int size = (strlen(service_name) + 1 + strlen(server) + 1); output.value = malloc(size); snprintf(output.value, size, "%s@%s", service_name, server); output.length = strlen(output.value) + 1; major_status = gss_import_name(&minor_status, &output, type, name); if (GSS_ERROR(major_status)) { cssp_gss_report_error(GSS_C_GSS_CODE, "Failed to create service principal name", major_status, minor_status); return False; } gss_release_buffer(&minor_status, &output); return True; }
C
rdesktop
0
null
null
null
https://github.com/chromium/chromium/commit/a0fe4d88137213aa24fbb16fd7eec34533345c9b
a0fe4d88137213aa24fbb16fd7eec34533345c9b
Move supports-high-dpi flag into registry. Calls to SetProcessDpiAwareness need to happen immediately when the app starts. Specifically, before user profile settings have been initialized. This patch moves the --supports-high-dpi into the registry. BUG=339152, 149881, 160457 Review URL: https://codereview.chromium.org/153403003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256811 0039d316-1c4b-4281-b951-d872f2087c98
void FinishCopyFromCompositingSurface(const base::Closure& quit_closure, bool frame_captured) { ++callback_invoke_count_; if (frame_captured) ++frames_captured_; if (!quit_closure.is_null()) quit_closure.Run(); }
void FinishCopyFromCompositingSurface(const base::Closure& quit_closure, bool frame_captured) { ++callback_invoke_count_; if (frame_captured) ++frames_captured_; if (!quit_closure.is_null()) quit_closure.Run(); }
C
Chrome
0
CVE-2016-2496
https://www.cvedetails.com/cve/CVE-2016-2496/
CWE-264
https://android.googlesource.com/platform/frameworks/native/+/03a53d1c7765eeb3af0bc34c3dff02ada1953fbf
03a53d1c7765eeb3af0bc34c3dff02ada1953fbf
Add new MotionEvent flag for partially obscured windows. Due to more complex window layouts resulting in lots of overlapping windows, the policy around FLAG_WINDOW_IS_OBSCURED has changed to only be set when the point at which the window was touched is obscured. Unfortunately, this doesn't prevent tapjacking attacks that overlay the dialog's text, making a potentially dangerous operation seem innocuous. To avoid this on particularly sensitive dialogs, introduce a new flag that really does tell you when your window is being even partially overlapped. We aren't exposing this as API since we plan on making the original flag more robust. This is really a workaround for system dialogs since we generally know their layout and screen position, and that they're unlikely to be overlapped by other applications. Bug: 26677796 Change-Id: I9e336afe90f262ba22015876769a9c510048fd47
void InputDispatcher::InputState::MotionMemento::setPointers(const MotionEntry* entry) { pointerCount = entry->pointerCount; for (uint32_t i = 0; i < entry->pointerCount; i++) { pointerProperties[i].copyFrom(entry->pointerProperties[i]); pointerCoords[i].copyFrom(entry->pointerCoords[i]); } }
void InputDispatcher::InputState::MotionMemento::setPointers(const MotionEntry* entry) { pointerCount = entry->pointerCount; for (uint32_t i = 0; i < entry->pointerCount; i++) { pointerProperties[i].copyFrom(entry->pointerProperties[i]); pointerCoords[i].copyFrom(entry->pointerCoords[i]); } }
C
Android
0
CVE-2016-2451
https://www.cvedetails.com/cve/CVE-2016-2451/
CWE-264
https://android.googlesource.com/platform/frameworks/av/+/f9ed2fe6d61259e779a37d4c2d7edb33a1c1f8ba
f9ed2fe6d61259e779a37d4c2d7edb33a1c1f8ba
Add VPX output buffer size check and handle dead observers more gracefully Bug: 27597103 Change-Id: Id7acb25d5ef69b197da15ec200a9e4f9e7b03518
OMX::OMX() : mMaster(new OMXMaster), mNodeCounter(0) { }
OMX::OMX() : mMaster(new OMXMaster), mNodeCounter(0) { }
C
Android
0
CVE-2018-15910
https://www.cvedetails.com/cve/CVE-2018-15910/
CWE-704
http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=c3476dde7743761a4e1d39a631716199b696b880
c3476dde7743761a4e1d39a631716199b696b880
null
gdev_pdf_put_params(gx_device * dev, gs_param_list * plist) { int code; gx_device_pdf *pdev = (gx_device_pdf *) dev; gs_memory_t *mem = gs_memory_stable(pdev->memory); gx_device_pdf *save_dev = gs_malloc(mem, sizeof(gx_device_pdf), 1, "saved gx_device_pdf"); if (!save_dev) return_error(gs_error_VMerror); memcpy(save_dev, pdev, sizeof(gx_device_pdf)); code = gdev_pdf_put_params_impl(dev, save_dev, plist); gs_free(mem, save_dev, sizeof(gx_device_pdf), 1, "saved gx_device_pdf"); return code; }
gdev_pdf_put_params(gx_device * dev, gs_param_list * plist) { int code; gx_device_pdf *pdev = (gx_device_pdf *) dev; gs_memory_t *mem = gs_memory_stable(pdev->memory); gx_device_pdf *save_dev = gs_malloc(mem, sizeof(gx_device_pdf), 1, "saved gx_device_pdf"); if (!save_dev) return_error(gs_error_VMerror); memcpy(save_dev, pdev, sizeof(gx_device_pdf)); code = gdev_pdf_put_params_impl(dev, save_dev, plist); gs_free(mem, save_dev, sizeof(gx_device_pdf), 1, "saved gx_device_pdf"); return code; }
C
ghostscript
0