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-2018-14600
https://www.cvedetails.com/cve/CVE-2018-14600/
CWE-787
https://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=dbf72805fd9d7b1846fe9a11b46f3994bfc27fea
dbf72805fd9d7b1846fe9a11b46f3994bfc27fea
null
char **XGetFontPath( register Display *dpy, int *npaths) /* RETURN */ { xGetFontPathReply rep; unsigned long nbytes = 0; char **flist = NULL; char *ch = NULL; char *chend; int count = 0; register unsigned i; register int length; _X_UNUSED register xReq *req; LockDisplay(dpy); GetEmptyReq (GetFontPath, req); (void) _XReply (dpy, (xReply *) &rep, 0, xFalse); if (rep.nPaths) { flist = Xmalloc(rep.nPaths * sizeof (char *)); if (rep.length < (INT_MAX >> 2)) { nbytes = (unsigned long) rep.length << 2; ch = Xmalloc (nbytes + 1); /* +1 to leave room for last null-terminator */ } if ((! flist) || (! ch)) { Xfree(flist); Xfree(ch); _XEatDataWords(dpy, rep.length); UnlockDisplay(dpy); SyncHandle(); return (char **) NULL; } _XReadPad (dpy, ch, nbytes); /* * unpack into null terminated strings. */ chend = ch + nbytes; length = *(unsigned char *)ch; for (i = 0; i < rep.nPaths; i++) { if (ch + length < chend) { flist[i] = ch+1; /* skip over length */ ch += length + 1; /* find next length ... */ length = *(unsigned char *)ch; *ch = '\0'; /* and replace with null-termination */ count++; } else flist[i] = NULL; } } *npaths = count; UnlockDisplay(dpy); SyncHandle(); return (flist); }
char **XGetFontPath( register Display *dpy, int *npaths) /* RETURN */ { xGetFontPathReply rep; unsigned long nbytes = 0; char **flist = NULL; char *ch = NULL; char *chend; int count = 0; register unsigned i; register int length; _X_UNUSED register xReq *req; LockDisplay(dpy); GetEmptyReq (GetFontPath, req); (void) _XReply (dpy, (xReply *) &rep, 0, xFalse); if (rep.nPaths) { flist = Xmalloc(rep.nPaths * sizeof (char *)); if (rep.length < (INT_MAX >> 2)) { nbytes = (unsigned long) rep.length << 2; ch = Xmalloc (nbytes + 1); /* +1 to leave room for last null-terminator */ } if ((! flist) || (! ch)) { Xfree(flist); Xfree(ch); _XEatDataWords(dpy, rep.length); UnlockDisplay(dpy); SyncHandle(); return (char **) NULL; } _XReadPad (dpy, ch, nbytes); /* * unpack into null terminated strings. */ chend = ch + nbytes; length = *ch; for (i = 0; i < rep.nPaths; i++) { if (ch + length < chend) { flist[i] = ch+1; /* skip over length */ ch += length + 1; /* find next length ... */ length = *ch; *ch = '\0'; /* and replace with null-termination */ count++; } else flist[i] = NULL; } } *npaths = count; UnlockDisplay(dpy); SyncHandle(); return (flist); }
C
libx11
1
CVE-2015-5232
https://www.cvedetails.com/cve/CVE-2015-5232/
CWE-362
https://github.com/01org/opa-fm/commit/c5759e7b76f5bf844be6c6641cc1b356bbc83869
c5759e7b76f5bf844be6c6641cc1b356bbc83869
Fix scripts and code that use well-known tmp files.
int sm_looptest_inject_at_node(p_fm_config_conx_hdlt hdl, fm_mgr_type_t mgr, int argc, char *argv[]) { fm_mgr_config_errno_t res; fm_msg_ret_code_t ret_code; int nodeidx=0; uint8_t data[BUF_SZ]; if (argc > 1) { printf("Error: only 1 argument expected\n"); return 0; } if (argc == 1) { nodeidx = atol(argv[0]); } *(int*)data = nodeidx; if((res = fm_mgr_simple_query(hdl, FM_ACT_GET, FM_DT_SM_LOOP_TEST_INJECT_ATNODE, mgr, BUF_SZ, data, &ret_code)) != FM_CONF_OK) { fprintf(stderr, "sm_looptest_inject_at_node: Failed to retrieve data: \n" "\tError:(%d) %s \n\tRet code:(%d) %s\n", res, fm_mgr_get_error_str(res),ret_code, fm_mgr_get_resp_error_str(ret_code)); } else { printf("Successfully sent Loop Test Inject Packets at Node index %d control to local SM instance\n", nodeidx); data[BUF_SZ-1]=0; printf("%s", (char*) data); } return 0; }
int sm_looptest_inject_at_node(p_fm_config_conx_hdlt hdl, fm_mgr_type_t mgr, int argc, char *argv[]) { fm_mgr_config_errno_t res; fm_msg_ret_code_t ret_code; int nodeidx=0; uint8_t data[BUF_SZ]; if (argc > 1) { printf("Error: only 1 argument expected\n"); return 0; } if (argc == 1) { nodeidx = atol(argv[0]); } *(int*)data = nodeidx; if((res = fm_mgr_simple_query(hdl, FM_ACT_GET, FM_DT_SM_LOOP_TEST_INJECT_ATNODE, mgr, BUF_SZ, data, &ret_code)) != FM_CONF_OK) { fprintf(stderr, "sm_looptest_inject_at_node: Failed to retrieve data: \n" "\tError:(%d) %s \n\tRet code:(%d) %s\n", res, fm_mgr_get_error_str(res),ret_code, fm_mgr_get_resp_error_str(ret_code)); } else { printf("Successfully sent Loop Test Inject Packets at Node index %d control to local SM instance\n", nodeidx); data[BUF_SZ-1]=0; printf("%s", (char*) data); } return 0; }
C
opa-ff
0
CVE-2018-11383
https://www.cvedetails.com/cve/CVE-2018-11383/
CWE-416
https://github.com/radare/radare2/commit/9d348bcc2c4bbd3805e7eec97b594be9febbdf9a
9d348bcc2c4bbd3805e7eec97b594be9febbdf9a
Fix #9943 - Invalid free on RAnal.avr
INST_HANDLER (las) { // LAS Z, Rd int d = ((buf[0] >> 4) & 0xf) | ((buf[1] & 0x1) << 4); __generic_ld_st (op, "ram", 'z', 1, 0, 0, 0); // 0: Read (RAMPZ:Z) ESIL_A ("r%d,|,", d); // 0: (Z) | Rd ESIL_A ("DUP,r%d,=,", d); // Rd = [0] __generic_ld_st (op, "ram", 'z', 1, 0, 0, 1); // Store in RAM }
INST_HANDLER (las) { // LAS Z, Rd int d = ((buf[0] >> 4) & 0xf) | ((buf[1] & 0x1) << 4); __generic_ld_st (op, "ram", 'z', 1, 0, 0, 0); // 0: Read (RAMPZ:Z) ESIL_A ("r%d,|,", d); // 0: (Z) | Rd ESIL_A ("DUP,r%d,=,", d); // Rd = [0] __generic_ld_st (op, "ram", 'z', 1, 0, 0, 1); // Store in RAM }
C
radare2
0
CVE-2017-17862
https://www.cvedetails.com/cve/CVE-2017-17862/
CWE-20
https://github.com/torvalds/linux/commit/c131187db2d3fa2f8bf32fdf4e9a4ef805168467
c131187db2d3fa2f8bf32fdf4e9a4ef805168467
bpf: fix branch pruning logic when the verifier detects that register contains a runtime constant and it's compared with another constant it will prune exploration of the branch that is guaranteed not to be taken at runtime. This is all correct, but malicious program may be constructed in such a way that it always has a constant comparison and the other branch is never taken under any conditions. In this case such path through the program will not be explored by the verifier. It won't be taken at run-time either, but since all instructions are JITed the malicious program may cause JITs to complain about using reserved fields, etc. To fix the issue we have to track the instructions explored by the verifier and sanitize instructions that are dead at run time with NOPs. We cannot reject such dead code, since llvm generates it for valid C code, since it doesn't do as much data flow analysis as the verifier does. Fixes: 17a5267067f3 ("bpf: verifier (add verifier core)") Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
static void mark_reg_read(const struct bpf_verifier_state *state, u32 regno) { struct bpf_verifier_state *parent = state->parent; if (regno == BPF_REG_FP) /* We don't need to worry about FP liveness because it's read-only */ return; while (parent) { /* if read wasn't screened by an earlier write ... */ if (state->regs[regno].live & REG_LIVE_WRITTEN) break; /* ... then we depend on parent's value */ parent->regs[regno].live |= REG_LIVE_READ; state = parent; parent = state->parent; } }
static void mark_reg_read(const struct bpf_verifier_state *state, u32 regno) { struct bpf_verifier_state *parent = state->parent; if (regno == BPF_REG_FP) /* We don't need to worry about FP liveness because it's read-only */ return; while (parent) { /* if read wasn't screened by an earlier write ... */ if (state->regs[regno].live & REG_LIVE_WRITTEN) break; /* ... then we depend on parent's value */ parent->regs[regno].live |= REG_LIVE_READ; state = parent; parent = state->parent; } }
C
linux
0
CVE-2017-5112
https://www.cvedetails.com/cve/CVE-2017-5112/
CWE-119
https://github.com/chromium/chromium/commit/f6ac1dba5e36f338a490752a2cbef3339096d9fe
f6ac1dba5e36f338a490752a2cbef3339096d9fe
Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later. BUG=740603 TEST=new conformance test [email protected],[email protected] Change-Id: I3ea54c6cc34f34e249f7c8b9f792d93c5e1958f4 Reviewed-on: https://chromium-review.googlesource.com/570840 Reviewed-by: Antoine Labour <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Commit-Queue: Zhenyao Mo <[email protected]> Cr-Commit-Position: refs/heads/master@{#486518}
void WebGL2RenderingContextBase::bufferSubData( GLenum target, long long offset, const FlexibleArrayBufferView& data) { WebGLRenderingContextBase::bufferSubData(target, offset, data); }
void WebGL2RenderingContextBase::bufferSubData( GLenum target, long long offset, const FlexibleArrayBufferView& data) { WebGLRenderingContextBase::bufferSubData(target, offset, data); }
C
Chrome
0
CVE-2011-2881
https://www.cvedetails.com/cve/CVE-2011-2881/
CWE-119
https://github.com/chromium/chromium/commit/88c4913f11967abfd08a8b22b4423710322ac49b
88c4913f11967abfd08a8b22b4423710322ac49b
[chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests https://bugs.webkit.org/show_bug.cgi?id=70161 Reviewed by David Levin. Source/WebCore: Adds a weak pointer mechanism to cancel main thread tasks posted to CCThreadProxy instances from the compositor thread. Previously there was a race condition where main thread tasks could run even after the CCThreadProxy was destroyed. This race does not exist in the other direction because when tearing down a CCThreadProxy we first post a quit task to the compositor thread and then suspend execution of the main thread until all compositor tasks for the CCThreadProxy have been drained. Covered by the now-enabled CCLayerTreeHostTest* unit tests. * WebCore.gypi: * platform/graphics/chromium/cc/CCScopedMainThreadProxy.h: Added. (WebCore::CCScopedMainThreadProxy::create): (WebCore::CCScopedMainThreadProxy::postTask): (WebCore::CCScopedMainThreadProxy::shutdown): (WebCore::CCScopedMainThreadProxy::CCScopedMainThreadProxy): (WebCore::CCScopedMainThreadProxy::runTaskIfNotShutdown): * platform/graphics/chromium/cc/CCThreadProxy.cpp: (WebCore::CCThreadProxy::CCThreadProxy): (WebCore::CCThreadProxy::~CCThreadProxy): (WebCore::CCThreadProxy::createBeginFrameAndCommitTaskOnCCThread): * platform/graphics/chromium/cc/CCThreadProxy.h: Source/WebKit/chromium: Enables the CCLayerTreeHostTest* tests by default. Most tests are run twice in a single thread and multiple thread configuration. Some tests run only in the multiple thread configuration if they depend on the compositor thread scheduling draws by itself. * tests/CCLayerTreeHostTest.cpp: (::CCLayerTreeHostTest::timeout): (::CCLayerTreeHostTest::clearTimeout): (::CCLayerTreeHostTest::CCLayerTreeHostTest): (::CCLayerTreeHostTest::onEndTest): (::CCLayerTreeHostTest::TimeoutTask::TimeoutTask): (::CCLayerTreeHostTest::TimeoutTask::clearTest): (::CCLayerTreeHostTest::TimeoutTask::~TimeoutTask): (::CCLayerTreeHostTest::TimeoutTask::Run): (::CCLayerTreeHostTest::runTest): (::CCLayerTreeHostTest::doBeginTest): (::CCLayerTreeHostTestThreadOnly::runTest): (::CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread): git-svn-id: svn://svn.chromium.org/blink/trunk@97784 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static PassRefPtr<MockLayerTreeHost> create(TestHooks* testHooks, CCLayerTreeHostClient* client, PassRefPtr<LayerChromium> rootLayer, const CCSettings& settings) { return adoptRef(new MockLayerTreeHost(testHooks, client, rootLayer, settings)); }
static PassRefPtr<MockLayerTreeHost> create(TestHooks* testHooks, CCLayerTreeHostClient* client, PassRefPtr<LayerChromium> rootLayer, const CCSettings& settings) { return adoptRef(new MockLayerTreeHost(testHooks, client, rootLayer, settings)); }
C
Chrome
0
CVE-2011-3359
https://www.cvedetails.com/cve/CVE-2011-3359/
CWE-119
https://github.com/torvalds/linux/commit/c85ce65ecac078ab1a1835c87c4a6319cf74660a
c85ce65ecac078ab1a1835c87c4a6319cf74660a
b43: allocate receive buffers big enough for max frame len + offset Otherwise, skb_put inside of dma_rx can fail... https://bugzilla.kernel.org/show_bug.cgi?id=32042 Signed-off-by: John W. Linville <[email protected]> Acked-by: Larry Finger <[email protected]> Cc: [email protected]
void b43_dma_direct_fifo_rx(struct b43_wldev *dev, unsigned int engine_index, bool enable) { enum b43_dmatype type; u16 mmio_base; type = dma_mask_to_engine_type(supported_dma_mask(dev)); mmio_base = b43_dmacontroller_base(type, engine_index); direct_fifo_rx(dev, type, mmio_base, enable); }
void b43_dma_direct_fifo_rx(struct b43_wldev *dev, unsigned int engine_index, bool enable) { enum b43_dmatype type; u16 mmio_base; type = dma_mask_to_engine_type(supported_dma_mask(dev)); mmio_base = b43_dmacontroller_base(type, engine_index); direct_fifo_rx(dev, type, mmio_base, enable); }
C
linux
0
CVE-2013-2903
https://www.cvedetails.com/cve/CVE-2013-2903/
CWE-399
https://github.com/chromium/chromium/commit/92029a982fac85a4ebb614a825012a2e9ee84ef3
92029a982fac85a4ebb614a825012a2e9ee84ef3
Enforce the maximum length of the folder name in UI. BUG=355797 [email protected] Review URL: https://codereview.chromium.org/203863005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260156 0039d316-1c4b-4281-b951-d872f2087c98
void FolderHeaderView::ButtonPressed(views::Button* sender, const ui::Event& event) { delegate_->GiveBackFocusToSearchBox(); delegate_->NavigateBack(folder_item_, event); }
void FolderHeaderView::ButtonPressed(views::Button* sender, const ui::Event& event) { delegate_->GiveBackFocusToSearchBox(); delegate_->NavigateBack(folder_item_, event); }
C
Chrome
0
CVE-2014-3122
https://www.cvedetails.com/cve/CVE-2014-3122/
CWE-264
https://github.com/torvalds/linux/commit/57e68e9cd65b4b8eb4045a1e0d0746458502554c
57e68e9cd65b4b8eb4045a1e0d0746458502554c
mm: try_to_unmap_cluster() should lock_page() before mlocking A BUG_ON(!PageLocked) was triggered in mlock_vma_page() by Sasha Levin fuzzing with trinity. The call site try_to_unmap_cluster() does not lock the pages other than its check_page parameter (which is already locked). The BUG_ON in mlock_vma_page() is not documented and its purpose is somewhat unclear, but apparently it serializes against page migration, which could otherwise fail to transfer the PG_mlocked flag. This would not be fatal, as the page would be eventually encountered again, but NR_MLOCK accounting would become distorted nevertheless. This patch adds a comment to the BUG_ON in mlock_vma_page() and munlock_vma_page() to that effect. The call site try_to_unmap_cluster() is fixed so that for page != check_page, trylock_page() is attempted (to avoid possible deadlocks as we already have check_page locked) and mlock_vma_page() is performed only upon success. If the page lock cannot be obtained, the page is left without PG_mlocked, which is again not a problem in the whole unevictable memory design. Signed-off-by: Vlastimil Babka <[email protected]> Signed-off-by: Bob Liu <[email protected]> Reported-by: Sasha Levin <[email protected]> Cc: Wanpeng Li <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: David Rientjes <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void anon_vma_chain_link(struct vm_area_struct *vma, struct anon_vma_chain *avc, struct anon_vma *anon_vma) { avc->vma = vma; avc->anon_vma = anon_vma; list_add(&avc->same_vma, &vma->anon_vma_chain); anon_vma_interval_tree_insert(avc, &anon_vma->rb_root); }
static void anon_vma_chain_link(struct vm_area_struct *vma, struct anon_vma_chain *avc, struct anon_vma *anon_vma) { avc->vma = vma; avc->anon_vma = anon_vma; list_add(&avc->same_vma, &vma->anon_vma_chain); anon_vma_interval_tree_insert(avc, &anon_vma->rb_root); }
C
linux
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 gboolean highligh_words_in_tabs(GList *forbidden_words, GList *allowed_words, bool case_insensitive) { gboolean found = false; gint n_pages = gtk_notebook_get_n_pages(g_notebook); int page = 0; for (page = 0; page < n_pages; page++) { GtkWidget *notebook_child = gtk_notebook_get_nth_page(g_notebook, page); GtkWidget *tab_lbl = gtk_notebook_get_tab_label(g_notebook, notebook_child); const char *const lbl_txt = gtk_label_get_text(GTK_LABEL(tab_lbl)); if (strncmp(lbl_txt, "page 1", 5) == 0 || strcmp(FILENAME_COMMENT, lbl_txt) == 0) continue; GtkTextView *tev = GTK_TEXT_VIEW(gtk_bin_get_child(GTK_BIN(notebook_child))); found |= highligh_words_in_textview(page, tev, forbidden_words, allowed_words, case_insensitive); } GtkTreeIter iter; if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_sensitive_list), &iter)) gtk_tree_selection_select_iter(g_tv_sensitive_sel, &iter); return found; }
static gboolean highligh_words_in_tabs(GList *forbidden_words, GList *allowed_words, bool case_insensitive) { gboolean found = false; gint n_pages = gtk_notebook_get_n_pages(g_notebook); int page = 0; for (page = 0; page < n_pages; page++) { GtkWidget *notebook_child = gtk_notebook_get_nth_page(g_notebook, page); GtkWidget *tab_lbl = gtk_notebook_get_tab_label(g_notebook, notebook_child); const char *const lbl_txt = gtk_label_get_text(GTK_LABEL(tab_lbl)); if (strncmp(lbl_txt, "page 1", 5) == 0 || strcmp(FILENAME_COMMENT, lbl_txt) == 0) continue; GtkTextView *tev = GTK_TEXT_VIEW(gtk_bin_get_child(GTK_BIN(notebook_child))); found |= highligh_words_in_textview(page, tev, forbidden_words, allowed_words, case_insensitive); } GtkTreeIter iter; if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_sensitive_list), &iter)) gtk_tree_selection_select_iter(g_tv_sensitive_sel, &iter); return found; }
C
libreport
0
CVE-2017-9994
https://www.cvedetails.com/cve/CVE-2017-9994/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
6b5d3fb26fb4be48e4966e4b1d97c2165538d4ef
avcodec/webp: Always set pix_fmt Fixes: out of array access Fixes: 1434/clusterfuzz-testcase-minimized-6314998085189632 Fixes: 1435/clusterfuzz-testcase-minimized-6483783723253760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: "Ronald S. Bultje" <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
static int vp8_decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], int i, uint8_t *token_prob, int16_t qmul[2]) { return decode_block_coeffs_internal(r, block, probs, i, token_prob, qmul, ff_zigzag_scan, IS_VP8); }
static int vp8_decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], int i, uint8_t *token_prob, int16_t qmul[2]) { return decode_block_coeffs_internal(r, block, probs, i, token_prob, qmul, ff_zigzag_scan, IS_VP8); }
C
FFmpeg
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_read_rows(png_structp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows) { png_uint_32 i; png_bytepp rp; png_bytepp dp; png_debug(1, "in png_read_rows"); if (png_ptr == NULL) return; rp = row; dp = display_row; if (rp != NULL && dp != NULL) for (i = 0; i < num_rows; i++) { png_bytep rptr = *rp++; png_bytep dptr = *dp++; png_read_row(png_ptr, rptr, dptr); } else if (rp != NULL) for (i = 0; i < num_rows; i++) { png_bytep rptr = *rp; png_read_row(png_ptr, rptr, png_bytep_NULL); rp++; } else if (dp != NULL) for (i = 0; i < num_rows; i++) { png_bytep dptr = *dp; png_read_row(png_ptr, png_bytep_NULL, dptr); dp++; } }
png_read_rows(png_structp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows) { png_uint_32 i; png_bytepp rp; png_bytepp dp; png_debug(1, "in png_read_rows"); if (png_ptr == NULL) return; rp = row; dp = display_row; if (rp != NULL && dp != NULL) for (i = 0; i < num_rows; i++) { png_bytep rptr = *rp++; png_bytep dptr = *dp++; png_read_row(png_ptr, rptr, dptr); } else if (rp != NULL) for (i = 0; i < num_rows; i++) { png_bytep rptr = *rp; png_read_row(png_ptr, rptr, png_bytep_NULL); rp++; } else if (dp != NULL) for (i = 0; i < num_rows; i++) { png_bytep dptr = *dp; png_read_row(png_ptr, png_bytep_NULL, dptr); dp++; } }
C
Chrome
0
CVE-2016-4300
https://www.cvedetails.com/cve/CVE-2016-4300/
CWE-190
https://github.com/libarchive/libarchive/commit/e79ef306afe332faf22e9b442a2c6b59cb175573
e79ef306afe332faf22e9b442a2c6b59cb175573
Issue #718: Fix TALOS-CAN-152 If a 7-Zip archive declares a rediculously large number of substreams, it can overflow an internal counter, leading a subsequent memory allocation to be too small for the substream data. Thanks to the Open Source and Threat Intelligence project at Cisco for reporting this issue.
free_Header(struct _7z_header_info *h) { free(h->emptyStreamBools); free(h->emptyFileBools); free(h->antiBools); free(h->attrBools); }
free_Header(struct _7z_header_info *h) { free(h->emptyStreamBools); free(h->emptyFileBools); free(h->antiBools); free(h->attrBools); }
C
libarchive
0
CVE-2018-6046
https://www.cvedetails.com/cve/CVE-2018-6046/
CWE-20
https://github.com/chromium/chromium/commit/24bbdc5f95f80a7700e232a272a6ea1811c0dcaf
24bbdc5f95f80a7700e232a272a6ea1811c0dcaf
Improve sanitization of remoteFrontendUrl in DevTools This change ensures that the decoded remoteFrontendUrl parameter cannot contain any single quote in its value. As of this commit, none of the permitted query params in SanitizeFrontendQueryParam can contain single quotes. Note that the existing SanitizeEndpoint function does not explicitly check for single quotes. This is fine since single quotes in the query string are already URL-encoded and the values validated by SanitizeEndpoint are not url-decoded elsewhere. BUG=798163 TEST=Manually, see https://crbug.com/798163#c1 TEST=./unit_tests --gtest_filter=DevToolsUIBindingsTest.SanitizeFrontendURL Change-Id: I5a08e8ce6f1abc2c8d2a0983fef63e1e194cd242 Reviewed-on: https://chromium-review.googlesource.com/846979 Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Rob Wu <[email protected]> Cr-Commit-Position: refs/heads/master@{#527250}
void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback, const std::string& url, const std::string& headers, int stream_id) { GURL gurl(url); if (!gurl.is_valid()) { base::DictionaryValue response; response.SetInteger("statusCode", 404); callback.Run(&response); return; } net::NetworkTrafficAnnotationTag traffic_annotation = net::DefineNetworkTrafficAnnotation("devtools_network_resource", R"( semantics { sender: "Developer Tools" description: "When user opens Developer Tools, the browser may fetch additional " "resources from the network to enrich the debugging experience " "(e.g. source map resources)." trigger: "User opens Developer Tools to debug a web page." data: "Any resources requested by Developer Tools." destination: WEBSITE } policy { cookies_allowed: YES cookies_store: "user" setting: "It's not possible to disable this feature from settings." chrome_policy { DeveloperToolsDisabled { policy_options {mode: MANDATORY} DeveloperToolsDisabled: true } } })"); net::URLFetcher* fetcher = net::URLFetcher::Create(gurl, net::URLFetcher::GET, this, traffic_annotation) .release(); pending_requests_[fetcher] = callback; fetcher->SetRequestContext(profile_->GetRequestContext()); fetcher->SetExtraRequestHeaders(headers); fetcher->SaveResponseWithWriter( std::unique_ptr<net::URLFetcherResponseWriter>( new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); fetcher->Start(); }
void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback, const std::string& url, const std::string& headers, int stream_id) { GURL gurl(url); if (!gurl.is_valid()) { base::DictionaryValue response; response.SetInteger("statusCode", 404); callback.Run(&response); return; } net::NetworkTrafficAnnotationTag traffic_annotation = net::DefineNetworkTrafficAnnotation("devtools_network_resource", R"( semantics { sender: "Developer Tools" description: "When user opens Developer Tools, the browser may fetch additional " "resources from the network to enrich the debugging experience " "(e.g. source map resources)." trigger: "User opens Developer Tools to debug a web page." data: "Any resources requested by Developer Tools." destination: WEBSITE } policy { cookies_allowed: YES cookies_store: "user" setting: "It's not possible to disable this feature from settings." chrome_policy { DeveloperToolsDisabled { policy_options {mode: MANDATORY} DeveloperToolsDisabled: true } } })"); net::URLFetcher* fetcher = net::URLFetcher::Create(gurl, net::URLFetcher::GET, this, traffic_annotation) .release(); pending_requests_[fetcher] = callback; fetcher->SetRequestContext(profile_->GetRequestContext()); fetcher->SetExtraRequestHeaders(headers); fetcher->SaveResponseWithWriter( std::unique_ptr<net::URLFetcherResponseWriter>( new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); fetcher->Start(); }
C
Chrome
0
CVE-2017-14225
https://www.cvedetails.com/cve/CVE-2017-14225/
CWE-476
https://github.com/FFmpeg/FFmpeg/commit/837cb4325b712ff1aab531bf41668933f61d75d2
837cb4325b712ff1aab531bf41668933f61d75d2
ffprobe: Fix null pointer dereference with color primaries Found-by: AD-lab of venustech Signed-off-by: Michael Niedermayer <[email protected]>
static inline void json_print_item_str(WriterContext *wctx, const char *key, const char *value) { AVBPrint buf; av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); printf("\"%s\":", json_escape_str(&buf, key, wctx)); av_bprint_clear(&buf); printf(" \"%s\"", json_escape_str(&buf, value, wctx)); av_bprint_finalize(&buf, NULL); }
static inline void json_print_item_str(WriterContext *wctx, const char *key, const char *value) { AVBPrint buf; av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); printf("\"%s\":", json_escape_str(&buf, key, wctx)); av_bprint_clear(&buf); printf(" \"%s\"", json_escape_str(&buf, value, wctx)); av_bprint_finalize(&buf, NULL); }
C
FFmpeg
0
CVE-2019-3817
https://www.cvedetails.com/cve/CVE-2019-3817/
CWE-416
https://github.com/rpm-software-management/libcomps/commit/e3a5d056633677959ad924a51758876d415e7046
e3a5d056633677959ad924a51758876d415e7046
Fix UAF in comps_objmrtree_unite function The added field is not used at all in many places and it is probably the left-over of some copy-paste.
void __comps_mrtree_set(COMPS_MRTree * rt, char * key, size_t len, void * data) { static COMPS_HSListItem *it; COMPS_HSList *subnodes; COMPS_MRTreeData *rtd; static COMPS_MRTreeData *rtdata; size_t _len, offset=0; unsigned x, found = 0; void *ndata; char ended;//, tmpch; if (rt->subnodes == NULL) return; if (rt->data_constructor) ndata = rt->data_constructor(data); else ndata = data; subnodes = rt->subnodes; while (offset != len) { found = 0; for (it = subnodes->first; it != NULL; it=it->next) { if (((COMPS_MRTreeData*)it->data)->key[0] == key[offset]) { found = 1; break; } } if (!found) { // not found in subnodes; create new subnode rtd = comps_mrtree_data_create(rt, key+offset, ndata); comps_hslist_append(subnodes, rtd, 0); return; } else { rtdata = (COMPS_MRTreeData*)it->data; ended = 0; for (x=1; ;x++) { if (rtdata->key[x] == 0) ended += 1; if (x == len - offset) ended += 2; if (ended != 0) break; if (key[offset+x] != rtdata->key[x]) break; } if (ended == 3) { //keys equals; append new data comps_hslist_append(rtdata->data, ndata, 0); return; } else if (ended == 2) { //global key ends first; make global leaf comps_hslist_remove(subnodes, it); it->next = NULL; rtd = comps_mrtree_data_create(rt, key+offset, ndata); comps_hslist_append(subnodes, rtd, 0); ((COMPS_MRTreeData*)subnodes->last->data)->subnodes->last = it; ((COMPS_MRTreeData*)subnodes->last->data)->subnodes->first = it; _len = strlen(key + offset); memmove(rtdata->key,rtdata->key+_len, strlen(rtdata->key) - _len); rtdata->key[strlen(rtdata->key) - _len] = 0; rtdata->key = realloc(rtdata->key, sizeof(char)* (strlen(rtdata->key)+1)); return; } else if (ended == 1) { //local key ends first; go deeper subnodes = rtdata->subnodes; offset += x; } else { /* keys differ */ void *tmpdata = rtdata->data; COMPS_HSList *tmpnodes = rtdata->subnodes; int cmpret = strcmp(key+offset+x, rtdata->key+x); rtdata->subnodes = comps_hslist_create(); comps_hslist_init(rtdata->subnodes, NULL, NULL, &comps_mrtree_data_destroy_v); rtdata->data = NULL; if (cmpret > 0) { rtd = comps_mrtree_data_create(rt, rtdata->key+x, tmpdata); comps_hslist_destroy(&rtd->subnodes); rtd->subnodes = tmpnodes; comps_hslist_append(rtdata->subnodes, rtd, 0); rtd = comps_mrtree_data_create(rt, key+offset+x, ndata); comps_hslist_append(rtdata->subnodes, rtd, 0); } else { rtd = comps_mrtree_data_create(rt, key+offset+x, ndata); comps_hslist_append(rtdata->subnodes, rtd, 0); rtd = comps_mrtree_data_create(rt, rtdata->key+x, tmpdata); comps_hslist_destroy(&rtd->subnodes); rtd->subnodes = tmpnodes; comps_hslist_append(rtdata->subnodes, rtd, 0); } rtdata->key = realloc(rtdata->key, sizeof(char)*(x+1)); rtdata->key[x] = 0; return; } } } }
void __comps_mrtree_set(COMPS_MRTree * rt, char * key, size_t len, void * data) { static COMPS_HSListItem *it; COMPS_HSList *subnodes; COMPS_MRTreeData *rtd; static COMPS_MRTreeData *rtdata; size_t _len, offset=0; unsigned x, found = 0; void *ndata; char ended;//, tmpch; if (rt->subnodes == NULL) return; if (rt->data_constructor) ndata = rt->data_constructor(data); else ndata = data; subnodes = rt->subnodes; while (offset != len) { found = 0; for (it = subnodes->first; it != NULL; it=it->next) { if (((COMPS_MRTreeData*)it->data)->key[0] == key[offset]) { found = 1; break; } } if (!found) { // not found in subnodes; create new subnode rtd = comps_mrtree_data_create(rt, key+offset, ndata); comps_hslist_append(subnodes, rtd, 0); return; } else { rtdata = (COMPS_MRTreeData*)it->data; ended = 0; for (x=1; ;x++) { if (rtdata->key[x] == 0) ended += 1; if (x == len - offset) ended += 2; if (ended != 0) break; if (key[offset+x] != rtdata->key[x]) break; } if (ended == 3) { //keys equals; append new data comps_hslist_append(rtdata->data, ndata, 0); return; } else if (ended == 2) { //global key ends first; make global leaf comps_hslist_remove(subnodes, it); it->next = NULL; rtd = comps_mrtree_data_create(rt, key+offset, ndata); comps_hslist_append(subnodes, rtd, 0); ((COMPS_MRTreeData*)subnodes->last->data)->subnodes->last = it; ((COMPS_MRTreeData*)subnodes->last->data)->subnodes->first = it; _len = strlen(key + offset); memmove(rtdata->key,rtdata->key+_len, strlen(rtdata->key) - _len); rtdata->key[strlen(rtdata->key) - _len] = 0; rtdata->key = realloc(rtdata->key, sizeof(char)* (strlen(rtdata->key)+1)); return; } else if (ended == 1) { //local key ends first; go deeper subnodes = rtdata->subnodes; offset += x; } else { /* keys differ */ void *tmpdata = rtdata->data; COMPS_HSList *tmpnodes = rtdata->subnodes; int cmpret = strcmp(key+offset+x, rtdata->key+x); rtdata->subnodes = comps_hslist_create(); comps_hslist_init(rtdata->subnodes, NULL, NULL, &comps_mrtree_data_destroy_v); rtdata->data = NULL; if (cmpret > 0) { rtd = comps_mrtree_data_create(rt, rtdata->key+x, tmpdata); comps_hslist_destroy(&rtd->subnodes); rtd->subnodes = tmpnodes; comps_hslist_append(rtdata->subnodes, rtd, 0); rtd = comps_mrtree_data_create(rt, key+offset+x, ndata); comps_hslist_append(rtdata->subnodes, rtd, 0); } else { rtd = comps_mrtree_data_create(rt, key+offset+x, ndata); comps_hslist_append(rtdata->subnodes, rtd, 0); rtd = comps_mrtree_data_create(rt, rtdata->key+x, tmpdata); comps_hslist_destroy(&rtd->subnodes); rtd->subnodes = tmpnodes; comps_hslist_append(rtdata->subnodes, rtd, 0); } rtdata->key = realloc(rtdata->key, sizeof(char)*(x+1)); rtdata->key[x] = 0; return; } } } }
C
libcomps
0
CVE-2015-1281
https://www.cvedetails.com/cve/CVE-2015-1281/
CWE-254
https://github.com/chromium/chromium/commit/dff368031150a1033a1a3c913f8857679a0279be
dff368031150a1033a1a3c913f8857679a0279be
Correctly keep track of isolates for microtask execution BUG=487155 [email protected] Review URL: https://codereview.chromium.org/1161823002 git-svn-id: svn://svn.chromium.org/blink/trunk@195985 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void setLayoutTestMode(bool value) { LayoutTestSupport::setIsRunningLayoutTest(value); }
void setLayoutTestMode(bool value) { LayoutTestSupport::setIsRunningLayoutTest(value); }
C
Chrome
0
CVE-2015-5296
https://www.cvedetails.com/cve/CVE-2015-5296/
CWE-20
https://git.samba.org/?p=samba.git;a=commit;h=a819d2b440aafa3138d95ff6e8b824da885a70e9
a819d2b440aafa3138d95ff6e8b824da885a70e9
null
bool smbXcli_conn_is_connected(struct smbXcli_conn *conn) { if (conn == NULL) { return false; } if (conn->sock_fd == -1) { return false; } return true; }
bool smbXcli_conn_is_connected(struct smbXcli_conn *conn) { if (conn == NULL) { return false; } if (conn->sock_fd == -1) { return false; } return true; }
C
samba
0
CVE-2019-15920
https://www.cvedetails.com/cve/CVE-2019-15920/
CWE-416
https://github.com/torvalds/linux/commit/088aaf17aa79300cab14dbee2569c58cfafd7d6e
088aaf17aa79300cab14dbee2569c58cfafd7d6e
cifs: Fix use-after-free in SMB2_read There is a KASAN use-after-free: BUG: KASAN: use-after-free in SMB2_read+0x1136/0x1190 Read of size 8 at addr ffff8880b4e45e50 by task ln/1009 Should not release the 'req' because it will use in the trace. Fixes: eccb4422cf97 ("smb3: Add ftrace tracepoints for improved SMB3 debugging") Signed-off-by: ZhangXiaoxu <[email protected]> Signed-off-by: Steve French <[email protected]> CC: Stable <[email protected]> 4.18+ Reviewed-by: Pavel Shilovsky <[email protected]>
SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data) { int rc; struct cifs_ses *ses = sess_data->ses; struct smb2_sess_setup_rsp *rsp = NULL; char *ntlmssp_blob = NULL; bool use_spnego = false; /* else use raw ntlmssp */ u16 blob_length = 0; /* * If memory allocation is successful, caller of this function * frees it. */ ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); if (!ses->ntlmssp) { rc = -ENOMEM; goto out_err; } ses->ntlmssp->sesskey_per_smbsess = true; rc = SMB2_sess_alloc_buffer(sess_data); if (rc) goto out_err; ntlmssp_blob = kmalloc(sizeof(struct _NEGOTIATE_MESSAGE), GFP_KERNEL); if (ntlmssp_blob == NULL) { rc = -ENOMEM; goto out; } build_ntlmssp_negotiate_blob(ntlmssp_blob, ses); if (use_spnego) { /* BB eventually need to add this */ cifs_dbg(VFS, "spnego not supported for SMB2 yet\n"); rc = -EOPNOTSUPP; goto out; } else { blob_length = sizeof(struct _NEGOTIATE_MESSAGE); /* with raw NTLMSSP we don't encapsulate in SPNEGO */ } sess_data->iov[1].iov_base = ntlmssp_blob; sess_data->iov[1].iov_len = blob_length; rc = SMB2_sess_sendreceive(sess_data); rsp = (struct smb2_sess_setup_rsp *)sess_data->iov[0].iov_base; /* If true, rc here is expected and not an error */ if (sess_data->buf0_type != CIFS_NO_BUFFER && rsp->sync_hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) rc = 0; if (rc) goto out; if (offsetof(struct smb2_sess_setup_rsp, Buffer) != le16_to_cpu(rsp->SecurityBufferOffset)) { cifs_dbg(VFS, "Invalid security buffer offset %d\n", le16_to_cpu(rsp->SecurityBufferOffset)); rc = -EIO; goto out; } rc = decode_ntlmssp_challenge(rsp->Buffer, le16_to_cpu(rsp->SecurityBufferLength), ses); if (rc) goto out; cifs_dbg(FYI, "rawntlmssp session setup challenge phase\n"); ses->Suid = rsp->sync_hdr.SessionId; ses->session_flags = le16_to_cpu(rsp->SessionFlags); out: kfree(ntlmssp_blob); SMB2_sess_free_buffer(sess_data); if (!rc) { sess_data->result = 0; sess_data->func = SMB2_sess_auth_rawntlmssp_authenticate; return; } out_err: kfree(ses->ntlmssp); ses->ntlmssp = NULL; sess_data->result = rc; sess_data->func = NULL; }
SMB2_sess_auth_rawntlmssp_negotiate(struct SMB2_sess_data *sess_data) { int rc; struct cifs_ses *ses = sess_data->ses; struct smb2_sess_setup_rsp *rsp = NULL; char *ntlmssp_blob = NULL; bool use_spnego = false; /* else use raw ntlmssp */ u16 blob_length = 0; /* * If memory allocation is successful, caller of this function * frees it. */ ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); if (!ses->ntlmssp) { rc = -ENOMEM; goto out_err; } ses->ntlmssp->sesskey_per_smbsess = true; rc = SMB2_sess_alloc_buffer(sess_data); if (rc) goto out_err; ntlmssp_blob = kmalloc(sizeof(struct _NEGOTIATE_MESSAGE), GFP_KERNEL); if (ntlmssp_blob == NULL) { rc = -ENOMEM; goto out; } build_ntlmssp_negotiate_blob(ntlmssp_blob, ses); if (use_spnego) { /* BB eventually need to add this */ cifs_dbg(VFS, "spnego not supported for SMB2 yet\n"); rc = -EOPNOTSUPP; goto out; } else { blob_length = sizeof(struct _NEGOTIATE_MESSAGE); /* with raw NTLMSSP we don't encapsulate in SPNEGO */ } sess_data->iov[1].iov_base = ntlmssp_blob; sess_data->iov[1].iov_len = blob_length; rc = SMB2_sess_sendreceive(sess_data); rsp = (struct smb2_sess_setup_rsp *)sess_data->iov[0].iov_base; /* If true, rc here is expected and not an error */ if (sess_data->buf0_type != CIFS_NO_BUFFER && rsp->sync_hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) rc = 0; if (rc) goto out; if (offsetof(struct smb2_sess_setup_rsp, Buffer) != le16_to_cpu(rsp->SecurityBufferOffset)) { cifs_dbg(VFS, "Invalid security buffer offset %d\n", le16_to_cpu(rsp->SecurityBufferOffset)); rc = -EIO; goto out; } rc = decode_ntlmssp_challenge(rsp->Buffer, le16_to_cpu(rsp->SecurityBufferLength), ses); if (rc) goto out; cifs_dbg(FYI, "rawntlmssp session setup challenge phase\n"); ses->Suid = rsp->sync_hdr.SessionId; ses->session_flags = le16_to_cpu(rsp->SessionFlags); out: kfree(ntlmssp_blob); SMB2_sess_free_buffer(sess_data); if (!rc) { sess_data->result = 0; sess_data->func = SMB2_sess_auth_rawntlmssp_authenticate; return; } out_err: kfree(ses->ntlmssp); ses->ntlmssp = NULL; sess_data->result = rc; sess_data->func = NULL; }
C
linux
0
CVE-2017-14230
https://www.cvedetails.com/cve/CVE-2017-14230/
CWE-20
https://github.com/cyrusimap/cyrus-imapd/commit/6bd33275368edfa71ae117de895488584678ac79
6bd33275368edfa71ae117de895488584678ac79
mboxlist: fix uninitialised memory use where pattern is "Other Users"
static int find_cb(void *rockp, /* XXX - confirm these are the same? - nah */ const char *key __attribute__((unused)), size_t keylen __attribute__((unused)), const char *data __attribute__((unused)), size_t datalen __attribute__((unused))) { struct find_rock *rock = (struct find_rock *) rockp; char *testname = NULL; int r = 0; int i; if (rock->checkmboxlist && !rock->mbentry) { r = mboxlist_lookup(mbname_intname(rock->mbname), &rock->mbentry, NULL); if (r) { if (r == IMAP_MAILBOX_NONEXISTENT) r = 0; goto done; } } const char *extname = mbname_extname(rock->mbname, rock->namespace, rock->userid); testname = xstrndup(extname, rock->matchlen); struct findall_data fdata = { testname, rock->mb_category, rock->mbentry, NULL }; if (rock->singlepercent) { char sep = rock->namespace->hier_sep; char *p = testname; /* we need to try all the previous names in order */ while ((p = strchr(p, sep)) != NULL) { *p = '\0'; /* only if this expression could fully match */ int matchlen = 0; for (i = 0; i < rock->globs.count; i++) { glob *g = ptrarray_nth(&rock->globs, i); int thismatch = glob_test(g, testname); if (thismatch > matchlen) matchlen = thismatch; } if (matchlen == (int)strlen(testname)) { r = (*rock->proc)(&fdata, rock->procrock); if (r) goto done; } /* replace the separator for the next longest name */ *p++ = sep; } } /* mbname confirms that it's an exact match */ if (rock->matchlen == (int)strlen(extname)) fdata.mbname = rock->mbname; r = (*rock->proc)(&fdata, rock->procrock); done: free(testname); mboxlist_entry_free(&rock->mbentry); mbname_free(&rock->mbname); return r; }
static int find_cb(void *rockp, /* XXX - confirm these are the same? - nah */ const char *key __attribute__((unused)), size_t keylen __attribute__((unused)), const char *data __attribute__((unused)), size_t datalen __attribute__((unused))) { struct find_rock *rock = (struct find_rock *) rockp; char *testname = NULL; int r = 0; int i; if (rock->checkmboxlist && !rock->mbentry) { r = mboxlist_lookup(mbname_intname(rock->mbname), &rock->mbentry, NULL); if (r) { if (r == IMAP_MAILBOX_NONEXISTENT) r = 0; goto done; } } const char *extname = mbname_extname(rock->mbname, rock->namespace, rock->userid); testname = xstrndup(extname, rock->matchlen); struct findall_data fdata = { testname, rock->mb_category, rock->mbentry, NULL }; if (rock->singlepercent) { char sep = rock->namespace->hier_sep; char *p = testname; /* we need to try all the previous names in order */ while ((p = strchr(p, sep)) != NULL) { *p = '\0'; /* only if this expression could fully match */ int matchlen = 0; for (i = 0; i < rock->globs.count; i++) { glob *g = ptrarray_nth(&rock->globs, i); int thismatch = glob_test(g, testname); if (thismatch > matchlen) matchlen = thismatch; } if (matchlen == (int)strlen(testname)) { r = (*rock->proc)(&fdata, rock->procrock); if (r) goto done; } /* replace the separator for the next longest name */ *p++ = sep; } } /* mbname confirms that it's an exact match */ if (rock->matchlen == (int)strlen(extname)) fdata.mbname = rock->mbname; r = (*rock->proc)(&fdata, rock->procrock); done: free(testname); mboxlist_entry_free(&rock->mbentry); mbname_free(&rock->mbname); return r; }
C
cyrus-imapd
0
CVE-2011-2859
https://www.cvedetails.com/cve/CVE-2011-2859/
CWE-264
https://github.com/chromium/chromium/commit/454434f6100cb6a529652a25b5fc181caa7c7f32
454434f6100cb6a529652a25b5fc181caa7c7f32
Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installing extensions and apps from the webstore, starting both being initially logged in, and not. Review URL: http://codereview.chromium.org/7719003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97986 0039d316-1c4b-4281-b951-d872f2087c98
void ExtensionService::StopSyncing(syncable::ModelType type) { SyncBundle* bundle = GetSyncBundleForModelType(type); CHECK(bundle); *bundle = SyncBundle(); }
void ExtensionService::StopSyncing(syncable::ModelType type) { SyncBundle* bundle = GetSyncBundleForModelType(type); CHECK(bundle); *bundle = SyncBundle(); }
C
Chrome
0
CVE-2018-15132
https://www.cvedetails.com/cve/CVE-2018-15132/
CWE-200
https://github.com/php/php-src/commit/f151e048ed27f6f4eef729f3310d053ab5da71d4
f151e048ed27f6f4eef729f3310d053ab5da71d4
Fixed bug #76459 windows linkinfo lacks openbasedir check
PHP_FUNCTION(readlink) { char *link; size_t link_len; char target[MAXPATHLEN]; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) { return; } if (OPENBASEDIR_CHECKPATH(link)) { RETURN_FALSE; } if (php_sys_readlink(link, target, MAXPATHLEN) == -1) { php_error_docref(NULL, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError()); RETURN_FALSE; } RETURN_STRING(target); }
PHP_FUNCTION(readlink) { char *link; size_t link_len; char target[MAXPATHLEN]; if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) { return; } if (OPENBASEDIR_CHECKPATH(link)) { RETURN_FALSE; } if (php_sys_readlink(link, target, MAXPATHLEN) == -1) { php_error_docref(NULL, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError()); RETURN_FALSE; } RETURN_STRING(target); }
C
php-src
0
CVE-2018-16077
https://www.cvedetails.com/cve/CVE-2018-16077/
CWE-285
https://github.com/chromium/chromium/commit/90f878780cce9c4b0475fcea14d91b8f510cce11
90f878780cce9c4b0475fcea14d91b8f510cce11
Prevent sandboxed documents from reusing the default window Bug: 377995 Change-Id: Iff66c6d214dfd0cb7ea9c80f83afeedfff703541 Reviewed-on: https://chromium-review.googlesource.com/983558 Commit-Queue: Andy Paicu <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Cr-Commit-Position: refs/heads/master@{#567663}
WebPluginContainerImpl* LocalFrame::GetWebPluginContainer(Node* node) const { if (GetDocument() && GetDocument()->IsPluginDocument()) { return ToPluginDocument(GetDocument())->GetPluginView(); } if (!node) { DCHECK(GetDocument()); node = GetDocument()->FocusedElement(); } if (node) { return node->GetWebPluginContainer(); } return nullptr; }
WebPluginContainerImpl* LocalFrame::GetWebPluginContainer(Node* node) const { if (GetDocument() && GetDocument()->IsPluginDocument()) { return ToPluginDocument(GetDocument())->GetPluginView(); } if (!node) { DCHECK(GetDocument()); node = GetDocument()->FocusedElement(); } if (node) { return node->GetWebPluginContainer(); } return nullptr; }
C
Chrome
0
CVE-2011-3103
https://www.cvedetails.com/cve/CVE-2011-3103/
CWE-399
https://github.com/chromium/chromium/commit/b2dfe7c175fb21263f06eb586f1ed235482a3281
b2dfe7c175fb21263f06eb586f1ed235482a3281
[EFL] fast/frames/frame-crash-with-page-cache.html is crashing https://bugs.webkit.org/show_bug.cgi?id=85879 Patch by Mikhail Pozdnyakov <[email protected]> on 2012-05-17 Reviewed by Noam Rosenthal. Source/WebKit/efl: _ewk_frame_smart_del() is considering now that the frame can be present in cache. loader()->detachFromParent() is only applied for the main frame. loader()->cancelAndClear() is not used anymore. * ewk/ewk_frame.cpp: (_ewk_frame_smart_del): LayoutTests: * platform/efl/test_expectations.txt: Removed fast/frames/frame-crash-with-page-cache.html. git-svn-id: svn://svn.chromium.org/blink/trunk@117409 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false); return smartData->frame->editor()->markedTextMatchesAreHighlighted(); }
Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object* ewkFrame) { EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false); EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false); return smartData->frame->editor()->markedTextMatchesAreHighlighted(); }
C
Chrome
0
CVE-2013-4387
https://www.cvedetails.com/cve/CVE-2013-4387/
CWE-119
https://github.com/torvalds/linux/commit/2811ebac2521ceac84f2bdae402455baa6a7fb47
2811ebac2521ceac84f2bdae402455baa6a7fb47
ipv6: udp packets following an UFO enqueued packet need also be handled by UFO In the following scenario the socket is corked: If the first UDP packet is larger then the mtu we try to append it to the write queue via ip6_ufo_append_data. A following packet, which is smaller than the mtu would be appended to the already queued up gso-skb via plain ip6_append_data. This causes random memory corruptions. In ip6_ufo_append_data we also have to be careful to not queue up the same skb multiple times. So setup the gso frame only when no first skb is available. This also fixes a shortcoming where we add the current packet's length to cork->length but return early because of a packet > mtu with dontfrag set (instead of sutracting it again). Found with trinity. Cc: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Reported-by: Dmitry Vyukov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, struct ipv6_txoptions *opt, int tclass) { struct net *net = sock_net(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *first_hop = &fl6->daddr; struct dst_entry *dst = skb_dst(skb); struct ipv6hdr *hdr; u8 proto = fl6->flowi6_proto; int seg_len = skb->len; int hlimit = -1; u32 mtu; if (opt) { unsigned int head_room; /* First: exthdrs may take lots of space (~8K for now) MAX_HEADER is not enough. */ head_room = opt->opt_nflen + opt->opt_flen; seg_len += head_room; head_room += sizeof(struct ipv6hdr) + LL_RESERVED_SPACE(dst->dev); if (skb_headroom(skb) < head_room) { struct sk_buff *skb2 = skb_realloc_headroom(skb, head_room); if (skb2 == NULL) { IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_OUTDISCARDS); kfree_skb(skb); return -ENOBUFS; } consume_skb(skb); skb = skb2; skb_set_owner_w(skb, sk); } if (opt->opt_flen) ipv6_push_frag_opts(skb, opt, &proto); if (opt->opt_nflen) ipv6_push_nfrag_opts(skb, opt, &proto, &first_hop); } skb_push(skb, sizeof(struct ipv6hdr)); skb_reset_network_header(skb); hdr = ipv6_hdr(skb); /* * Fill in the IPv6 header */ if (np) hlimit = np->hop_limit; if (hlimit < 0) hlimit = ip6_dst_hoplimit(dst); ip6_flow_hdr(hdr, tclass, fl6->flowlabel); hdr->payload_len = htons(seg_len); hdr->nexthdr = proto; hdr->hop_limit = hlimit; hdr->saddr = fl6->saddr; hdr->daddr = *first_hop; skb->protocol = htons(ETH_P_IPV6); skb->priority = sk->sk_priority; skb->mark = sk->sk_mark; mtu = dst_mtu(dst); if ((skb->len <= mtu) || skb->local_df || skb_is_gso(skb)) { IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_OUT, skb->len); return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL, dst->dev, dst_output); } skb->dev = dst->dev; ipv6_local_error(sk, EMSGSIZE, fl6, mtu); IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); kfree_skb(skb); return -EMSGSIZE; }
int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, struct ipv6_txoptions *opt, int tclass) { struct net *net = sock_net(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *first_hop = &fl6->daddr; struct dst_entry *dst = skb_dst(skb); struct ipv6hdr *hdr; u8 proto = fl6->flowi6_proto; int seg_len = skb->len; int hlimit = -1; u32 mtu; if (opt) { unsigned int head_room; /* First: exthdrs may take lots of space (~8K for now) MAX_HEADER is not enough. */ head_room = opt->opt_nflen + opt->opt_flen; seg_len += head_room; head_room += sizeof(struct ipv6hdr) + LL_RESERVED_SPACE(dst->dev); if (skb_headroom(skb) < head_room) { struct sk_buff *skb2 = skb_realloc_headroom(skb, head_room); if (skb2 == NULL) { IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_OUTDISCARDS); kfree_skb(skb); return -ENOBUFS; } consume_skb(skb); skb = skb2; skb_set_owner_w(skb, sk); } if (opt->opt_flen) ipv6_push_frag_opts(skb, opt, &proto); if (opt->opt_nflen) ipv6_push_nfrag_opts(skb, opt, &proto, &first_hop); } skb_push(skb, sizeof(struct ipv6hdr)); skb_reset_network_header(skb); hdr = ipv6_hdr(skb); /* * Fill in the IPv6 header */ if (np) hlimit = np->hop_limit; if (hlimit < 0) hlimit = ip6_dst_hoplimit(dst); ip6_flow_hdr(hdr, tclass, fl6->flowlabel); hdr->payload_len = htons(seg_len); hdr->nexthdr = proto; hdr->hop_limit = hlimit; hdr->saddr = fl6->saddr; hdr->daddr = *first_hop; skb->protocol = htons(ETH_P_IPV6); skb->priority = sk->sk_priority; skb->mark = sk->sk_mark; mtu = dst_mtu(dst); if ((skb->len <= mtu) || skb->local_df || skb_is_gso(skb)) { IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_OUT, skb->len); return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL, dst->dev, dst_output); } skb->dev = dst->dev; ipv6_local_error(sk, EMSGSIZE, fl6, mtu); IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); kfree_skb(skb); return -EMSGSIZE; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/a3e2afaedd8190398ae45ccef34fcdee00fb19aa
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
Fixed crash related to cellular network payment plan retreival. BUG=chromium-os:8864 TEST=none Review URL: http://codereview.chromium.org/4690002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65405 0039d316-1c4b-4281-b951-d872f2087c98
virtual void SaveCellularNetwork(const CellularNetwork* network) { DCHECK(network); if (!EnsureCrosLoaded() || !network) return; SetAutoConnect(network->service_path().c_str(), network->auto_connect()); }
virtual void SaveCellularNetwork(const CellularNetwork* network) { DCHECK(network); if (!EnsureCrosLoaded() || !network) return; SetAutoConnect(network->service_path().c_str(), network->auto_connect()); }
C
Chrome
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
static void OverloadedMethodG1Method(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "overloadedMethodG"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); int32_t long_arg; long_arg = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), info[0], exception_state); if (exception_state.HadException()) return; impl->overloadedMethodG(long_arg); }
static void OverloadedMethodG1Method(const v8::FunctionCallbackInfo<v8::Value>& info) { ExceptionState exception_state(info.GetIsolate(), ExceptionState::kExecutionContext, "TestObject", "overloadedMethodG"); TestObject* impl = V8TestObject::ToImpl(info.Holder()); int32_t long_arg; long_arg = NativeValueTraits<IDLLong>::NativeValue(info.GetIsolate(), info[0], exception_state); if (exception_state.HadException()) return; impl->overloadedMethodG(long_arg); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/6834289784ed45b5524de0fb7ef43ae283b0d6d3
6834289784ed45b5524de0fb7ef43ae283b0d6d3
Output silence if the MediaElementAudioSourceNode has a different origin See http://webaudio.github.io/web-audio-api/#security-with-mediaelementaudiosourcenode-and-cross-origin-resources Two new tests added for the same origin and a cross origin source. BUG=313939 Review URL: https://codereview.chromium.org/520433002 git-svn-id: svn://svn.chromium.org/blink/trunk@189527 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void AudioContext::handleDirtyAudioNodeOutputs() { ASSERT(isGraphOwner()); for (HashSet<AudioNodeOutput*>::iterator i = m_dirtyAudioNodeOutputs.begin(); i != m_dirtyAudioNodeOutputs.end(); ++i) (*i)->updateRenderingState(); m_dirtyAudioNodeOutputs.clear(); }
void AudioContext::handleDirtyAudioNodeOutputs() { ASSERT(isGraphOwner()); for (HashSet<AudioNodeOutput*>::iterator i = m_dirtyAudioNodeOutputs.begin(); i != m_dirtyAudioNodeOutputs.end(); ++i) (*i)->updateRenderingState(); m_dirtyAudioNodeOutputs.clear(); }
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
bool LiveSyncTest::IsTestServerRunning() { CommandLine* cl = CommandLine::ForCurrentProcess(); std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); GURL sync_url_status(sync_url.append("/healthz")); SyncServerStatusChecker delegate; URLFetcher fetcher(sync_url_status, URLFetcher::GET, &delegate); fetcher.set_request_context(Profile::GetDefaultRequestContext()); fetcher.Start(); ui_test_utils::RunMessageLoop(); return delegate.running(); }
bool LiveSyncTest::IsTestServerRunning() { CommandLine* cl = CommandLine::ForCurrentProcess(); std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL); GURL sync_url_status(sync_url.append("/healthz")); SyncServerStatusChecker delegate; URLFetcher fetcher(sync_url_status, URLFetcher::GET, &delegate); fetcher.set_request_context(Profile::GetDefaultRequestContext()); fetcher.Start(); ui_test_utils::RunMessageLoop(); return delegate.running(); }
C
Chrome
0
CVE-2013-0211
https://www.cvedetails.com/cve/CVE-2013-0211/
CWE-189
https://github.com/libarchive/libarchive/commit/22531545514043e04633e1c015c7540b9de9dbe4
22531545514043e04633e1c015c7540b9de9dbe4
Limit write requests to at most INT_MAX. This prevents a certain common programming error (passing -1 to write) from leading to other problems deeper in the library.
archive_write_vtable(void) { static struct archive_vtable av; static int inited = 0; if (!inited) { av.archive_close = _archive_write_close; av.archive_filter_bytes = _archive_filter_bytes; av.archive_filter_code = _archive_filter_code; av.archive_filter_name = _archive_filter_name; av.archive_filter_count = _archive_write_filter_count; av.archive_free = _archive_write_free; av.archive_write_header = _archive_write_header; av.archive_write_finish_entry = _archive_write_finish_entry; av.archive_write_data = _archive_write_data; inited = 1; } return (&av); }
archive_write_vtable(void) { static struct archive_vtable av; static int inited = 0; if (!inited) { av.archive_close = _archive_write_close; av.archive_filter_bytes = _archive_filter_bytes; av.archive_filter_code = _archive_filter_code; av.archive_filter_name = _archive_filter_name; av.archive_filter_count = _archive_write_filter_count; av.archive_free = _archive_write_free; av.archive_write_header = _archive_write_header; av.archive_write_finish_entry = _archive_write_finish_entry; av.archive_write_data = _archive_write_data; inited = 1; } return (&av); }
C
libarchive
0
CVE-2018-18340
https://www.cvedetails.com/cve/CVE-2018-18340/
CWE-119
https://github.com/chromium/chromium/commit/f5ef337d8fffd10ab327069467ccaedb843cf9db
f5ef337d8fffd10ab327069467ccaedb843cf9db
Check context is attached before creating MediaRecorder Bug: 896736 Change-Id: I3ccfd2188fb15704af14c8af050e0a5667855d34 Reviewed-on: https://chromium-review.googlesource.com/c/1324231 Commit-Queue: Emircan Uysaler <[email protected]> Reviewed-by: Miguel Casas <[email protected]> Cr-Commit-Position: refs/heads/master@{#606242}
void MediaRecorder::ScheduleDispatchEvent(Event* event) { scheduled_events_.push_back(event); dispatch_scheduled_event_runner_->RunAsync(); }
void MediaRecorder::ScheduleDispatchEvent(Event* event) { scheduled_events_.push_back(event); dispatch_scheduled_event_runner_->RunAsync(); }
C
Chrome
0
CVE-2017-9059
https://www.cvedetails.com/cve/CVE-2017-9059/
CWE-404
https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1
c70422f760c120480fee4de6c38804c72aa26bc1
Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Another RDMA update from Chuck Lever, and a bunch of miscellaneous bugfixes" * tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits) nfsd: Fix up the "supattr_exclcreat" attributes nfsd: encoders mustn't use unitialized values in error cases nfsd: fix undefined behavior in nfsd4_layout_verify lockd: fix lockd shutdown race NFSv4: Fix callback server shutdown SUNRPC: Refactor svc_set_num_threads() NFSv4.x/callback: Create the callback service through svc_create_pooled lockd: remove redundant check on block svcrdma: Clean out old XDR encoders svcrdma: Remove the req_map cache svcrdma: Remove unused RDMA Write completion handler svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt svcrdma: Clean up RPC-over-RDMA backchannel reply processing svcrdma: Report Write/Reply chunk overruns svcrdma: Clean up RDMA_ERROR path svcrdma: Use rdma_rw API in RPC reply path svcrdma: Introduce local rdma_rw API helpers svcrdma: Clean up svc_rdma_get_inv_rkey() svcrdma: Add helper to save pages under I/O svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT ...
find_file(struct knfsd_fh *fh) { struct nfs4_file *fp; unsigned int hashval = file_hashval(fh); rcu_read_lock(); fp = find_file_locked(fh, hashval); rcu_read_unlock(); return fp; }
find_file(struct knfsd_fh *fh) { struct nfs4_file *fp; unsigned int hashval = file_hashval(fh); rcu_read_lock(); fp = find_file_locked(fh, hashval); rcu_read_unlock(); return fp; }
C
linux
0
CVE-2016-10746
https://www.cvedetails.com/cve/CVE-2016-10746/
CWE-254
https://github.com/libvirt/libvirt/commit/506e9d6c2d4baaf580d489fff0690c0ff2ff588f
506e9d6c2d4baaf580d489fff0690c0ff2ff588f
virDomainGetTime: Deny on RO connections We have a policy that if API may end up talking to a guest agent it should require RW connection. We don't obey the rule in virDomainGetTime(). Signed-off-by: Michal Privoznik <[email protected]>
virDomainSetMetadata(virDomainPtr domain, int type, const char *metadata, const char *key, const char *uri, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(domain, "type=%d, metadata='%s', key='%s', uri='%s', flags=%x", type, NULLSTR(metadata), NULLSTR(key), NULLSTR(uri), flags); virResetLastError(); virCheckDomainReturn(domain, -1); conn = domain->conn; virCheckReadOnlyGoto(conn->flags, error); switch (type) { case VIR_DOMAIN_METADATA_TITLE: if (metadata && strchr(metadata, '\n')) { virReportInvalidArg(metadata, "%s", _("metadata title can't contain " "newlines")); goto error; } /* fallthrough */ case VIR_DOMAIN_METADATA_DESCRIPTION: virCheckNullArgGoto(uri, error); virCheckNullArgGoto(key, error); break; case VIR_DOMAIN_METADATA_ELEMENT: virCheckNonNullArgGoto(uri, error); if (metadata) virCheckNonNullArgGoto(key, error); break; default: /* For future expansion */ break; } if (conn->driver->domainSetMetadata) { int ret; ret = conn->driver->domainSetMetadata(domain, type, metadata, key, uri, flags); if (ret < 0) goto error; return ret; } virReportUnsupportedError(); error: virDispatchError(domain->conn); return -1; }
virDomainSetMetadata(virDomainPtr domain, int type, const char *metadata, const char *key, const char *uri, unsigned int flags) { virConnectPtr conn; VIR_DOMAIN_DEBUG(domain, "type=%d, metadata='%s', key='%s', uri='%s', flags=%x", type, NULLSTR(metadata), NULLSTR(key), NULLSTR(uri), flags); virResetLastError(); virCheckDomainReturn(domain, -1); conn = domain->conn; virCheckReadOnlyGoto(conn->flags, error); switch (type) { case VIR_DOMAIN_METADATA_TITLE: if (metadata && strchr(metadata, '\n')) { virReportInvalidArg(metadata, "%s", _("metadata title can't contain " "newlines")); goto error; } /* fallthrough */ case VIR_DOMAIN_METADATA_DESCRIPTION: virCheckNullArgGoto(uri, error); virCheckNullArgGoto(key, error); break; case VIR_DOMAIN_METADATA_ELEMENT: virCheckNonNullArgGoto(uri, error); if (metadata) virCheckNonNullArgGoto(key, error); break; default: /* For future expansion */ break; } if (conn->driver->domainSetMetadata) { int ret; ret = conn->driver->domainSetMetadata(domain, type, metadata, key, uri, flags); if (ret < 0) goto error; return ret; } virReportUnsupportedError(); error: virDispatchError(domain->conn); return -1; }
C
libvirt
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
void WebPageProxy::pageDidScroll() { m_uiClient.pageDidScroll(this); }
void WebPageProxy::pageDidScroll() { m_uiClient.pageDidScroll(this); }
C
Chrome
0
CVE-2017-18233
https://www.cvedetails.com/cve/CVE-2017-18233/
CWE-190
https://cgit.freedesktop.org/exempi/commit/?id=65a8492832b7335ffabd01f5f64d89dec757c260
65a8492832b7335ffabd01f5f64d89dec757c260
null
JunkChunk::JunkChunk( ContainerChunk* parent, RIFF_MetaHandler* handler ) : Chunk( parent, handler, true, chunk_JUNK ) { chunkType = chunk_JUNK; }
JunkChunk::JunkChunk( ContainerChunk* parent, RIFF_MetaHandler* handler ) : Chunk( parent, handler, true, chunk_JUNK ) { chunkType = chunk_JUNK; }
CPP
exempi
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
double AudioHandler::PercentToVolumeDb(double volume_percent) const { double min_volume_db, max_volume_db; mixer_->GetVolumeLimits(&min_volume_db, &max_volume_db); return pow(volume_percent / 100.0, kVolumeBias) * (max_volume_db - min_volume_db) + min_volume_db; }
double AudioHandler::PercentToVolumeDb(double volume_percent) const { double min_volume_db, max_volume_db; mixer_->GetVolumeLimits(&min_volume_db, &max_volume_db); return pow(volume_percent / 100.0, kVolumeBias) * (max_volume_db - min_volume_db) + min_volume_db; }
C
Chrome
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#653137}
void RenderFrameImpl::WidgetWillClose() { for (auto& observer : observers_) observer.WidgetWillClose(); }
void RenderFrameImpl::WidgetWillClose() { for (auto& observer : observers_) observer.WidgetWillClose(); }
C
Chrome
0
CVE-2013-7017
https://www.cvedetails.com/cve/CVE-2013-7017/
null
https://github.com/FFmpeg/FFmpeg/commit/912ce9dd2080c5837285a471d750fa311e09b555
912ce9dd2080c5837285a471d750fa311e09b555
jpeg2000: fix dereferencing invalid pointers Found-by: Laurent Butti <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) { int reslevelno, bandno, precno; for (reslevelno = 0; comp->reslevel && reslevelno < codsty->nreslevels; reslevelno++) { Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno; for (bandno = 0; bandno < reslevel->nbands; bandno++) { Jpeg2000Band *band = reslevel->band + bandno; for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) { if (band->prec) { Jpeg2000Prec *prec = band->prec + precno; av_freep(&prec->zerobits); av_freep(&prec->cblkincl); av_freep(&prec->cblk); } } av_freep(&band->prec); } av_freep(&reslevel->band); } ff_dwt_destroy(&comp->dwt); av_freep(&comp->reslevel); av_freep(&comp->i_data); av_freep(&comp->f_data); }
void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) { int reslevelno, bandno, precno; for (reslevelno = 0; comp->reslevel && reslevelno < codsty->nreslevels; reslevelno++) { Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno; for (bandno = 0; bandno < reslevel->nbands; bandno++) { Jpeg2000Band *band = reslevel->band + bandno; for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) { Jpeg2000Prec *prec = band->prec + precno; av_freep(&prec->zerobits); av_freep(&prec->cblkincl); av_freep(&prec->cblk); } av_freep(&band->prec); } av_freep(&reslevel->band); } ff_dwt_destroy(&comp->dwt); av_freep(&comp->reslevel); av_freep(&comp->i_data); av_freep(&comp->f_data); }
C
FFmpeg
1
CVE-2017-0600
https://www.cvedetails.com/cve/CVE-2017-0600/
null
https://android.googlesource.com/platform/frameworks/av/+/961e5ac5788b52304e64b9a509781beaf5201fb0
961e5ac5788b52304e64b9a509781beaf5201fb0
Fix NPDs in h263 decoder Bug: 35269635 Test: decoded PoC with and without patch Change-Id: I636a14360c7801cc5bca63c9cb44d1d235df8fd8 (cherry picked from commit 2ad2a92318a3b9daf78ebcdc597085adbf32600d)
int32 PVLocateH263FrameHeader(uint8 *ptr, int32 size) { int count = 0; int32 i = size; if (size < 1) { return 0; } while (i--) { if ((count > 1) && ((*ptr & 0xFC) == 0x80)) { i += 2; break; } if (*ptr++) count = 0; else count++; } return (size - (i + 1)); }
int32 PVLocateH263FrameHeader(uint8 *ptr, int32 size) { int count = 0; int32 i = size; if (size < 1) { return 0; } while (i--) { if ((count > 1) && ((*ptr & 0xFC) == 0x80)) { i += 2; break; } if (*ptr++) count = 0; else count++; } return (size - (i + 1)); }
C
Android
0
CVE-2011-2346
https://www.cvedetails.com/cve/CVE-2011-2346/
CWE-399
https://github.com/chromium/chromium/commit/dabd6f450e9594a8962ef6f79447a8bfdc1c9f05
dabd6f450e9594a8962ef6f79447a8bfdc1c9f05
wstring: remove wstring version of SplitString Retry of r84336. BUG=23581 Review URL: http://codereview.chromium.org/6930047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84355 0039d316-1c4b-4281-b951-d872f2087c98
void Label::SetText(const std::wstring& text) { text_ = WideToUTF16Hack(text); url_set_ = false; text_size_valid_ = false; PreferredSizeChanged(); SchedulePaint(); }
void Label::SetText(const std::wstring& text) { text_ = WideToUTF16Hack(text); url_set_ = false; text_size_valid_ = false; PreferredSizeChanged(); SchedulePaint(); }
C
Chrome
0
CVE-2017-14172
https://www.cvedetails.com/cve/CVE-2017-14172/
CWE-834
https://github.com/ImageMagick/ImageMagick/commit/8598a497e2d1f556a34458cf54b40ba40674734c
8598a497e2d1f556a34458cf54b40ba40674734c
https://github.com/ImageMagick/ImageMagick/issues/715
static MagickBooleanType IsPS(const unsigned char *magick,const size_t length) { if (length < 4) return(MagickFalse); if (memcmp(magick,"%!",2) == 0) return(MagickTrue); if (memcmp(magick,"\004%!",3) == 0) return(MagickTrue); return(MagickFalse); }
static MagickBooleanType IsPS(const unsigned char *magick,const size_t length) { if (length < 4) return(MagickFalse); if (memcmp(magick,"%!",2) == 0) return(MagickTrue); if (memcmp(magick,"\004%!",3) == 0) return(MagickTrue); return(MagickFalse); }
C
ImageMagick
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
static void init_cfs_rq(struct cfs_rq *cfs_rq, struct rq *rq) { cfs_rq->tasks_timeline = RB_ROOT; INIT_LIST_HEAD(&cfs_rq->tasks); #ifdef CONFIG_FAIR_GROUP_SCHED cfs_rq->rq = rq; #endif cfs_rq->min_vruntime = (u64)(-(1LL << 20)); }
static void init_cfs_rq(struct cfs_rq *cfs_rq, struct rq *rq) { cfs_rq->tasks_timeline = RB_ROOT; INIT_LIST_HEAD(&cfs_rq->tasks); #ifdef CONFIG_FAIR_GROUP_SCHED cfs_rq->rq = rq; #endif cfs_rq->min_vruntime = (u64)(-(1LL << 20)); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/d1a59e4e845a01d7d7b80ef184b672752a9eae4d
d1a59e4e845a01d7d7b80ef184b672752a9eae4d
Fixing cross-process postMessage replies on more than two iterations. When two frames are replying to each other using event.source across processes, after the first two replies, things break down. The root cause is that in RenderViewImpl::GetFrameByMappedID, the lookup was incorrect. It is now properly searching for the remote frame id and returning the local one. BUG=153445 Review URL: https://chromiumcodereview.appspot.com/11040015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159924 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewImpl::OnSetInitialFocus(bool reverse) { if (!webview()) return; webview()->setInitialFocus(reverse); }
void RenderViewImpl::OnSetInitialFocus(bool reverse) { if (!webview()) return; webview()->setInitialFocus(reverse); }
C
Chrome
0
CVE-2016-7412
https://www.cvedetails.com/cve/CVE-2016-7412/
CWE-119
https://github.com/php/php-src/commit/28f80baf3c53e267c9ce46a2a0fadbb981585132?w=1
28f80baf3c53e267c9ce46a2a0fadbb981585132?w=1
Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC) { zend_uchar buffer[MYSQLND_HEADER_SIZE + 1]; size_t sent; DBG_ENTER("php_mysqlnd_sha256_pk_request_write"); int1store(buffer + MYSQLND_HEADER_SIZE, '\1'); sent = conn->net->data->m.send_ex(conn->net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC); DBG_RETURN(sent); }
size_t php_mysqlnd_sha256_pk_request_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC) { zend_uchar buffer[MYSQLND_HEADER_SIZE + 1]; size_t sent; DBG_ENTER("php_mysqlnd_sha256_pk_request_write"); int1store(buffer + MYSQLND_HEADER_SIZE, '\1'); sent = conn->net->data->m.send_ex(conn->net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC); DBG_RETURN(sent); }
C
php-src
0
CVE-2015-1274
https://www.cvedetails.com/cve/CVE-2015-1274/
CWE-254
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
d27468a832d5316884bd02f459cbf493697fd7e1
Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858}
static inline LayoutObject* endOfContinuations(LayoutObject* layoutObject) { LayoutObject* prev = layoutObject; LayoutObject* cur = layoutObject; if (!cur->isLayoutInline() && !cur->isLayoutBlockFlow()) return layoutObject; while (cur) { prev = cur; if (cur->isLayoutInline()) { cur = toLayoutInline(cur)->inlineElementContinuation(); ASSERT(cur || !toLayoutInline(prev)->continuation()); } else { cur = toLayoutBlockFlow(cur)->inlineElementContinuation(); } } return prev; }
static inline LayoutObject* endOfContinuations(LayoutObject* layoutObject) { LayoutObject* prev = layoutObject; LayoutObject* cur = layoutObject; if (!cur->isLayoutInline() && !cur->isLayoutBlockFlow()) return layoutObject; while (cur) { prev = cur; if (cur->isLayoutInline()) { cur = toLayoutInline(cur)->inlineElementContinuation(); ASSERT(cur || !toLayoutInline(prev)->continuation()); } else { cur = toLayoutBlockFlow(cur)->inlineElementContinuation(); } } return prev; }
C
Chrome
0
CVE-2013-1773
https://www.cvedetails.com/cve/CVE-2013-1773/
CWE-119
https://github.com/torvalds/linux/commit/0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd
0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd
NLS: improve UTF8 -> UTF16 string conversion routine The utf8s_to_utf16s conversion routine needs to be improved. Unlike its utf16s_to_utf8s sibling, it doesn't accept arguments specifying the maximum length of the output buffer or the endianness of its 16-bit output. This patch (as1501) adds the two missing arguments, and adjusts the only two places in the kernel where the function is called. A follow-on patch will add a third caller that does utilize the new capabilities. The two conversion routines are still annoyingly inconsistent in the way they handle invalid byte combinations. But that's a subject for a different patch. Signed-off-by: Alan Stern <[email protected]> CC: Clemens Ladisch <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static inline wchar_t vfat_bad_char(wchar_t w) { return (w < 0x0020) || (w == '*') || (w == '?') || (w == '<') || (w == '>') || (w == '|') || (w == '"') || (w == ':') || (w == '/') || (w == '\\'); }
static inline wchar_t vfat_bad_char(wchar_t w) { return (w < 0x0020) || (w == '*') || (w == '?') || (w == '<') || (w == '>') || (w == '|') || (w == '"') || (w == ':') || (w == '/') || (w == '\\'); }
C
linux
0
CVE-2013-3301
https://www.cvedetails.com/cve/CVE-2013-3301/
null
https://github.com/torvalds/linux/commit/6a76f8c0ab19f215af2a3442870eeb5f0e81998d
6a76f8c0ab19f215af2a3442870eeb5f0e81998d
tracing: Fix possible NULL pointer dereferences Currently set_ftrace_pid and set_graph_function files use seq_lseek for their fops. However seq_open() is called only for FMODE_READ in the fops->open() so that if an user tries to seek one of those file when she open it for writing, it sees NULL seq_file and then panic. It can be easily reproduced with following command: $ cd /sys/kernel/debug/tracing $ echo 1234 | sudo tee -a set_ftrace_pid In this example, GNU coreutils' tee opens the file with fopen(, "a") and then the fopen() internally calls lseek(). Link: http://lkml.kernel.org/r/[email protected] Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
static int ftrace_process_locs(struct module *mod, unsigned long *start, unsigned long *end) { struct ftrace_page *start_pg; struct ftrace_page *pg; struct dyn_ftrace *rec; unsigned long count; unsigned long *p; unsigned long addr; unsigned long flags = 0; /* Shut up gcc */ int ret = -ENOMEM; count = end - start; if (!count) return 0; sort(start, count, sizeof(*start), ftrace_cmp_ips, ftrace_swap_ips); start_pg = ftrace_allocate_pages(count); if (!start_pg) return -ENOMEM; mutex_lock(&ftrace_lock); /* * Core and each module needs their own pages, as * modules will free them when they are removed. * Force a new page to be allocated for modules. */ if (!mod) { WARN_ON(ftrace_pages || ftrace_pages_start); /* First initialization */ ftrace_pages = ftrace_pages_start = start_pg; } else { if (!ftrace_pages) goto out; if (WARN_ON(ftrace_pages->next)) { /* Hmm, we have free pages? */ while (ftrace_pages->next) ftrace_pages = ftrace_pages->next; } ftrace_pages->next = start_pg; } p = start; pg = start_pg; while (p < end) { addr = ftrace_call_adjust(*p++); /* * Some architecture linkers will pad between * the different mcount_loc sections of different * object files to satisfy alignments. * Skip any NULL pointers. */ if (!addr) continue; if (pg->index == pg->size) { /* We should have allocated enough */ if (WARN_ON(!pg->next)) break; pg = pg->next; } rec = &pg->records[pg->index++]; rec->ip = addr; } /* We should have used all pages */ WARN_ON(pg->next); /* Assign the last page to ftrace_pages */ ftrace_pages = pg; /* These new locations need to be initialized */ ftrace_new_pgs = start_pg; /* * We only need to disable interrupts on start up * because we are modifying code that an interrupt * may execute, and the modification is not atomic. * But for modules, nothing runs the code we modify * until we are finished with it, and there's no * reason to cause large interrupt latencies while we do it. */ if (!mod) local_irq_save(flags); ftrace_update_code(mod); if (!mod) local_irq_restore(flags); ret = 0; out: mutex_unlock(&ftrace_lock); return ret; }
static int ftrace_process_locs(struct module *mod, unsigned long *start, unsigned long *end) { struct ftrace_page *start_pg; struct ftrace_page *pg; struct dyn_ftrace *rec; unsigned long count; unsigned long *p; unsigned long addr; unsigned long flags = 0; /* Shut up gcc */ int ret = -ENOMEM; count = end - start; if (!count) return 0; sort(start, count, sizeof(*start), ftrace_cmp_ips, ftrace_swap_ips); start_pg = ftrace_allocate_pages(count); if (!start_pg) return -ENOMEM; mutex_lock(&ftrace_lock); /* * Core and each module needs their own pages, as * modules will free them when they are removed. * Force a new page to be allocated for modules. */ if (!mod) { WARN_ON(ftrace_pages || ftrace_pages_start); /* First initialization */ ftrace_pages = ftrace_pages_start = start_pg; } else { if (!ftrace_pages) goto out; if (WARN_ON(ftrace_pages->next)) { /* Hmm, we have free pages? */ while (ftrace_pages->next) ftrace_pages = ftrace_pages->next; } ftrace_pages->next = start_pg; } p = start; pg = start_pg; while (p < end) { addr = ftrace_call_adjust(*p++); /* * Some architecture linkers will pad between * the different mcount_loc sections of different * object files to satisfy alignments. * Skip any NULL pointers. */ if (!addr) continue; if (pg->index == pg->size) { /* We should have allocated enough */ if (WARN_ON(!pg->next)) break; pg = pg->next; } rec = &pg->records[pg->index++]; rec->ip = addr; } /* We should have used all pages */ WARN_ON(pg->next); /* Assign the last page to ftrace_pages */ ftrace_pages = pg; /* These new locations need to be initialized */ ftrace_new_pgs = start_pg; /* * We only need to disable interrupts on start up * because we are modifying code that an interrupt * may execute, and the modification is not atomic. * But for modules, nothing runs the code we modify * until we are finished with it, and there's no * reason to cause large interrupt latencies while we do it. */ if (!mod) local_irq_save(flags); ftrace_update_code(mod); if (!mod) local_irq_restore(flags); ret = 0; out: mutex_unlock(&ftrace_lock); return ret; }
C
linux
0
CVE-2017-9150
https://www.cvedetails.com/cve/CVE-2017-9150/
CWE-200
https://github.com/torvalds/linux/commit/0d0e57697f162da4aa218b5feafe614fb666db07
0d0e57697f162da4aa218b5feafe614fb666db07
bpf: don't let ldimm64 leak map addresses on unprivileged The patch fixes two things at once: 1) It checks the env->allow_ptr_leaks and only prints the map address to the log if we have the privileges to do so, otherwise it just dumps 0 as we would when kptr_restrict is enabled on %pK. Given the latter is off by default and not every distro sets it, I don't want to rely on this, hence the 0 by default for unprivileged. 2) Printing of ldimm64 in the verifier log is currently broken in that we don't print the full immediate, but only the 32 bit part of the first insn part for ldimm64. Thus, fix this up as well; it's okay to access, since we verified all ldimm64 earlier already (including just constants) through replace_map_fd_with_map_ptr(). Fixes: 1be7f75d1668 ("bpf: enable non-root eBPF programs") Fixes: cbd357008604 ("bpf: verifier (add ability to receive verification log)") Reported-by: Jann Horn <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env, int insn_idx, int prev_insn_idx) { struct bpf_verifier_stack_elem *elem; elem = kmalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL); if (!elem) goto err; memcpy(&elem->st, &env->cur_state, sizeof(env->cur_state)); elem->insn_idx = insn_idx; elem->prev_insn_idx = prev_insn_idx; elem->next = env->head; env->head = elem; env->stack_size++; if (env->stack_size > BPF_COMPLEXITY_LIMIT_STACK) { verbose("BPF program is too complex\n"); goto err; } return &elem->st; err: /* pop all elements and return */ while (pop_stack(env, NULL) >= 0); return NULL; }
static struct bpf_verifier_state *push_stack(struct bpf_verifier_env *env, int insn_idx, int prev_insn_idx) { struct bpf_verifier_stack_elem *elem; elem = kmalloc(sizeof(struct bpf_verifier_stack_elem), GFP_KERNEL); if (!elem) goto err; memcpy(&elem->st, &env->cur_state, sizeof(env->cur_state)); elem->insn_idx = insn_idx; elem->prev_insn_idx = prev_insn_idx; elem->next = env->head; env->head = elem; env->stack_size++; if (env->stack_size > BPF_COMPLEXITY_LIMIT_STACK) { verbose("BPF program is too complex\n"); goto err; } return &elem->st; err: /* pop all elements and return */ while (pop_stack(env, NULL) >= 0); return NULL; }
C
linux
0
CVE-2015-5252
https://www.cvedetails.com/cve/CVE-2015-5252/
CWE-264
https://git.samba.org/?p=samba.git;a=commit;h=4278ef25f64d5fdbf432ff1534e275416ec9561e
4278ef25f64d5fdbf432ff1534e275416ec9561e
null
char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn) { char *current_dir = NULL; char *result = NULL; DATA_BLOB cache_value; struct file_id key; struct smb_filename *smb_fname_dot = NULL; struct smb_filename *smb_fname_full = NULL; if (!lp_getwd_cache()) { goto nocache; } smb_fname_dot = synthetic_smb_fname(ctx, ".", NULL, NULL); if (smb_fname_dot == NULL) { errno = ENOMEM; goto out; } if (SMB_VFS_STAT(conn, smb_fname_dot) == -1) { /* * Known to fail for root: the directory may be NFS-mounted * and exported with root_squash (so has no root access). */ DEBUG(1,("vfs_GetWd: couldn't stat \".\" error %s " "(NFS problem ?)\n", strerror(errno) )); goto nocache; } key = vfs_file_id_from_sbuf(conn, &smb_fname_dot->st); if (!memcache_lookup(smbd_memcache(), GETWD_CACHE, data_blob_const(&key, sizeof(key)), &cache_value)) { goto nocache; } SMB_ASSERT((cache_value.length > 0) && (cache_value.data[cache_value.length-1] == '\0')); smb_fname_full = synthetic_smb_fname(ctx, (char *)cache_value.data, NULL, NULL); if (smb_fname_full == NULL) { errno = ENOMEM; goto out; } if ((SMB_VFS_STAT(conn, smb_fname_full) == 0) && (smb_fname_dot->st.st_ex_dev == smb_fname_full->st.st_ex_dev) && (smb_fname_dot->st.st_ex_ino == smb_fname_full->st.st_ex_ino) && (S_ISDIR(smb_fname_dot->st.st_ex_mode))) { /* * Ok, we're done */ result = talloc_strdup(ctx, smb_fname_full->base_name); if (result == NULL) { errno = ENOMEM; } goto out; } nocache: /* * We don't have the information to hand so rely on traditional * methods. The very slow getcwd, which spawns a process on some * systems, or the not quite so bad getwd. */ current_dir = SMB_VFS_GETWD(conn); if (current_dir == NULL) { DEBUG(0, ("vfs_GetWd: SMB_VFS_GETWD call failed: %s\n", strerror(errno))); goto out; } if (lp_getwd_cache() && VALID_STAT(smb_fname_dot->st)) { key = vfs_file_id_from_sbuf(conn, &smb_fname_dot->st); memcache_add(smbd_memcache(), GETWD_CACHE, data_blob_const(&key, sizeof(key)), data_blob_const(current_dir, strlen(current_dir)+1)); } result = talloc_strdup(ctx, current_dir); if (result == NULL) { errno = ENOMEM; } out: TALLOC_FREE(smb_fname_dot); TALLOC_FREE(smb_fname_full); SAFE_FREE(current_dir); return result; }
char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn) { char *current_dir = NULL; char *result = NULL; DATA_BLOB cache_value; struct file_id key; struct smb_filename *smb_fname_dot = NULL; struct smb_filename *smb_fname_full = NULL; if (!lp_getwd_cache()) { goto nocache; } smb_fname_dot = synthetic_smb_fname(ctx, ".", NULL, NULL); if (smb_fname_dot == NULL) { errno = ENOMEM; goto out; } if (SMB_VFS_STAT(conn, smb_fname_dot) == -1) { /* * Known to fail for root: the directory may be NFS-mounted * and exported with root_squash (so has no root access). */ DEBUG(1,("vfs_GetWd: couldn't stat \".\" error %s " "(NFS problem ?)\n", strerror(errno) )); goto nocache; } key = vfs_file_id_from_sbuf(conn, &smb_fname_dot->st); if (!memcache_lookup(smbd_memcache(), GETWD_CACHE, data_blob_const(&key, sizeof(key)), &cache_value)) { goto nocache; } SMB_ASSERT((cache_value.length > 0) && (cache_value.data[cache_value.length-1] == '\0')); smb_fname_full = synthetic_smb_fname(ctx, (char *)cache_value.data, NULL, NULL); if (smb_fname_full == NULL) { errno = ENOMEM; goto out; } if ((SMB_VFS_STAT(conn, smb_fname_full) == 0) && (smb_fname_dot->st.st_ex_dev == smb_fname_full->st.st_ex_dev) && (smb_fname_dot->st.st_ex_ino == smb_fname_full->st.st_ex_ino) && (S_ISDIR(smb_fname_dot->st.st_ex_mode))) { /* * Ok, we're done */ result = talloc_strdup(ctx, smb_fname_full->base_name); if (result == NULL) { errno = ENOMEM; } goto out; } nocache: /* * We don't have the information to hand so rely on traditional * methods. The very slow getcwd, which spawns a process on some * systems, or the not quite so bad getwd. */ current_dir = SMB_VFS_GETWD(conn); if (current_dir == NULL) { DEBUG(0, ("vfs_GetWd: SMB_VFS_GETWD call failed: %s\n", strerror(errno))); goto out; } if (lp_getwd_cache() && VALID_STAT(smb_fname_dot->st)) { key = vfs_file_id_from_sbuf(conn, &smb_fname_dot->st); memcache_add(smbd_memcache(), GETWD_CACHE, data_blob_const(&key, sizeof(key)), data_blob_const(current_dir, strlen(current_dir)+1)); } result = talloc_strdup(ctx, current_dir); if (result == NULL) { errno = ENOMEM; } out: TALLOC_FREE(smb_fname_dot); TALLOC_FREE(smb_fname_full); SAFE_FREE(current_dir); return result; }
C
samba
0
CVE-2013-1789
https://www.cvedetails.com/cve/CVE-2013-1789/
null
https://cgit.freedesktop.org/poppler/poppler/commit/?h=poppler-0.22&id=a9b8ab4657dec65b8b86c225d12c533ad7e984e2
a9b8ab4657dec65b8b86c225d12c533ad7e984e2
null
void Splash::pipeRunAABGR8(SplashPipe *pipe) { Guchar aSrc, aDest, alpha2, aResult; SplashColor cDest; Guchar cResult0, cResult1, cResult2; cDest[0] = pipe->destColorPtr[2]; cDest[1] = pipe->destColorPtr[1]; cDest[2] = pipe->destColorPtr[0]; aDest = *pipe->destAlphaPtr; aSrc = div255(pipe->aInput * pipe->shape); aResult = aSrc + aDest - div255(aSrc * aDest); alpha2 = aResult; if (alpha2 == 0) { cResult0 = 0; cResult1 = 0; cResult2 = 0; } else { cResult0 = state->rgbTransferR[(Guchar)(((alpha2 - aSrc) * cDest[0] + aSrc * pipe->cSrc[0]) / alpha2)]; cResult1 = state->rgbTransferG[(Guchar)(((alpha2 - aSrc) * cDest[1] + aSrc * pipe->cSrc[1]) / alpha2)]; cResult2 = state->rgbTransferB[(Guchar)(((alpha2 - aSrc) * cDest[2] + aSrc * pipe->cSrc[2]) / alpha2)]; } *pipe->destColorPtr++ = cResult2; *pipe->destColorPtr++ = cResult1; *pipe->destColorPtr++ = cResult0; *pipe->destAlphaPtr++ = aResult; ++pipe->x; }
void Splash::pipeRunAABGR8(SplashPipe *pipe) { Guchar aSrc, aDest, alpha2, aResult; SplashColor cDest; Guchar cResult0, cResult1, cResult2; cDest[0] = pipe->destColorPtr[2]; cDest[1] = pipe->destColorPtr[1]; cDest[2] = pipe->destColorPtr[0]; aDest = *pipe->destAlphaPtr; aSrc = div255(pipe->aInput * pipe->shape); aResult = aSrc + aDest - div255(aSrc * aDest); alpha2 = aResult; if (alpha2 == 0) { cResult0 = 0; cResult1 = 0; cResult2 = 0; } else { cResult0 = state->rgbTransferR[(Guchar)(((alpha2 - aSrc) * cDest[0] + aSrc * pipe->cSrc[0]) / alpha2)]; cResult1 = state->rgbTransferG[(Guchar)(((alpha2 - aSrc) * cDest[1] + aSrc * pipe->cSrc[1]) / alpha2)]; cResult2 = state->rgbTransferB[(Guchar)(((alpha2 - aSrc) * cDest[2] + aSrc * pipe->cSrc[2]) / alpha2)]; } *pipe->destColorPtr++ = cResult2; *pipe->destColorPtr++ = cResult1; *pipe->destColorPtr++ = cResult0; *pipe->destAlphaPtr++ = aResult; ++pipe->x; }
CPP
poppler
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}
std::string DownloadItemImpl::GetRemoteAddress() const { return request_info_.remote_address; }
std::string DownloadItemImpl::GetRemoteAddress() const { return request_info_.remote_address; }
C
Chrome
0
CVE-2016-1621
https://www.cvedetails.com/cve/CVE-2016-1621/
CWE-119
https://android.googlesource.com/platform/external/libvpx/+/5a9753fca56f0eeb9f61e342b2fccffc364f9426
5a9753fca56f0eeb9f61e342b2fccffc364f9426
Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull from upstream Current HEAD: 7105df53d7dc13d5e575bc8df714ec8d1da36b06 BUG=23452792 Change-Id: Ic78176fc369e0bacc71d423e0e2e6075d004aaec
virtual void SetUp() { pred_fn_ = GetParam(); SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 2); }
virtual void SetUp() { pred_fn_ = GetParam(); SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 2); }
C
Android
0
CVE-2015-3215
https://www.cvedetails.com/cve/CVE-2015-3215/
CWE-20
https://github.com/YanVugenfirer/kvm-guest-drivers-windows/commit/fbfa4d1083ea84c5429992ca3e996d7d4fbc8238
fbfa4d1083ea84c5429992ca3e996d7d4fbc8238
NetKVM: BZ#1169718: More rigoruous testing of incoming packet Signed-off-by: Joseph Hindin <[email protected]>
void ParaNdis_ResetOffloadSettings(PARANDIS_ADAPTER *pContext, tOffloadSettingsFlags *pDest, PULONG from) { if (!pDest) pDest = &pContext->Offload.flags; if (!from) from = &pContext->Offload.flagsValue; pDest->fTxIPChecksum = !!(*from & osbT4IpChecksum); pDest->fTxTCPChecksum = !!(*from & osbT4TcpChecksum); pDest->fTxUDPChecksum = !!(*from & osbT4UdpChecksum); pDest->fTxTCPOptions = !!(*from & osbT4TcpOptionsChecksum); pDest->fTxIPOptions = !!(*from & osbT4IpOptionsChecksum); pDest->fTxLso = !!(*from & osbT4Lso); pDest->fTxLsoIP = !!(*from & osbT4LsoIp); pDest->fTxLsoTCP = !!(*from & osbT4LsoTcp); pDest->fRxIPChecksum = !!(*from & osbT4RxIPChecksum); pDest->fRxIPOptions = !!(*from & osbT4RxIPOptionsChecksum); pDest->fRxTCPChecksum = !!(*from & osbT4RxTCPChecksum); pDest->fRxTCPOptions = !!(*from & osbT4RxTCPOptionsChecksum); pDest->fRxUDPChecksum = !!(*from & osbT4RxUDPChecksum); pDest->fTxTCPv6Checksum = !!(*from & osbT6TcpChecksum); pDest->fTxTCPv6Options = !!(*from & osbT6TcpOptionsChecksum); pDest->fTxUDPv6Checksum = !!(*from & osbT6UdpChecksum); pDest->fTxIPv6Ext = !!(*from & osbT6IpExtChecksum); pDest->fTxLsov6 = !!(*from & osbT6Lso); pDest->fTxLsov6IP = !!(*from & osbT6LsoIpExt); pDest->fTxLsov6TCP = !!(*from & osbT6LsoTcpOptions); pDest->fRxTCPv6Checksum = !!(*from & osbT6RxTCPChecksum); pDest->fRxTCPv6Options = !!(*from & osbT6RxTCPOptionsChecksum); pDest->fRxUDPv6Checksum = !!(*from & osbT6RxUDPChecksum); pDest->fRxIPv6Ext = !!(*from & osbT6RxIpExtChecksum); }
void ParaNdis_ResetOffloadSettings(PARANDIS_ADAPTER *pContext, tOffloadSettingsFlags *pDest, PULONG from) { if (!pDest) pDest = &pContext->Offload.flags; if (!from) from = &pContext->Offload.flagsValue; pDest->fTxIPChecksum = !!(*from & osbT4IpChecksum); pDest->fTxTCPChecksum = !!(*from & osbT4TcpChecksum); pDest->fTxUDPChecksum = !!(*from & osbT4UdpChecksum); pDest->fTxTCPOptions = !!(*from & osbT4TcpOptionsChecksum); pDest->fTxIPOptions = !!(*from & osbT4IpOptionsChecksum); pDest->fTxLso = !!(*from & osbT4Lso); pDest->fTxLsoIP = !!(*from & osbT4LsoIp); pDest->fTxLsoTCP = !!(*from & osbT4LsoTcp); pDest->fRxIPChecksum = !!(*from & osbT4RxIPChecksum); pDest->fRxIPOptions = !!(*from & osbT4RxIPOptionsChecksum); pDest->fRxTCPChecksum = !!(*from & osbT4RxTCPChecksum); pDest->fRxTCPOptions = !!(*from & osbT4RxTCPOptionsChecksum); pDest->fRxUDPChecksum = !!(*from & osbT4RxUDPChecksum); pDest->fTxTCPv6Checksum = !!(*from & osbT6TcpChecksum); pDest->fTxTCPv6Options = !!(*from & osbT6TcpOptionsChecksum); pDest->fTxUDPv6Checksum = !!(*from & osbT6UdpChecksum); pDest->fTxIPv6Ext = !!(*from & osbT6IpExtChecksum); pDest->fTxLsov6 = !!(*from & osbT6Lso); pDest->fTxLsov6IP = !!(*from & osbT6LsoIpExt); pDest->fTxLsov6TCP = !!(*from & osbT6LsoTcpOptions); pDest->fRxTCPv6Checksum = !!(*from & osbT6RxTCPChecksum); pDest->fRxTCPv6Options = !!(*from & osbT6RxTCPOptionsChecksum); pDest->fRxUDPv6Checksum = !!(*from & osbT6RxUDPChecksum); pDest->fRxIPv6Ext = !!(*from & osbT6RxIpExtChecksum); }
C
kvm-guest-drivers-windows
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 void notify_cmos_timer(void) { if (!no_sync_cmos_clock) mod_timer(&sync_cmos_timer, jiffies + 1); }
static void notify_cmos_timer(void) { if (!no_sync_cmos_clock) mod_timer(&sync_cmos_timer, jiffies + 1); }
C
linux
0
CVE-2011-2803
https://www.cvedetails.com/cve/CVE-2011-2803/
CWE-119
https://github.com/chromium/chromium/commit/48f2ec5c24570c9b96bb2798a9ffe956117c5066
48f2ec5c24570c9b96bb2798a9ffe956117c5066
Add OVERRIDE to ui::TreeModelObserver overridden methods. BUG=None TEST=None [email protected] Review URL: http://codereview.chromium.org/7046093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88827 0039d316-1c4b-4281-b951-d872f2087c98
HIMAGELIST TreeView::CreateImageList() { std::vector<SkBitmap> model_images; model_->GetIcons(&model_images); bool rtl = base::i18n::IsRTL(); SkBitmap* closed_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( (rtl ? IDR_FOLDER_CLOSED_RTL : IDR_FOLDER_CLOSED)); SkBitmap* opened_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( (rtl ? IDR_FOLDER_OPEN_RTL : IDR_FOLDER_OPEN)); int width = closed_icon->width(); int height = closed_icon->height(); DCHECK(opened_icon->width() == width && opened_icon->height() == height); HIMAGELIST image_list = ImageList_Create(width, height, ILC_COLOR32, model_images.size() + 2, model_images.size() + 2); if (image_list) { HICON h_closed_icon = IconUtil::CreateHICONFromSkBitmap(*closed_icon); HICON h_opened_icon = IconUtil::CreateHICONFromSkBitmap(*opened_icon); ImageList_AddIcon(image_list, h_closed_icon); ImageList_AddIcon(image_list, h_opened_icon); DestroyIcon(h_closed_icon); DestroyIcon(h_opened_icon); for (size_t i = 0; i < model_images.size(); ++i) { HICON model_icon; if (model_images[i].width() != width || model_images[i].height() != height) { gfx::CanvasSkia canvas(width, height, false); canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); int height_offset = (height - model_images[i].height()) / 2; int width_offset = (width - model_images[i].width()) / 2; canvas.DrawBitmapInt(model_images[i], width_offset, height_offset); model_icon = IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap()); } else { model_icon = IconUtil::CreateHICONFromSkBitmap(model_images[i]); } ImageList_AddIcon(image_list, model_icon); DestroyIcon(model_icon); } } return image_list; }
HIMAGELIST TreeView::CreateImageList() { std::vector<SkBitmap> model_images; model_->GetIcons(&model_images); bool rtl = base::i18n::IsRTL(); SkBitmap* closed_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( (rtl ? IDR_FOLDER_CLOSED_RTL : IDR_FOLDER_CLOSED)); SkBitmap* opened_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( (rtl ? IDR_FOLDER_OPEN_RTL : IDR_FOLDER_OPEN)); int width = closed_icon->width(); int height = closed_icon->height(); DCHECK(opened_icon->width() == width && opened_icon->height() == height); HIMAGELIST image_list = ImageList_Create(width, height, ILC_COLOR32, model_images.size() + 2, model_images.size() + 2); if (image_list) { HICON h_closed_icon = IconUtil::CreateHICONFromSkBitmap(*closed_icon); HICON h_opened_icon = IconUtil::CreateHICONFromSkBitmap(*opened_icon); ImageList_AddIcon(image_list, h_closed_icon); ImageList_AddIcon(image_list, h_opened_icon); DestroyIcon(h_closed_icon); DestroyIcon(h_opened_icon); for (size_t i = 0; i < model_images.size(); ++i) { HICON model_icon; if (model_images[i].width() != width || model_images[i].height() != height) { gfx::CanvasSkia canvas(width, height, false); canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); int height_offset = (height - model_images[i].height()) / 2; int width_offset = (width - model_images[i].width()) / 2; canvas.DrawBitmapInt(model_images[i], width_offset, height_offset); model_icon = IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap()); } else { model_icon = IconUtil::CreateHICONFromSkBitmap(model_images[i]); } ImageList_AddIcon(image_list, model_icon); DestroyIcon(model_icon); } } return image_list; }
C
Chrome
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.
static int print_file(sc_card_t *in_card, const sc_file_t *file, const sc_path_t *path, int depth) { int r; const char *tmps; for (r = 0; r < depth; r++) printf(" "); printf("%s ", sc_print_path(path)); if (file->namelen) { printf("["); util_print_binary(stdout, file->name, file->namelen); printf("] "); } switch (file->type) { case SC_FILE_TYPE_WORKING_EF: tmps = "wEF"; break; case SC_FILE_TYPE_INTERNAL_EF: tmps = "iEF"; break; case SC_FILE_TYPE_DF: tmps = "DF"; break; default: tmps = "unknown"; break; } printf("type: %s, ", tmps); if (file->type != SC_FILE_TYPE_DF) { const id2str_t ef_type_name[] = { { SC_FILE_EF_TRANSPARENT, "transparent" }, { SC_FILE_EF_LINEAR_FIXED, "linear-fixed" }, { SC_FILE_EF_LINEAR_FIXED_TLV, "linear-fixed (TLV)" }, { SC_FILE_EF_LINEAR_VARIABLE, "linear-variable" }, { SC_FILE_EF_LINEAR_VARIABLE_TLV, "linear-variable (TLV)" }, { SC_FILE_EF_CYCLIC, "cyclic" }, { SC_FILE_EF_CYCLIC_TLV, "cyclic (TLV)" }, { 0, NULL } }; const char *ef_type = "unknown"; for (r = 0; ef_type_name[r].str != NULL; r++) if (file->ef_structure == ef_type_name[r].id) ef_type = ef_type_name[r].str; printf("ef structure: %s, ", ef_type); } printf("size: %lu\n", (unsigned long) file->size); for (r = 0; r < depth; r++) printf(" "); if (file->type == SC_FILE_TYPE_DF) { const id2str_t ac_ops_df[] = { { SC_AC_OP_SELECT, "select" }, { SC_AC_OP_LOCK, "lock" }, { SC_AC_OP_DELETE, "delete" }, { SC_AC_OP_CREATE, "create" }, { SC_AC_OP_REHABILITATE, "rehab" }, { SC_AC_OP_INVALIDATE, "inval" }, { SC_AC_OP_LIST_FILES, "list" }, { 0, NULL } }; for (r = 0; ac_ops_df[r].str != NULL; r++) printf("%s[%s] ", ac_ops_df[r].str, util_acl_to_str(sc_file_get_acl_entry(file, ac_ops_df[r].id))); } else { const id2str_t ac_ops_ef[] = { { SC_AC_OP_READ, "read" }, { SC_AC_OP_UPDATE, "update" }, { SC_AC_OP_ERASE, "erase" }, { SC_AC_OP_WRITE, "write" }, { SC_AC_OP_REHABILITATE, "rehab" }, { SC_AC_OP_INVALIDATE, "inval" }, { 0, NULL } }; for (r = 0; ac_ops_ef[r].str != NULL; r++) printf("%s[%s] ", ac_ops_ef[r].str, util_acl_to_str(sc_file_get_acl_entry(file, ac_ops_ef[r].id))); } if (file->sec_attr_len) { printf("sec: "); /* Octets are as follows: * DF: select, lock, delete, create, rehab, inval * EF: read, update, write, erase, rehab, inval * 4 MSB's of the octet mean: * 0 = ALW, 1 = PIN1, 2 = PIN2, 4 = SYS, * 15 = NEV */ util_hex_dump(stdout, file->sec_attr, file->sec_attr_len, ":"); } if (file->prop_attr_len) { printf("\n"); for (r = 0; r < depth; r++) printf(" "); printf("prop: "); util_hex_dump(stdout, file->prop_attr, file->prop_attr_len, ":"); } printf("\n\n"); if (file->type == SC_FILE_TYPE_DF) return 0; if (file->ef_structure == SC_FILE_EF_TRANSPARENT) { unsigned char *buf; if (!(buf = malloc(file->size))) { fprintf(stderr, "out of memory"); return 1; } r = sc_lock(card); if (r == SC_SUCCESS) r = sc_read_binary(in_card, 0, buf, file->size, 0); sc_unlock(card); if (r > 0) util_hex_dump_asc(stdout, buf, r, 0); free(buf); } else { unsigned char buf[256]; int i; for (i=0; i < file->record_count; i++) { printf("Record %d\n", i); r = sc_lock(card); if (r == SC_SUCCESS) r = sc_read_record(in_card, i, buf, 256, 0); sc_unlock(card); if (r > 0) util_hex_dump_asc(stdout, buf, r, 0); } } return 0; }
static int print_file(sc_card_t *in_card, const sc_file_t *file, const sc_path_t *path, int depth) { int r; const char *tmps; for (r = 0; r < depth; r++) printf(" "); printf("%s ", sc_print_path(path)); if (file->namelen) { printf("["); util_print_binary(stdout, file->name, file->namelen); printf("] "); } switch (file->type) { case SC_FILE_TYPE_WORKING_EF: tmps = "wEF"; break; case SC_FILE_TYPE_INTERNAL_EF: tmps = "iEF"; break; case SC_FILE_TYPE_DF: tmps = "DF"; break; default: tmps = "unknown"; break; } printf("type: %s, ", tmps); if (file->type != SC_FILE_TYPE_DF) { const id2str_t ef_type_name[] = { { SC_FILE_EF_TRANSPARENT, "transparent" }, { SC_FILE_EF_LINEAR_FIXED, "linear-fixed" }, { SC_FILE_EF_LINEAR_FIXED_TLV, "linear-fixed (TLV)" }, { SC_FILE_EF_LINEAR_VARIABLE, "linear-variable" }, { SC_FILE_EF_LINEAR_VARIABLE_TLV, "linear-variable (TLV)" }, { SC_FILE_EF_CYCLIC, "cyclic" }, { SC_FILE_EF_CYCLIC_TLV, "cyclic (TLV)" }, { 0, NULL } }; const char *ef_type = "unknown"; for (r = 0; ef_type_name[r].str != NULL; r++) if (file->ef_structure == ef_type_name[r].id) ef_type = ef_type_name[r].str; printf("ef structure: %s, ", ef_type); } printf("size: %lu\n", (unsigned long) file->size); for (r = 0; r < depth; r++) printf(" "); if (file->type == SC_FILE_TYPE_DF) { const id2str_t ac_ops_df[] = { { SC_AC_OP_SELECT, "select" }, { SC_AC_OP_LOCK, "lock" }, { SC_AC_OP_DELETE, "delete" }, { SC_AC_OP_CREATE, "create" }, { SC_AC_OP_REHABILITATE, "rehab" }, { SC_AC_OP_INVALIDATE, "inval" }, { SC_AC_OP_LIST_FILES, "list" }, { 0, NULL } }; for (r = 0; ac_ops_df[r].str != NULL; r++) printf("%s[%s] ", ac_ops_df[r].str, util_acl_to_str(sc_file_get_acl_entry(file, ac_ops_df[r].id))); } else { const id2str_t ac_ops_ef[] = { { SC_AC_OP_READ, "read" }, { SC_AC_OP_UPDATE, "update" }, { SC_AC_OP_ERASE, "erase" }, { SC_AC_OP_WRITE, "write" }, { SC_AC_OP_REHABILITATE, "rehab" }, { SC_AC_OP_INVALIDATE, "inval" }, { 0, NULL } }; for (r = 0; ac_ops_ef[r].str != NULL; r++) printf("%s[%s] ", ac_ops_ef[r].str, util_acl_to_str(sc_file_get_acl_entry(file, ac_ops_ef[r].id))); } if (file->sec_attr_len) { printf("sec: "); /* Octets are as follows: * DF: select, lock, delete, create, rehab, inval * EF: read, update, write, erase, rehab, inval * 4 MSB's of the octet mean: * 0 = ALW, 1 = PIN1, 2 = PIN2, 4 = SYS, * 15 = NEV */ util_hex_dump(stdout, file->sec_attr, file->sec_attr_len, ":"); } if (file->prop_attr_len) { printf("\n"); for (r = 0; r < depth; r++) printf(" "); printf("prop: "); util_hex_dump(stdout, file->prop_attr, file->prop_attr_len, ":"); } printf("\n\n"); if (file->type == SC_FILE_TYPE_DF) return 0; if (file->ef_structure == SC_FILE_EF_TRANSPARENT) { unsigned char *buf; if (!(buf = malloc(file->size))) { fprintf(stderr, "out of memory"); return 1; } r = sc_lock(card); if (r == SC_SUCCESS) r = sc_read_binary(in_card, 0, buf, file->size, 0); sc_unlock(card); if (r > 0) util_hex_dump_asc(stdout, buf, r, 0); free(buf); } else { unsigned char buf[256]; int i; for (i=0; i < file->record_count; i++) { printf("Record %d\n", i); r = sc_lock(card); if (r == SC_SUCCESS) r = sc_read_record(in_card, i, buf, 256, 0); sc_unlock(card); if (r > 0) util_hex_dump_asc(stdout, buf, r, 0); } } return 0; }
C
OpenSC
0
CVE-2017-8067
https://www.cvedetails.com/cve/CVE-2017-8067/
CWE-119
https://github.com/torvalds/linux/commit/c4baad50297d84bde1a7ad45e50c73adae4a2192
c4baad50297d84bde1a7ad45e50c73adae4a2192
virtio-console: avoid DMA from stack put_chars() stuffs the buffer it gets into an sg, but that buffer may be on the stack. This breaks with CONFIG_VMAP_STACK=y (for me, it manifested as printks getting turned into NUL bytes). Signed-off-by: Omar Sandoval <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Amit Shah <[email protected]>
static bool port_has_data(struct port *port) { unsigned long flags; bool ret; ret = false; spin_lock_irqsave(&port->inbuf_lock, flags); port->inbuf = get_inbuf(port); if (port->inbuf) ret = true; spin_unlock_irqrestore(&port->inbuf_lock, flags); return ret; }
static bool port_has_data(struct port *port) { unsigned long flags; bool ret; ret = false; spin_lock_irqsave(&port->inbuf_lock, flags); port->inbuf = get_inbuf(port); if (port->inbuf) ret = true; spin_unlock_irqrestore(&port->inbuf_lock, flags); return ret; }
C
linux
0
CVE-2019-14763
https://www.cvedetails.com/cve/CVE-2019-14763/
CWE-189
https://github.com/torvalds/linux/commit/c91815b596245fd7da349ecc43c8def670d2269e
c91815b596245fd7da349ecc43c8def670d2269e
usb: dwc3: gadget: never call ->complete() from ->ep_queue() This is a requirement which has always existed but, somehow, wasn't reflected in the documentation and problems weren't found until now when Tuba Yavuz found a possible deadlock happening between dwc3 and f_hid. She described the situation as follows: spin_lock_irqsave(&hidg->write_spinlock, flags); // first acquire /* we our function has been disabled by host */ if (!hidg->req) { free_ep_req(hidg->in_ep, hidg->req); goto try_again; } [...] status = usb_ep_queue(hidg->in_ep, hidg->req, GFP_ATOMIC); => [...] => usb_gadget_giveback_request => f_hidg_req_complete => spin_lock_irqsave(&hidg->write_spinlock, flags); // second acquire Note that this happens because dwc3 would call ->complete() on a failed usb_ep_queue() due to failed Start Transfer command. This is, anyway, a theoretical situation because dwc3 currently uses "No Response Update Transfer" command for Bulk and Interrupt endpoints. It's still good to make this case impossible to happen even if the "No Reponse Update Transfer" command is changed. Reported-by: Tuba Yavuz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static void dwc3_gadget_suspend_interrupt(struct dwc3 *dwc, unsigned int evtinfo) { enum dwc3_link_state next = evtinfo & DWC3_LINK_STATE_MASK; if (dwc->link_state != next && next == DWC3_LINK_STATE_U3) dwc3_suspend_gadget(dwc); dwc->link_state = next; }
static void dwc3_gadget_suspend_interrupt(struct dwc3 *dwc, unsigned int evtinfo) { enum dwc3_link_state next = evtinfo & DWC3_LINK_STATE_MASK; if (dwc->link_state != next && next == DWC3_LINK_STATE_U3) dwc3_suspend_gadget(dwc); dwc->link_state = next; }
C
linux
0
CVE-2011-3106
https://www.cvedetails.com/cve/CVE-2011-3106/
CWE-119
https://github.com/chromium/chromium/commit/5385c44d9634d00b1cec2abf0fe7290d4205c7b0
5385c44d9634d00b1cec2abf0fe7290d4205c7b0
Inherits SupportsWeakPtr<T> instead of having WeakPtrFactory<T> This change refines r137676. BUG=122654 TEST=browser_test Review URL: https://chromiumcodereview.appspot.com/10332233 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139771 0039d316-1c4b-4281-b951-d872f2087c98
void SSLErrorHandler::DenyRequest() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( &SSLErrorHandler::CompleteCancelRequest, this, net::ERR_INSECURE_RESPONSE)); }
void SSLErrorHandler::DenyRequest() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind( &SSLErrorHandler::CompleteCancelRequest, this, net::ERR_INSECURE_RESPONSE)); }
C
Chrome
0
CVE-2015-4645
https://www.cvedetails.com/cve/CVE-2015-4645/
CWE-190
https://github.com/plougher/squashfs-tools/commit/f95864afe8833fe3ad782d714b41378e860977b1
f95864afe8833fe3ad782d714b41378e860977b1
unsquashfs-4: Add more sanity checks + fix CVE-2015-4645/6 Add more filesystem table sanity checks to Unsquashfs-4 and also properly fix CVE-2015-4645 and CVE-2015-4646. The CVEs were raised due to Unsquashfs having variable oveflow and stack overflow in a number of vulnerable functions. The suggested patch only "fixed" one such function and fixed it badly, and so it was buggy and introduced extra bugs! The suggested patch was not only buggy, but, it used the essentially wrong approach too. It was "fixing" the symptom but not the cause. The symptom is wrong values causing overflow, the cause is filesystem corruption. This corruption should be detected and the filesystem rejected *before* trying to allocate memory. This patch applies the following fixes: 1. The filesystem super-block tables are checked, and the values must match across the filesystem. This will trap corrupted filesystems created by Mksquashfs. 2. The maximum (theorectical) size the filesystem tables could grow to, were analysed, and some variables were increased from int to long long. This analysis has been added as comments. 3. Stack allocation was removed, and a shared buffer (which is checked and increased as necessary) is used to read the table indexes. Signed-off-by: Phillip Lougher <[email protected]>
void cache_block_put(struct cache_entry *entry) { /* * finished with this cache entry, once the usage count reaches zero it * can be reused and is put onto the free list. As it remains * accessible via the hash table it can be found getting a new lease of * life before it is reused. */ pthread_mutex_lock(&entry->cache->mutex); entry->used --; if(entry->used == 0) { insert_free_list(entry->cache, entry); entry->cache->used --; /* * if the wait_free flag is set, one or more threads may be * waiting on this buffer */ if(entry->cache->wait_free) { entry->cache->wait_free = FALSE; pthread_cond_broadcast(&entry->cache->wait_for_free); } } pthread_mutex_unlock(&entry->cache->mutex); }
void cache_block_put(struct cache_entry *entry) { /* * finished with this cache entry, once the usage count reaches zero it * can be reused and is put onto the free list. As it remains * accessible via the hash table it can be found getting a new lease of * life before it is reused. */ pthread_mutex_lock(&entry->cache->mutex); entry->used --; if(entry->used == 0) { insert_free_list(entry->cache, entry); entry->cache->used --; /* * if the wait_free flag is set, one or more threads may be * waiting on this buffer */ if(entry->cache->wait_free) { entry->cache->wait_free = FALSE; pthread_cond_broadcast(&entry->cache->wait_for_free); } } pthread_mutex_unlock(&entry->cache->mutex); }
C
squashfs-tools
0
CVE-2016-10197
https://www.cvedetails.com/cve/CVE-2016-10197/
CWE-125
https://github.com/libevent/libevent/commit/ec65c42052d95d2c23d1d837136d1cf1d9ecef9e
ec65c42052d95d2c23d1d837136d1cf1d9ecef9e
evdns: fix searching empty hostnames From #332: Here follows a bug report by **Guido Vranken** via the _Tor bug bounty program_. Please credit Guido accordingly. ## Bug report The DNS code of Libevent contains this rather obvious OOB read: ```c static char * search_make_new(const struct search_state *const state, int n, const char *const base_name) { const size_t base_len = strlen(base_name); const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1; ``` If the length of ```base_name``` is 0, then line 3125 reads 1 byte before the buffer. This will trigger a crash on ASAN-protected builds. To reproduce: Build libevent with ASAN: ``` $ CFLAGS='-fomit-frame-pointer -fsanitize=address' ./configure && make -j4 ``` Put the attached ```resolv.conf``` and ```poc.c``` in the source directory and then do: ``` $ gcc -fsanitize=address -fomit-frame-pointer poc.c .libs/libevent.a $ ./a.out ================================================================= ==22201== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60060000efdf at pc 0x4429da bp 0x7ffe1ed47300 sp 0x7ffe1ed472f8 READ of size 1 at 0x60060000efdf thread T0 ``` P.S. we can add a check earlier, but since this is very uncommon, I didn't add it. Fixes: #332
evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void)) { }
evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void)) { }
C
libevent
0
CVE-2013-0904
https://www.cvedetails.com/cve/CVE-2013-0904/
CWE-119
https://github.com/chromium/chromium/commit/b2b21468c1f7f08b30a7c1755316f6026c50eb2a
b2b21468c1f7f08b30a7c1755316f6026c50eb2a
Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout implies StyleDifferenceRepaint). This causes unnecessary repaints in some cases on layout change. Convert StyleDifference to a structure containing relatively independent flags. This change doesn't directly improve the result, but can make further repaint optimizations possible. Step 1 doesn't change any functionality. RenderStyle still generate the legacy StyleDifference enum when comparing styles and convert the result to the new StyleDifference. Implicit requirements are not handled during the conversion. Converted call sites to use the new StyleDifference according to the following conversion rules: - diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange() - diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly() - diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout() - diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout() - diff > StyleDifferenceRepaintLayer => diff.needsLayout() - diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly() - diff == StyleDifferenceLayout => diff.needsFullLayout() BUG=358460 TEST=All existing layout tests. [email protected], [email protected], [email protected] Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171983 Review URL: https://codereview.chromium.org/236203020 git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool RenderBlockFlow::containsFloat(RenderBox* renderer) const { return m_floatingObjects && m_floatingObjects->set().contains<FloatingObjectHashTranslator>(renderer); }
bool RenderBlockFlow::containsFloat(RenderBox* renderer) const { return m_floatingObjects && m_floatingObjects->set().contains<FloatingObjectHashTranslator>(renderer); }
C
Chrome
0
CVE-2013-2879
https://www.cvedetails.com/cve/CVE-2013-2879/
CWE-200
https://github.com/chromium/chromium/commit/afbc71b7a78ac99810a6b22b2b0a2e85dde18794
afbc71b7a78ac99810a6b22b2b0a2e85dde18794
Display confirmation dialog for untrusted signins BUG=252062 Review URL: https://chromiumcodereview.appspot.com/17482002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208520 0039d316-1c4b-4281-b951-d872f2087c98
OneClickSigninSyncStarter::SigninDialogDelegate::SigninDialogDelegate( base::WeakPtr<OneClickSigninSyncStarter> sync_starter) : sync_starter_(sync_starter) { }
OneClickSigninSyncStarter::SigninDialogDelegate::SigninDialogDelegate( base::WeakPtr<OneClickSigninSyncStarter> sync_starter) : sync_starter_(sync_starter) { }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/74c1ec481b33194dc7a428f2d58fc89640b313ae
74c1ec481b33194dc7a428f2d58fc89640b313ae
Fix glGetFramebufferAttachmentParameteriv so it returns current names for buffers. TEST=unit_tests and conformance tests BUG=none Review URL: http://codereview.chromium.org/3135003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55831 0039d316-1c4b-4281-b951-d872f2087c98
error::Error GLES2DecoderImpl::ShaderSourceHelper( GLuint client_id, const char* data, uint32 data_size) { ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( client_id, "glShaderSource"); if (!info) { return error::kNoError; } info->Update(std::string(data, data + data_size)); return error::kNoError; }
error::Error GLES2DecoderImpl::ShaderSourceHelper( GLuint client_id, const char* data, uint32 data_size) { ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( client_id, "glShaderSource"); if (!info) { return error::kNoError; } info->Update(std::string(data, data + data_size)); return error::kNoError; }
C
Chrome
0
CVE-2018-11593
https://www.cvedetails.com/cve/CVE-2018-11593/
CWE-787
https://github.com/espruino/Espruino/commit/bed844f109b6c222816740555068de2e101e8018
bed844f109b6c222816740555068de2e101e8018
remove strncpy usage as it's effectively useless, replace with an assertion since fn is only used internally (fix #1426)
void jslTokenAsString(int token, char *str, size_t len) { assert(len>28); // size of largest string if (token>32 && token<128) { assert(len>=4); str[0] = '\''; str[1] = (char)token; str[2] = '\''; str[3] = 0; return; } switch (token) { case LEX_EOF : strcpy(str, "EOF"); return; case LEX_ID : strcpy(str, "ID"); return; case LEX_INT : strcpy(str, "INT"); return; case LEX_FLOAT : strcpy(str, "FLOAT"); return; case LEX_STR : strcpy(str, "STRING"); return; case LEX_UNFINISHED_STR : strcpy(str, "UNFINISHED STRING"); return; case LEX_TEMPLATE_LITERAL : strcpy(str, "TEMPLATE LITERAL"); return; case LEX_UNFINISHED_TEMPLATE_LITERAL : strcpy(str, "UNFINISHED TEMPLATE LITERAL"); return; case LEX_REGEX : strcpy(str, "REGEX"); return; case LEX_UNFINISHED_REGEX : strcpy(str, "UNFINISHED REGEX"); return; case LEX_UNFINISHED_COMMENT : strcpy(str, "UNFINISHED COMMENT"); return; } if (token>=_LEX_OPERATOR_START && token<_LEX_R_LIST_END) { const char tokenNames[] = /* LEX_EQUAL : */ "==\0" /* LEX_TYPEEQUAL : */ "===\0" /* LEX_NEQUAL : */ "!=\0" /* LEX_NTYPEEQUAL : */ "!==\0" /* LEX_LEQUAL : */ "<=\0" /* LEX_LSHIFT : */ "<<\0" /* LEX_LSHIFTEQUAL : */ "<<=\0" /* LEX_GEQUAL : */ ">=\0" /* LEX_RSHIFT : */ ">>\0" /* LEX_RSHIFTUNSIGNED */ ">>>\0" /* LEX_RSHIFTEQUAL : */ ">>=\0" /* LEX_RSHIFTUNSIGNEDEQUAL */ ">>>=\0" /* LEX_PLUSEQUAL : */ "+=\0" /* LEX_MINUSEQUAL : */ "-=\0" /* LEX_PLUSPLUS : */ "++\0" /* LEX_MINUSMINUS */ "--\0" /* LEX_MULEQUAL : */ "*=\0" /* LEX_DIVEQUAL : */ "/=\0" /* LEX_MODEQUAL : */ "%=\0" /* LEX_ANDEQUAL : */ "&=\0" /* LEX_ANDAND : */ "&&\0" /* LEX_OREQUAL : */ "|=\0" /* LEX_OROR : */ "||\0" /* LEX_XOREQUAL : */ "^=\0" /* LEX_ARROW_FUNCTION */ "=>\0" /*LEX_R_IF : */ "if\0" /*LEX_R_ELSE : */ "else\0" /*LEX_R_DO : */ "do\0" /*LEX_R_WHILE : */ "while\0" /*LEX_R_FOR : */ "for\0" /*LEX_R_BREAK : */ "return\0" /*LEX_R_CONTINUE */ "continue\0" /*LEX_R_FUNCTION */ "function\0" /*LEX_R_RETURN */ "return\0" /*LEX_R_VAR : */ "var\0" /*LEX_R_LET : */ "let\0" /*LEX_R_CONST : */ "const\0" /*LEX_R_THIS : */ "this\0" /*LEX_R_THROW : */ "throw\0" /*LEX_R_TRY : */ "try\0" /*LEX_R_CATCH : */ "catch\0" /*LEX_R_FINALLY : */ "finally\0" /*LEX_R_TRUE : */ "true\0" /*LEX_R_FALSE : */ "false\0" /*LEX_R_NULL : */ "null\0" /*LEX_R_UNDEFINED */ "undefined\0" /*LEX_R_NEW : */ "new\0" /*LEX_R_IN : */ "in\0" /*LEX_R_INSTANCEOF */ "instanceof\0" /*LEX_R_SWITCH */ "switch\0" /*LEX_R_CASE */ "case\0" /*LEX_R_DEFAULT */ "default\0" /*LEX_R_DELETE */ "delete\0" /*LEX_R_TYPEOF : */ "typeof\0" /*LEX_R_VOID : */ "void\0" /*LEX_R_DEBUGGER : */ "debugger\0" /*LEX_R_CLASS : */ "class\0" /*LEX_R_EXTENDS : */ "extends\0" /*LEX_R_SUPER : */ "super\0" /*LEX_R_STATIC : */ "static\0" ; unsigned int p = 0; int n = token-_LEX_OPERATOR_START; while (n>0 && p<sizeof(tokenNames)) { while (tokenNames[p] && p<sizeof(tokenNames)) p++; p++; // skip the zero n--; // next token } assert(n==0); strcpy(str, &tokenNames[p]); return; } espruino_snprintf(str, len, "?[%d]", token); }
void jslTokenAsString(int token, char *str, size_t len) { if (token>32 && token<128) { assert(len>=4); str[0] = '\''; str[1] = (char)token; str[2] = '\''; str[3] = 0; return; } switch (token) { case LEX_EOF : strncpy(str, "EOF", len); return; case LEX_ID : strncpy(str, "ID", len); return; case LEX_INT : strncpy(str, "INT", len); return; case LEX_FLOAT : strncpy(str, "FLOAT", len); return; case LEX_STR : strncpy(str, "STRING", len); return; case LEX_UNFINISHED_STR : strncpy(str, "UNFINISHED STRING", len); return; case LEX_TEMPLATE_LITERAL : strncpy(str, "TEMPLATE LITERAL", len); return; case LEX_UNFINISHED_TEMPLATE_LITERAL : strncpy(str, "UNFINISHED TEMPLATE LITERAL", len); return; case LEX_REGEX : strncpy(str, "REGEX", len); return; case LEX_UNFINISHED_REGEX : strncpy(str, "UNFINISHED REGEX", len); return; case LEX_UNFINISHED_COMMENT : strncpy(str, "UNFINISHED COMMENT", len); return; } if (token>=_LEX_OPERATOR_START && token<_LEX_R_LIST_END) { const char tokenNames[] = /* LEX_EQUAL : */ "==\0" /* LEX_TYPEEQUAL : */ "===\0" /* LEX_NEQUAL : */ "!=\0" /* LEX_NTYPEEQUAL : */ "!==\0" /* LEX_LEQUAL : */ "<=\0" /* LEX_LSHIFT : */ "<<\0" /* LEX_LSHIFTEQUAL : */ "<<=\0" /* LEX_GEQUAL : */ ">=\0" /* LEX_RSHIFT : */ ">>\0" /* LEX_RSHIFTUNSIGNED */ ">>>\0" /* LEX_RSHIFTEQUAL : */ ">>=\0" /* LEX_RSHIFTUNSIGNEDEQUAL */ ">>>=\0" /* LEX_PLUSEQUAL : */ "+=\0" /* LEX_MINUSEQUAL : */ "-=\0" /* LEX_PLUSPLUS : */ "++\0" /* LEX_MINUSMINUS */ "--\0" /* LEX_MULEQUAL : */ "*=\0" /* LEX_DIVEQUAL : */ "/=\0" /* LEX_MODEQUAL : */ "%=\0" /* LEX_ANDEQUAL : */ "&=\0" /* LEX_ANDAND : */ "&&\0" /* LEX_OREQUAL : */ "|=\0" /* LEX_OROR : */ "||\0" /* LEX_XOREQUAL : */ "^=\0" /* LEX_ARROW_FUNCTION */ "=>\0" /*LEX_R_IF : */ "if\0" /*LEX_R_ELSE : */ "else\0" /*LEX_R_DO : */ "do\0" /*LEX_R_WHILE : */ "while\0" /*LEX_R_FOR : */ "for\0" /*LEX_R_BREAK : */ "return\0" /*LEX_R_CONTINUE */ "continue\0" /*LEX_R_FUNCTION */ "function\0" /*LEX_R_RETURN */ "return\0" /*LEX_R_VAR : */ "var\0" /*LEX_R_LET : */ "let\0" /*LEX_R_CONST : */ "const\0" /*LEX_R_THIS : */ "this\0" /*LEX_R_THROW : */ "throw\0" /*LEX_R_TRY : */ "try\0" /*LEX_R_CATCH : */ "catch\0" /*LEX_R_FINALLY : */ "finally\0" /*LEX_R_TRUE : */ "true\0" /*LEX_R_FALSE : */ "false\0" /*LEX_R_NULL : */ "null\0" /*LEX_R_UNDEFINED */ "undefined\0" /*LEX_R_NEW : */ "new\0" /*LEX_R_IN : */ "in\0" /*LEX_R_INSTANCEOF */ "instanceof\0" /*LEX_R_SWITCH */ "switch\0" /*LEX_R_CASE */ "case\0" /*LEX_R_DEFAULT */ "default\0" /*LEX_R_DELETE */ "delete\0" /*LEX_R_TYPEOF : */ "typeof\0" /*LEX_R_VOID : */ "void\0" /*LEX_R_DEBUGGER : */ "debugger\0" /*LEX_R_CLASS : */ "class\0" /*LEX_R_EXTENDS : */ "extends\0" /*LEX_R_SUPER : */ "super\0" /*LEX_R_STATIC : */ "static\0" ; unsigned int p = 0; int n = token-_LEX_OPERATOR_START; while (n>0 && p<sizeof(tokenNames)) { while (tokenNames[p] && p<sizeof(tokenNames)) p++; p++; // skip the zero n--; // next token } assert(n==0); strncpy(str, &tokenNames[p], len); return; } assert(len>=10); espruino_snprintf(str, len, "?[%d]", token); }
C
Espruino
1
CVE-2015-4116
https://www.cvedetails.com/cve/CVE-2015-4116/
null
https://git.php.net/?p=php-src.git;a=commit;h=1cbd25ca15383394ffa9ee8601c5de4c0f2f90e1
1cbd25ca15383394ffa9ee8601c5de4c0f2f90e1
null
zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ { spl_heap_it *iterator; spl_heap_object *heap_object = (spl_heap_object*)zend_object_store_get_object(object TSRMLS_CC); if (by_ref) { zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC); return NULL; } Z_ADDREF_P(object); iterator = emalloc(sizeof(spl_heap_it)); iterator->intern.it.data = (void*)object; iterator->intern.it.funcs = &spl_heap_it_funcs; iterator->intern.ce = ce; iterator->intern.value = NULL; iterator->flags = heap_object->flags; iterator->object = heap_object; return (zend_object_iterator*)iterator; } /* }}} */
zend_object_iterator *spl_heap_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ { spl_heap_it *iterator; spl_heap_object *heap_object = (spl_heap_object*)zend_object_store_get_object(object TSRMLS_CC); if (by_ref) { zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by reference", 0 TSRMLS_CC); return NULL; } Z_ADDREF_P(object); iterator = emalloc(sizeof(spl_heap_it)); iterator->intern.it.data = (void*)object; iterator->intern.it.funcs = &spl_heap_it_funcs; iterator->intern.ce = ce; iterator->intern.value = NULL; iterator->flags = heap_object->flags; iterator->object = heap_object; return (zend_object_iterator*)iterator; } /* }}} */
C
php
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
static void send_metamsg_rsp (UINT8 rc_handle, UINT8 label, tBTA_AV_CODE code, tAVRC_RESPONSE *pmetamsg_resp) { UINT8 ctype; if (!pmetamsg_resp) { BTIF_TRACE_WARNING("%s: Invalid response received from application", __FUNCTION__); return; } BTIF_TRACE_EVENT("+%s: rc_handle: %d, label: %d, code: 0x%02x, pdu: %s", __FUNCTION__, rc_handle, label, code, dump_rc_pdu(pmetamsg_resp->rsp.pdu)); if (pmetamsg_resp->rsp.status != AVRC_STS_NO_ERROR) { ctype = AVRC_RSP_REJ; } else { if ( code < AVRC_RSP_NOT_IMPL) { if (code == AVRC_CMD_NOTIF) { ctype = AVRC_RSP_INTERIM; } else if (code == AVRC_CMD_STATUS) { ctype = AVRC_RSP_IMPL_STBL; } else { ctype = AVRC_RSP_ACCEPT; } } else { ctype = code; } } /* if response is for register_notification, make sure the rc has actually registered for this */ if((pmetamsg_resp->rsp.pdu == AVRC_PDU_REGISTER_NOTIFICATION) && (code == AVRC_RSP_CHANGED)) { BOOLEAN bSent = FALSE; UINT8 event_id = pmetamsg_resp->reg_notif.event_id; BOOLEAN bNotify = (btif_rc_cb.rc_connected) && (btif_rc_cb.rc_notif[event_id-1].bNotify); /* de-register this notification for a CHANGED response */ btif_rc_cb.rc_notif[event_id-1].bNotify = FALSE; BTIF_TRACE_DEBUG("%s rc_handle: %d. event_id: 0x%02d bNotify:%u", __FUNCTION__, btif_rc_cb.rc_handle, event_id, bNotify); if (bNotify) { BT_HDR *p_msg = NULL; tAVRC_STS status; if (AVRC_STS_NO_ERROR == (status = AVRC_BldResponse(btif_rc_cb.rc_handle, pmetamsg_resp, &p_msg)) ) { BTIF_TRACE_DEBUG("%s Sending notification to rc_handle: %d. event_id: 0x%02d", __FUNCTION__, btif_rc_cb.rc_handle, event_id); bSent = TRUE; BTA_AvMetaRsp(btif_rc_cb.rc_handle, btif_rc_cb.rc_notif[event_id-1].label, ctype, p_msg); } else { BTIF_TRACE_WARNING("%s failed to build metamsg response. status: 0x%02x", __FUNCTION__, status); } } if (!bSent) { BTIF_TRACE_DEBUG("%s: Notification not sent, as there are no RC connections or the \ CT has not subscribed for event_id: %s", __FUNCTION__, dump_rc_notification_event_id(event_id)); } } else { /* All other commands go here */ BT_HDR *p_msg = NULL; tAVRC_STS status; status = AVRC_BldResponse(rc_handle, pmetamsg_resp, &p_msg); if (status == AVRC_STS_NO_ERROR) { BTA_AvMetaRsp(rc_handle, label, ctype, p_msg); } else { BTIF_TRACE_ERROR("%s: failed to build metamsg response. status: 0x%02x", __FUNCTION__, status); } } }
static void send_metamsg_rsp (UINT8 rc_handle, UINT8 label, tBTA_AV_CODE code, tAVRC_RESPONSE *pmetamsg_resp) { UINT8 ctype; if (!pmetamsg_resp) { BTIF_TRACE_WARNING("%s: Invalid response received from application", __FUNCTION__); return; } BTIF_TRACE_EVENT("+%s: rc_handle: %d, label: %d, code: 0x%02x, pdu: %s", __FUNCTION__, rc_handle, label, code, dump_rc_pdu(pmetamsg_resp->rsp.pdu)); if (pmetamsg_resp->rsp.status != AVRC_STS_NO_ERROR) { ctype = AVRC_RSP_REJ; } else { if ( code < AVRC_RSP_NOT_IMPL) { if (code == AVRC_CMD_NOTIF) { ctype = AVRC_RSP_INTERIM; } else if (code == AVRC_CMD_STATUS) { ctype = AVRC_RSP_IMPL_STBL; } else { ctype = AVRC_RSP_ACCEPT; } } else { ctype = code; } } /* if response is for register_notification, make sure the rc has actually registered for this */ if((pmetamsg_resp->rsp.pdu == AVRC_PDU_REGISTER_NOTIFICATION) && (code == AVRC_RSP_CHANGED)) { BOOLEAN bSent = FALSE; UINT8 event_id = pmetamsg_resp->reg_notif.event_id; BOOLEAN bNotify = (btif_rc_cb.rc_connected) && (btif_rc_cb.rc_notif[event_id-1].bNotify); /* de-register this notification for a CHANGED response */ btif_rc_cb.rc_notif[event_id-1].bNotify = FALSE; BTIF_TRACE_DEBUG("%s rc_handle: %d. event_id: 0x%02d bNotify:%u", __FUNCTION__, btif_rc_cb.rc_handle, event_id, bNotify); if (bNotify) { BT_HDR *p_msg = NULL; tAVRC_STS status; if (AVRC_STS_NO_ERROR == (status = AVRC_BldResponse(btif_rc_cb.rc_handle, pmetamsg_resp, &p_msg)) ) { BTIF_TRACE_DEBUG("%s Sending notification to rc_handle: %d. event_id: 0x%02d", __FUNCTION__, btif_rc_cb.rc_handle, event_id); bSent = TRUE; BTA_AvMetaRsp(btif_rc_cb.rc_handle, btif_rc_cb.rc_notif[event_id-1].label, ctype, p_msg); } else { BTIF_TRACE_WARNING("%s failed to build metamsg response. status: 0x%02x", __FUNCTION__, status); } } if (!bSent) { BTIF_TRACE_DEBUG("%s: Notification not sent, as there are no RC connections or the \ CT has not subscribed for event_id: %s", __FUNCTION__, dump_rc_notification_event_id(event_id)); } } else { /* All other commands go here */ BT_HDR *p_msg = NULL; tAVRC_STS status; status = AVRC_BldResponse(rc_handle, pmetamsg_resp, &p_msg); if (status == AVRC_STS_NO_ERROR) { BTA_AvMetaRsp(rc_handle, label, ctype, p_msg); } else { BTIF_TRACE_ERROR("%s: failed to build metamsg response. status: 0x%02x", __FUNCTION__, status); } } }
C
Android
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
const GLubyte* GLES2Implementation::GetStringi(GLenum name, GLuint index) { GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetStringi(" << GLES2Util::GetStringStringType(name) << "," << index << ")"); TRACE_EVENT0("gpu", "GLES2::GetStringi"); UpdateCachedExtensionsIfNeeded(); if (name != GL_EXTENSIONS) { SetGLError(GL_INVALID_ENUM, "glGetStringi", "name"); return nullptr; } if (index >= cached_extensions_.size()) { SetGLError(GL_INVALID_VALUE, "glGetStringi", "index too large"); return nullptr; } const char* result = cached_extensions_[index]; GPU_CLIENT_LOG(" returned " << result); CheckGLError(); return reinterpret_cast<const GLubyte*>(result); }
const GLubyte* GLES2Implementation::GetStringi(GLenum name, GLuint index) { GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGetStringi(" << GLES2Util::GetStringStringType(name) << "," << index << ")"); TRACE_EVENT0("gpu", "GLES2::GetStringi"); UpdateCachedExtensionsIfNeeded(); if (name != GL_EXTENSIONS) { SetGLError(GL_INVALID_ENUM, "glGetStringi", "name"); return nullptr; } if (index >= cached_extensions_.size()) { SetGLError(GL_INVALID_VALUE, "glGetStringi", "index too large"); return nullptr; } const char* result = cached_extensions_[index]; GPU_CLIENT_LOG(" returned " << result); CheckGLError(); return reinterpret_cast<const GLubyte*>(result); }
C
Chrome
0
CVE-2015-4644
https://www.cvedetails.com/cve/CVE-2015-4644/
null
https://git.php.net/?p=php-src.git;a=commit;h=2cc4e69cc6d8dbc4b3568ad3dd583324a7c11d64
2cc4e69cc6d8dbc4b3568ad3dd583324a7c11d64
null
PHP_FUNCTION(pg_put_line) { char *query; zval *pgsql_link = NULL; int query_len, id = -1; PGconn *pgsql; int result = 0, argc = ZEND_NUM_ARGS(); if (argc == 1) { if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) { return; } id = PGG(default_link); CHECK_DEFAULT_LINK(id); } else { if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) { return; } } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); result = PQputline(pgsql, query); if (result==EOF) { PHP_PQ_ERROR("Query failed: %s", pgsql); RETURN_FALSE; } RETURN_TRUE; }
PHP_FUNCTION(pg_put_line) { char *query; zval *pgsql_link = NULL; int query_len, id = -1; PGconn *pgsql; int result = 0, argc = ZEND_NUM_ARGS(); if (argc == 1) { if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) { return; } id = PGG(default_link); CHECK_DEFAULT_LINK(id); } else { if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) { return; } } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); result = PQputline(pgsql, query); if (result==EOF) { PHP_PQ_ERROR("Query failed: %s", pgsql); RETURN_FALSE; } RETURN_TRUE; }
C
php
0
CVE-2016-3156
https://www.cvedetails.com/cve/CVE-2016-3156/
CWE-399
https://github.com/torvalds/linux/commit/fbd40ea0180a2d328c5adc61414dc8bab9335ce2
fbd40ea0180a2d328c5adc61414dc8bab9335ce2
ipv4: Don't do expensive useless work during inetdev destroy. When an inetdev is destroyed, every address assigned to the interface is removed. And in this scenerio we do two pointless things which can be very expensive if the number of assigned interfaces is large: 1) Address promotion. We are deleting all addresses, so there is no point in doing this. 2) A full nf conntrack table purge for every address. We only need to do this once, as is already caught by the existing masq_dev_notifier so masq_inet_event() can skip this. Reported-by: Solar Designer <[email protected]> Signed-off-by: David S. Miller <[email protected]> Tested-by: Cyrill Gorcunov <[email protected]>
static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa) { u32 hash = inet_addr_hash(net, ifa->ifa_local); ASSERT_RTNL(); hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]); }
static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa) { u32 hash = inet_addr_hash(net, ifa->ifa_local); ASSERT_RTNL(); hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]); }
C
linux
0
CVE-2017-18232
https://www.cvedetails.com/cve/CVE-2017-18232/
null
https://github.com/torvalds/linux/commit/0558f33c06bb910e2879e355192227a8e8f0219d
0558f33c06bb910e2879e355192227a8e8f0219d
scsi: libsas: direct call probe and destruct In commit 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery competing with ata error handling") introduced disco mutex to prevent rediscovery competing with ata error handling and put the whole revalidation in the mutex. But the rphy add/remove needs to wait for the error handling which also grabs the disco mutex. This may leads to dead lock.So the probe and destruct event were introduce to do the rphy add/remove asynchronously and out of the lock. The asynchronously processed workers makes the whole discovery process not atomic, the other events may interrupt the process. For example, if a loss of signal event inserted before the probe event, the sas_deform_port() is called and the port will be deleted. And sas_port_delete() may run before the destruct event, but the port-x:x is the top parent of end device or expander. This leads to a kernel WARNING such as: [ 82.042979] sysfs group 'power' not found for kobject 'phy-1:0:22' [ 82.042983] ------------[ cut here ]------------ [ 82.042986] WARNING: CPU: 54 PID: 1714 at fs/sysfs/group.c:237 sysfs_remove_group+0x94/0xa0 [ 82.043059] Call trace: [ 82.043082] [<ffff0000082e7624>] sysfs_remove_group+0x94/0xa0 [ 82.043085] [<ffff00000864e320>] dpm_sysfs_remove+0x60/0x70 [ 82.043086] [<ffff00000863ee10>] device_del+0x138/0x308 [ 82.043089] [<ffff00000869a2d0>] sas_phy_delete+0x38/0x60 [ 82.043091] [<ffff00000869a86c>] do_sas_phy_delete+0x6c/0x80 [ 82.043093] [<ffff00000863dc20>] device_for_each_child+0x58/0xa0 [ 82.043095] [<ffff000008696f80>] sas_remove_children+0x40/0x50 [ 82.043100] [<ffff00000869d1bc>] sas_destruct_devices+0x64/0xa0 [ 82.043102] [<ffff0000080e93bc>] process_one_work+0x1fc/0x4b0 [ 82.043104] [<ffff0000080e96c0>] worker_thread+0x50/0x490 [ 82.043105] [<ffff0000080f0364>] kthread+0xfc/0x128 [ 82.043107] [<ffff0000080836c0>] ret_from_fork+0x10/0x50 Make probe and destruct a direct call in the disco and revalidate function, but put them outside the lock. The whole discovery or revalidate won't be interrupted by other events. And the DISCE_PROBE and DISCE_DESTRUCT event are deleted as a result of the direct call. Introduce a new list to destruct the sas_port and put the port delete after the destruct. This makes sure the right order of destroying the sysfs kobject and fix the warning above. In sas_ex_revalidate_domain() have a loop to find all broadcasted device, and sometimes we have a chance to find the same expander twice. Because the sas_port will be deleted at the end of the whole revalidate process, sas_port with the same name cannot be added before this. Otherwise the sysfs will complain of creating duplicate filename. Since the LLDD will send broadcast for every device change, we can only process one expander's revalidation. [mkp: kbuild test robot warning] Signed-off-by: Jason Yan <[email protected]> CC: John Garry <[email protected]> CC: Johannes Thumshirn <[email protected]> CC: Ewan Milne <[email protected]> CC: Christoph Hellwig <[email protected]> CC: Tomas Henzl <[email protected]> CC: Dan Williams <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev) { if (!test_bit(SAS_DEV_DESTROY, &dev->state) && !list_empty(&dev->disco_list_node)) { /* this rphy never saw sas_rphy_add */ list_del_init(&dev->disco_list_node); sas_rphy_free(dev->rphy); sas_unregister_common_dev(port, dev); return; } if (!test_and_set_bit(SAS_DEV_DESTROY, &dev->state)) { sas_rphy_unlink(dev->rphy); list_move_tail(&dev->disco_list_node, &port->destroy_list); } }
void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev) { if (!test_bit(SAS_DEV_DESTROY, &dev->state) && !list_empty(&dev->disco_list_node)) { /* this rphy never saw sas_rphy_add */ list_del_init(&dev->disco_list_node); sas_rphy_free(dev->rphy); sas_unregister_common_dev(port, dev); return; } if (!test_and_set_bit(SAS_DEV_DESTROY, &dev->state)) { sas_rphy_unlink(dev->rphy); list_move_tail(&dev->disco_list_node, &port->destroy_list); sas_discover_event(dev->port, DISCE_DESTRUCT); } }
C
linux
1
CVE-2017-9374
https://www.cvedetails.com/cve/CVE-2017-9374/
CWE-772
https://git.qemu.org/?p=qemu.git;a=commit;h=d710e1e7bd3d5bfc26b631f02ae87901ebe646b0
d710e1e7bd3d5bfc26b631f02ae87901ebe646b0
null
static bool ehci_verify_qtd(EHCIPacket *p, EHCIqtd *qtd) { if (p->qtdaddr != p->queue->qtdaddr || (p->queue->async && !NLPTR_TBIT(p->qtd.next) && (p->qtd.next != qtd->next)) || (!NLPTR_TBIT(p->qtd.altnext) && (p->qtd.altnext != qtd->altnext)) || p->qtd.token != qtd->token || p->qtd.bufptr[0] != qtd->bufptr[0]) { return false; } else { return true; } }
static bool ehci_verify_qtd(EHCIPacket *p, EHCIqtd *qtd) { if (p->qtdaddr != p->queue->qtdaddr || (p->queue->async && !NLPTR_TBIT(p->qtd.next) && (p->qtd.next != qtd->next)) || (!NLPTR_TBIT(p->qtd.altnext) && (p->qtd.altnext != qtd->altnext)) || p->qtd.token != qtd->token || p->qtd.bufptr[0] != qtd->bufptr[0]) { return false; } else { return true; } }
C
qemu
0
CVE-2017-6210
https://www.cvedetails.com/cve/CVE-2017-6210/
CWE-476
https://cgit.freedesktop.org/virglrenderer/commit/?id=0a5dff15912207b83018485f83e067474e818bab
0a5dff15912207b83018485f83e067474e818bab
null
static int vrend_decode_bind_shader(struct vrend_decode_ctx *ctx, int length) { uint32_t handle, type; if (length != VIRGL_BIND_SHADER_SIZE) return EINVAL; handle = get_buf_entry(ctx, VIRGL_BIND_SHADER_HANDLE); type = get_buf_entry(ctx, VIRGL_BIND_SHADER_TYPE); vrend_bind_shader(ctx->grctx, handle, type); return 0; }
static int vrend_decode_bind_shader(struct vrend_decode_ctx *ctx, int length) { uint32_t handle, type; if (length != VIRGL_BIND_SHADER_SIZE) return EINVAL; handle = get_buf_entry(ctx, VIRGL_BIND_SHADER_HANDLE); type = get_buf_entry(ctx, VIRGL_BIND_SHADER_TYPE); vrend_bind_shader(ctx->grctx, handle, type); return 0; }
C
virglrenderer
0
CVE-2017-13686
https://www.cvedetails.com/cve/CVE-2017-13686/
CWE-476
https://github.com/torvalds/linux/commit/bc3aae2bbac46dd894c89db5d5e98f7f0ef9e205
bc3aae2bbac46dd894c89db5d5e98f7f0ef9e205
net: check and errout if res->fi is NULL when RTM_F_FIB_MATCH is set Syzkaller hit 'general protection fault in fib_dump_info' bug on commit 4.13-rc5.. Guilty file: net/ipv4/fib_semantics.c kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN Modules linked in: CPU: 0 PID: 2808 Comm: syz-executor0 Not tainted 4.13.0-rc5 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 task: ffff880078562700 task.stack: ffff880078110000 RIP: 0010:fib_dump_info+0x388/0x1170 net/ipv4/fib_semantics.c:1314 RSP: 0018:ffff880078117010 EFLAGS: 00010206 RAX: dffffc0000000000 RBX: 00000000000000fe RCX: 0000000000000002 RDX: 0000000000000006 RSI: ffff880078117084 RDI: 0000000000000030 RBP: ffff880078117268 R08: 000000000000000c R09: ffff8800780d80c8 R10: 0000000058d629b4 R11: 0000000067fce681 R12: 0000000000000000 R13: ffff8800784bd540 R14: ffff8800780d80b5 R15: ffff8800780d80a4 FS: 00000000022fa940(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000004387d0 CR3: 0000000079135000 CR4: 00000000000006f0 Call Trace: inet_rtm_getroute+0xc89/0x1f50 net/ipv4/route.c:2766 rtnetlink_rcv_msg+0x288/0x680 net/core/rtnetlink.c:4217 netlink_rcv_skb+0x340/0x470 net/netlink/af_netlink.c:2397 rtnetlink_rcv+0x28/0x30 net/core/rtnetlink.c:4223 netlink_unicast_kernel net/netlink/af_netlink.c:1265 [inline] netlink_unicast+0x4c4/0x6e0 net/netlink/af_netlink.c:1291 netlink_sendmsg+0x8c4/0xca0 net/netlink/af_netlink.c:1854 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xca/0x110 net/socket.c:643 ___sys_sendmsg+0x779/0x8d0 net/socket.c:2035 __sys_sendmsg+0xd1/0x170 net/socket.c:2069 SYSC_sendmsg net/socket.c:2080 [inline] SyS_sendmsg+0x2d/0x50 net/socket.c:2076 entry_SYSCALL_64_fastpath+0x1a/0xa5 RIP: 0033:0x4512e9 RSP: 002b:00007ffc75584cc8 EFLAGS: 00000216 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00000000004512e9 RDX: 0000000000000000 RSI: 0000000020f2cfc8 RDI: 0000000000000003 RBP: 000000000000000e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000216 R12: fffffffffffffffe R13: 0000000000718000 R14: 0000000020c44ff0 R15: 0000000000000000 Code: 00 0f b6 8d ec fd ff ff 48 8b 85 f0 fd ff ff 88 48 17 48 8b 45 28 48 8d 78 30 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e cb 0c 00 00 48 8b 45 28 44 RIP: fib_dump_info+0x388/0x1170 net/ipv4/fib_semantics.c:1314 RSP: ffff880078117010 ---[ end trace 254a7af28348f88b ]--- This patch adds a res->fi NULL check. example run: $ip route get 0.0.0.0 iif virt1-0 broadcast 0.0.0.0 dev lo cache <local,brd> iif virt1-0 $ip route get 0.0.0.0 iif virt1-0 fibmatch RTNETLINK answers: No route to host Reported-by: idaifish <[email protected]> Reported-by: Dmitry Vyukov <[email protected]> Fixes: b61798130f1b ("net: ipv4: RTM_GETROUTE: return matched fib result when requested") Signed-off-by: Roopa Prabhu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static void build_skb_flow_key(struct flowi4 *fl4, const struct sk_buff *skb, const struct sock *sk) { const struct net *net = dev_net(skb->dev); const struct iphdr *iph = ip_hdr(skb); int oif = skb->dev->ifindex; u8 tos = RT_TOS(iph->tos); u8 prot = iph->protocol; u32 mark = skb->mark; __build_flow_key(net, fl4, sk, iph, oif, tos, prot, mark, 0); }
static void build_skb_flow_key(struct flowi4 *fl4, const struct sk_buff *skb, const struct sock *sk) { const struct net *net = dev_net(skb->dev); const struct iphdr *iph = ip_hdr(skb); int oif = skb->dev->ifindex; u8 tos = RT_TOS(iph->tos); u8 prot = iph->protocol; u32 mark = skb->mark; __build_flow_key(net, fl4, sk, iph, oif, tos, prot, mark, 0); }
C
linux
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 toggle_eb_comment(void) { /* The page doesn't exist with report-only option */ if (pages[PAGENO_EDIT_COMMENT].page_widget == NULL) return; bool good = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_comment)) >= 10 || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_cb_no_comment)); /* Allow next page only when the comment has at least 10 chars */ gtk_widget_set_sensitive(g_btn_next, good); /* And show the eventbox with label */ if (good) gtk_widget_hide(GTK_WIDGET(g_eb_comment)); else gtk_widget_show(GTK_WIDGET(g_eb_comment)); }
static void toggle_eb_comment(void) { /* The page doesn't exist with report-only option */ if (pages[PAGENO_EDIT_COMMENT].page_widget == NULL) return; bool good = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_comment)) >= 10 || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_cb_no_comment)); /* Allow next page only when the comment has at least 10 chars */ gtk_widget_set_sensitive(g_btn_next, good); /* And show the eventbox with label */ if (good) gtk_widget_hide(GTK_WIDGET(g_eb_comment)); else gtk_widget_show(GTK_WIDGET(g_eb_comment)); }
C
libreport
0
CVE-2012-2890
https://www.cvedetails.com/cve/CVE-2012-2890/
CWE-399
https://github.com/chromium/chromium/commit/a6f7726de20450074a01493e4e85409ce3f2595a
a6f7726de20450074a01493e4e85409ce3f2595a
Unreviewed, rolling out r147402. http://trac.webkit.org/changeset/147402 https://bugs.webkit.org/show_bug.cgi?id=112903 Source/WebCore: * dom/Document.cpp: (WebCore::Document::processHttpEquiv): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): LayoutTests: * http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html: * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html: * http/tests/security/XFrameOptions/x-frame-options-deny.html: * http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny.html: * http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt: * http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: * platform/chromium/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt: git-svn-id: svn://svn.chromium.org/blink/trunk@147450 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void Document::addListenerTypeIfNeeded(const AtomicString& eventType) { if (eventType == eventNames().DOMSubtreeModifiedEvent) addMutationEventListenerTypeIfEnabled(DOMSUBTREEMODIFIED_LISTENER); else if (eventType == eventNames().DOMNodeInsertedEvent) addMutationEventListenerTypeIfEnabled(DOMNODEINSERTED_LISTENER); else if (eventType == eventNames().DOMNodeRemovedEvent) addMutationEventListenerTypeIfEnabled(DOMNODEREMOVED_LISTENER); else if (eventType == eventNames().DOMNodeRemovedFromDocumentEvent) addMutationEventListenerTypeIfEnabled(DOMNODEREMOVEDFROMDOCUMENT_LISTENER); else if (eventType == eventNames().DOMNodeInsertedIntoDocumentEvent) addMutationEventListenerTypeIfEnabled(DOMNODEINSERTEDINTODOCUMENT_LISTENER); else if (eventType == eventNames().DOMCharacterDataModifiedEvent) addMutationEventListenerTypeIfEnabled(DOMCHARACTERDATAMODIFIED_LISTENER); else if (eventType == eventNames().overflowchangedEvent) addListenerType(OVERFLOWCHANGED_LISTENER); else if (eventType == eventNames().webkitAnimationStartEvent) addListenerType(ANIMATIONSTART_LISTENER); else if (eventType == eventNames().webkitAnimationEndEvent) addListenerType(ANIMATIONEND_LISTENER); else if (eventType == eventNames().webkitAnimationIterationEvent) addListenerType(ANIMATIONITERATION_LISTENER); else if (eventType == eventNames().webkitTransitionEndEvent || eventType == eventNames().transitionendEvent) addListenerType(TRANSITIONEND_LISTENER); else if (eventType == eventNames().beforeloadEvent) addListenerType(BEFORELOAD_LISTENER); else if (eventType == eventNames().scrollEvent) addListenerType(SCROLL_LISTENER); }
void Document::addListenerTypeIfNeeded(const AtomicString& eventType) { if (eventType == eventNames().DOMSubtreeModifiedEvent) addMutationEventListenerTypeIfEnabled(DOMSUBTREEMODIFIED_LISTENER); else if (eventType == eventNames().DOMNodeInsertedEvent) addMutationEventListenerTypeIfEnabled(DOMNODEINSERTED_LISTENER); else if (eventType == eventNames().DOMNodeRemovedEvent) addMutationEventListenerTypeIfEnabled(DOMNODEREMOVED_LISTENER); else if (eventType == eventNames().DOMNodeRemovedFromDocumentEvent) addMutationEventListenerTypeIfEnabled(DOMNODEREMOVEDFROMDOCUMENT_LISTENER); else if (eventType == eventNames().DOMNodeInsertedIntoDocumentEvent) addMutationEventListenerTypeIfEnabled(DOMNODEINSERTEDINTODOCUMENT_LISTENER); else if (eventType == eventNames().DOMCharacterDataModifiedEvent) addMutationEventListenerTypeIfEnabled(DOMCHARACTERDATAMODIFIED_LISTENER); else if (eventType == eventNames().overflowchangedEvent) addListenerType(OVERFLOWCHANGED_LISTENER); else if (eventType == eventNames().webkitAnimationStartEvent) addListenerType(ANIMATIONSTART_LISTENER); else if (eventType == eventNames().webkitAnimationEndEvent) addListenerType(ANIMATIONEND_LISTENER); else if (eventType == eventNames().webkitAnimationIterationEvent) addListenerType(ANIMATIONITERATION_LISTENER); else if (eventType == eventNames().webkitTransitionEndEvent || eventType == eventNames().transitionendEvent) addListenerType(TRANSITIONEND_LISTENER); else if (eventType == eventNames().beforeloadEvent) addListenerType(BEFORELOAD_LISTENER); else if (eventType == eventNames().scrollEvent) addListenerType(SCROLL_LISTENER); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/2bcaf4649c1d495072967ea454e8c16dce044705
2bcaf4649c1d495072967ea454e8c16dce044705
Don't interpret embeded NULLs in a response header line as a line terminator. BUG=95992 Review URL: http://codereview.chromium.org/7796025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100863 0039d316-1c4b-4281-b951-d872f2087c98
std::vector<int> GetAllHttpResponseCodes() { std::vector<int> codes; codes.reserve( HISTOGRAM_MAX_HTTP_RESPONSE_CODE - HISTOGRAM_MIN_HTTP_RESPONSE_CODE + 2); codes.push_back(0); for (int i = HISTOGRAM_MIN_HTTP_RESPONSE_CODE; i <= HISTOGRAM_MAX_HTTP_RESPONSE_CODE; ++i) codes.push_back(i); return codes; }
std::vector<int> GetAllHttpResponseCodes() { std::vector<int> codes; codes.reserve( HISTOGRAM_MAX_HTTP_RESPONSE_CODE - HISTOGRAM_MIN_HTTP_RESPONSE_CODE + 2); codes.push_back(0); for (int i = HISTOGRAM_MIN_HTTP_RESPONSE_CODE; i <= HISTOGRAM_MAX_HTTP_RESPONSE_CODE; ++i) codes.push_back(i); return codes; }
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_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, int num_text) { int i; png_debug1(1, "in %s storage function", ((png_ptr == NULL || png_ptr->chunk_name[0] == '\0') ? "text" : (png_const_charp)png_ptr->chunk_name)); if (png_ptr == NULL || info_ptr == NULL || num_text == 0) return(0); /* Make sure we have enough space in the "text" array in info_struct * to hold all of the incoming text_ptr objects. */ if (info_ptr->num_text + num_text > info_ptr->max_text) { int old_max_text = info_ptr->max_text; int old_num_text = info_ptr->num_text; if (info_ptr->text != NULL) { png_textp old_text; info_ptr->max_text = info_ptr->num_text + num_text + 8; old_text = info_ptr->text; info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) { /* Restore to previous condition */ info_ptr->max_text = old_max_text; info_ptr->text = old_text; return(1); } png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max_text * png_sizeof(png_text))); png_free(png_ptr, old_text); } else { info_ptr->max_text = num_text + 8; info_ptr->num_text = 0; info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) { /* Restore to previous condition */ info_ptr->num_text = old_num_text; info_ptr->max_text = old_max_text; return(1); } #ifdef PNG_FREE_ME_SUPPORTED info_ptr->free_me |= PNG_FREE_TEXT; #endif } png_debug1(3, "allocated %d entries for info_ptr->text", info_ptr->max_text); } for (i = 0; i < num_text; i++) { png_size_t text_length, key_len; png_size_t lang_len, lang_key_len; png_textp textp = &(info_ptr->text[info_ptr->num_text]); if (text_ptr[i].key == NULL) continue; key_len = png_strlen(text_ptr[i].key); if (text_ptr[i].compression <= 0) { lang_len = 0; lang_key_len = 0; } else #ifdef PNG_iTXt_SUPPORTED { /* Set iTXt data */ if (text_ptr[i].lang != NULL) lang_len = png_strlen(text_ptr[i].lang); else lang_len = 0; if (text_ptr[i].lang_key != NULL) lang_key_len = png_strlen(text_ptr[i].lang_key); else lang_key_len = 0; } #else /* PNG_iTXt_SUPPORTED */ { png_warning(png_ptr, "iTXt chunk not supported."); continue; } #endif if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0') { text_length = 0; #ifdef PNG_iTXt_SUPPORTED if (text_ptr[i].compression > 0) textp->compression = PNG_ITXT_COMPRESSION_NONE; else #endif textp->compression = PNG_TEXT_COMPRESSION_NONE; } else { text_length = png_strlen(text_ptr[i].text); textp->compression = text_ptr[i].compression; } textp->key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32) (key_len + text_length + lang_len + lang_key_len + 4)); if (textp->key == NULL) return(1); png_debug2(2, "Allocated %lu bytes at %p in png_set_text", (png_uint_32) (key_len + lang_len + lang_key_len + text_length + 4), textp->key); png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len)); *(textp->key + key_len) = '\0'; #ifdef PNG_iTXt_SUPPORTED if (text_ptr[i].compression > 0) { textp->lang = textp->key + key_len + 1; png_memcpy(textp->lang, text_ptr[i].lang, lang_len); *(textp->lang + lang_len) = '\0'; textp->lang_key = textp->lang + lang_len + 1; png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); *(textp->lang_key + lang_key_len) = '\0'; textp->text = textp->lang_key + lang_key_len + 1; } else #endif { #ifdef PNG_iTXt_SUPPORTED textp->lang=NULL; textp->lang_key=NULL; #endif textp->text = textp->key + key_len + 1; } if (text_length) png_memcpy(textp->text, text_ptr[i].text, (png_size_t)(text_length)); *(textp->text + text_length) = '\0'; #ifdef PNG_iTXt_SUPPORTED if (textp->compression > 0) { textp->text_length = 0; textp->itxt_length = text_length; } else #endif { textp->text_length = text_length; #ifdef PNG_iTXt_SUPPORTED textp->itxt_length = 0; #endif } info_ptr->num_text++; png_debug1(3, "transferred text chunk %d", info_ptr->num_text); } return(0); }
png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, int num_text) { int i; png_debug1(1, "in %s storage function", ((png_ptr == NULL || png_ptr->chunk_name[0] == '\0') ? "text" : (png_const_charp)png_ptr->chunk_name)); if (png_ptr == NULL || info_ptr == NULL || num_text == 0) return(0); /* Make sure we have enough space in the "text" array in info_struct * to hold all of the incoming text_ptr objects. */ if (info_ptr->num_text + num_text > info_ptr->max_text) { int old_max_text = info_ptr->max_text; int old_num_text = info_ptr->num_text; if (info_ptr->text != NULL) { png_textp old_text; info_ptr->max_text = info_ptr->num_text + num_text + 8; old_text = info_ptr->text; info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) { /* Restore to previous condition */ info_ptr->max_text = old_max_text; info_ptr->text = old_text; return(1); } png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max_text * png_sizeof(png_text))); png_free(png_ptr, old_text); } else { info_ptr->max_text = num_text + 8; info_ptr->num_text = 0; info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) { /* Restore to previous condition */ info_ptr->num_text = old_num_text; info_ptr->max_text = old_max_text; return(1); } #ifdef PNG_FREE_ME_SUPPORTED info_ptr->free_me |= PNG_FREE_TEXT; #endif } png_debug1(3, "allocated %d entries for info_ptr->text", info_ptr->max_text); } for (i = 0; i < num_text; i++) { png_size_t text_length, key_len; png_size_t lang_len, lang_key_len; png_textp textp = &(info_ptr->text[info_ptr->num_text]); if (text_ptr[i].key == NULL) continue; key_len = png_strlen(text_ptr[i].key); if (text_ptr[i].compression <= 0) { lang_len = 0; lang_key_len = 0; } else #ifdef PNG_iTXt_SUPPORTED { /* Set iTXt data */ if (text_ptr[i].lang != NULL) lang_len = png_strlen(text_ptr[i].lang); else lang_len = 0; if (text_ptr[i].lang_key != NULL) lang_key_len = png_strlen(text_ptr[i].lang_key); else lang_key_len = 0; } #else /* PNG_iTXt_SUPPORTED */ { png_warning(png_ptr, "iTXt chunk not supported."); continue; } #endif if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0') { text_length = 0; #ifdef PNG_iTXt_SUPPORTED if (text_ptr[i].compression > 0) textp->compression = PNG_ITXT_COMPRESSION_NONE; else #endif textp->compression = PNG_TEXT_COMPRESSION_NONE; } else { text_length = png_strlen(text_ptr[i].text); textp->compression = text_ptr[i].compression; } textp->key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32) (key_len + text_length + lang_len + lang_key_len + 4)); if (textp->key == NULL) return(1); png_debug2(2, "Allocated %lu bytes at %x in png_set_text", (png_uint_32) (key_len + lang_len + lang_key_len + text_length + 4), (int)textp->key); png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len)); *(textp->key + key_len) = '\0'; #ifdef PNG_iTXt_SUPPORTED if (text_ptr[i].compression > 0) { textp->lang = textp->key + key_len + 1; png_memcpy(textp->lang, text_ptr[i].lang, lang_len); *(textp->lang + lang_len) = '\0'; textp->lang_key = textp->lang + lang_len + 1; png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); *(textp->lang_key + lang_key_len) = '\0'; textp->text = textp->lang_key + lang_key_len + 1; } else #endif { #ifdef PNG_iTXt_SUPPORTED textp->lang=NULL; textp->lang_key=NULL; #endif textp->text = textp->key + key_len + 1; } if (text_length) png_memcpy(textp->text, text_ptr[i].text, (png_size_t)(text_length)); *(textp->text + text_length) = '\0'; #ifdef PNG_iTXt_SUPPORTED if (textp->compression > 0) { textp->text_length = 0; textp->itxt_length = text_length; } else #endif { textp->text_length = text_length; #ifdef PNG_iTXt_SUPPORTED textp->itxt_length = 0; #endif } info_ptr->num_text++; png_debug1(3, "transferred text chunk %d", info_ptr->num_text); } return(0); }
C
Chrome
1
null
null
null
https://github.com/chromium/chromium/commit/5041f984669fe3a989a84c348eb838c8f7233f6b
5041f984669fe3a989a84c348eb838c8f7233f6b
AutoFill: Release the cached frame when we receive the frameDestroyed() message from WebKit. BUG=48857 TEST=none Review URL: http://codereview.chromium.org/3173005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55789 0039d316-1c4b-4281-b951-d872f2087c98
PendingFileChooser(const ViewHostMsg_RunFileChooser_Params& p, WebFileChooserCompletion* c) : params(p), completion(c) { }
PendingFileChooser(const ViewHostMsg_RunFileChooser_Params& p, WebFileChooserCompletion* c) : params(p), completion(c) { }
C
Chrome
0
CVE-2015-8838
https://www.cvedetails.com/cve/CVE-2015-8838/
CWE-284
https://git.php.net/?p=php-src.git;a=commit;h=97aa752fee61fccdec361279adbfb17a3c60f3f4
97aa752fee61fccdec361279adbfb17a3c60f3f4
null
MYSQLND_METHOD(mysqlnd_conn_data, end_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC) { DBG_ENTER("mysqlnd_conn_data::end_psession"); DBG_RETURN(PASS); }
MYSQLND_METHOD(mysqlnd_conn_data, end_psession)(MYSQLND_CONN_DATA * conn TSRMLS_DC) { DBG_ENTER("mysqlnd_conn_data::end_psession"); DBG_RETURN(PASS); }
C
php
0
CVE-2011-2859
https://www.cvedetails.com/cve/CVE-2011-2859/
CWE-264
https://github.com/chromium/chromium/commit/454434f6100cb6a529652a25b5fc181caa7c7f32
454434f6100cb6a529652a25b5fc181caa7c7f32
Limit extent of webstore app to just chrome.google.com/webstore. BUG=93497 TEST=Try installing extensions and apps from the webstore, starting both being initially logged in, and not. Review URL: http://codereview.chromium.org/7719003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97986 0039d316-1c4b-4281-b951-d872f2087c98
void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info, bool write_to_prefs) { std::string error; scoped_refptr<const Extension> extension(NULL); if (!extension_prefs_->IsExtensionAllowedByPolicy(info.extension_id)) { error = errors::kDisabledByPolicy; } else if (info.extension_manifest.get()) { int flags = Extension::NO_FLAGS; if (info.extension_location != Extension::LOAD) flags |= Extension::REQUIRE_KEY; if (Extension::ShouldDoStrictErrorChecking(info.extension_location)) flags |= Extension::STRICT_ERROR_CHECKS; if (extension_prefs_->AllowFileAccess(info.extension_id)) flags |= Extension::ALLOW_FILE_ACCESS; if (extension_prefs_->IsFromWebStore(info.extension_id)) flags |= Extension::FROM_WEBSTORE; if (extension_prefs_->IsFromBookmark(info.extension_id)) flags |= Extension::FROM_BOOKMARK; extension = Extension::Create( info.extension_path, info.extension_location, *info.extension_manifest, flags, &error); } else { error = errors::kManifestUnreadable; } if (!extension) { ReportExtensionLoadError(info.extension_path, error, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, false); return; } if (write_to_prefs) extension_prefs_->UpdateManifest(extension); AddExtension(extension); }
void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info, bool write_to_prefs) { std::string error; scoped_refptr<const Extension> extension(NULL); if (!extension_prefs_->IsExtensionAllowedByPolicy(info.extension_id)) { error = errors::kDisabledByPolicy; } else if (info.extension_manifest.get()) { int flags = Extension::NO_FLAGS; if (info.extension_location != Extension::LOAD) flags |= Extension::REQUIRE_KEY; if (Extension::ShouldDoStrictErrorChecking(info.extension_location)) flags |= Extension::STRICT_ERROR_CHECKS; if (extension_prefs_->AllowFileAccess(info.extension_id)) flags |= Extension::ALLOW_FILE_ACCESS; if (extension_prefs_->IsFromWebStore(info.extension_id)) flags |= Extension::FROM_WEBSTORE; if (extension_prefs_->IsFromBookmark(info.extension_id)) flags |= Extension::FROM_BOOKMARK; extension = Extension::Create( info.extension_path, info.extension_location, *info.extension_manifest, flags, &error); } else { error = errors::kManifestUnreadable; } if (!extension) { ReportExtensionLoadError(info.extension_path, error, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, false); return; } if (write_to_prefs) extension_prefs_->UpdateManifest(extension); AddExtension(extension); }
C
Chrome
0
CVE-2017-5053
https://www.cvedetails.com/cve/CVE-2017-5053/
CWE-125
https://github.com/chromium/chromium/commit/5c895ed26b096468eea6baa6584f2df65905b76b
5c895ed26b096468eea6baa6584f2df65905b76b
[Android][TouchToFill] Use FindPasswordInfoForElement for triggering Use for TouchToFill the same triggering logic that is used for regular suggestions. Bug: 1010233 Change-Id: I111d4eac4ce94dd94b86097b6b6c98e08875e11a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1834230 Commit-Queue: Boris Sazonov <[email protected]> Reviewed-by: Vadym Doroshenko <[email protected]> Cr-Commit-Position: refs/heads/master@{#702058}
void PasswordAutofillAgent::OnInferredFormSubmission(SubmissionSource source) { if (source == SubmissionSource::FRAME_DETACHED) { OnFrameDetached(); } else { SubmissionIndicatorEvent event = ToSubmissionIndicatorEvent(source); if (event == SubmissionIndicatorEvent::NONE) return; FireSubmissionIfFormDisappear(event); } }
void PasswordAutofillAgent::OnInferredFormSubmission(SubmissionSource source) { if (source == SubmissionSource::FRAME_DETACHED) { OnFrameDetached(); } else { SubmissionIndicatorEvent event = ToSubmissionIndicatorEvent(source); if (event == SubmissionIndicatorEvent::NONE) return; FireSubmissionIfFormDisappear(event); } }
C
Chrome
0
CVE-2016-2428
https://www.cvedetails.com/cve/CVE-2016-2428/
CWE-119
https://android.googlesource.com/platform/external/aac/+/5d4405f601fa11a8955fd7611532c982420e4206
5d4405f601fa11a8955fd7611532c982420e4206
Fix stack corruption happening in aacDecoder_drcExtractAndMap() In the aacDecoder_drcExtractAndMap() function, self->numThreads can be used after having exceeded its intended max value, MAX_DRC_THREADS, causing memory to be cleared after the threadBs[MAX_DRC_THREADS] array. The crash is prevented by never using self->numThreads with a value equal to or greater than MAX_DRC_THREADS. A proper fix will be required as there seems to be an issue as to which entry in the threadBs array is meant to be initialized and used. Bug 26751339 Change-Id: I655cc40c35d4206ab72e83b2bdb751be2fe52b5a
AAC_DECODER_ERROR aacDecoder_drcSetParam ( HANDLE_AAC_DRC self, AACDEC_DRC_PARAM param, INT value ) { AAC_DECODER_ERROR ErrorStatus = AAC_DEC_OK; switch (param) { case DRC_CUT_SCALE: /* set attenuation scale factor */ if ( (value < 0) || (value > DRC_MAX_QUANT_FACTOR) ) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.usrCut = (FIXP_DBL)((INT)(DRC_PARAM_QUANT_STEP>>DRC_PARAM_SCALE) * (INT)value); if (self->params.applyHeavyCompression == 0) self->params.cut = self->params.usrCut; break; case DRC_BOOST_SCALE: /* set boost factor */ if ( (value < 0) || (value > DRC_MAX_QUANT_FACTOR) ) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.usrBoost = (FIXP_DBL)((INT)(DRC_PARAM_QUANT_STEP>>DRC_PARAM_SCALE) * (INT)value); if (self->params.applyHeavyCompression == 0) self->params.boost = self->params.usrBoost; break; case TARGET_REF_LEVEL: if ( value > MAX_REFERENCE_LEVEL || value < -MAX_REFERENCE_LEVEL ) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } if (value < 0) { self->params.applyDigitalNorm = 0; self->params.targetRefLevel = -1; } else { /* ref_level must be between 0 and MAX_REFERENCE_LEVEL, inclusive */ self->params.applyDigitalNorm = 1; if (self->params.targetRefLevel != (SCHAR)value) { self->params.targetRefLevel = (SCHAR)value; self->progRefLevel = (SCHAR)value; /* Always set the program reference level equal to the target level according to 4.5.2.7.3 of ISO/IEC 14496-3. */ } } break; case APPLY_NORMALIZATION: if (value < 0 || value > 1) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } /* Store new parameter value */ self->params.applyDigitalNorm = (UCHAR)value; break; case APPLY_HEAVY_COMPRESSION: if (value < 0 || value > 1) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } if (self->params.applyHeavyCompression != (UCHAR)value) { if (value == 1) { /* Disable scaling of DRC values by setting the max values */ self->params.boost = FL2FXCONST_DBL(1.0f/(float)(1<<DRC_PARAM_SCALE)); self->params.cut = FL2FXCONST_DBL(1.0f/(float)(1<<DRC_PARAM_SCALE)); } else { /* Restore the user params */ self->params.boost = self->params.usrBoost; self->params.cut = self->params.usrCut; } /* Store new parameter value */ self->params.applyHeavyCompression = (UCHAR)value; } break; case DRC_BS_DELAY: if (value < 0 || value > 1) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.bsDelayEnable = value; break; case DRC_DATA_EXPIRY_FRAME: if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.expiryFrame = (UINT)value; break; default: return AAC_DEC_SET_PARAM_FAIL; } /* switch(param) */ /* switch on/off processing */ self->enable = ( (self->params.boost > (FIXP_DBL)0) || (self->params.cut > (FIXP_DBL)0) || (self->params.applyHeavyCompression != 0) || (self->params.targetRefLevel >= 0) ); return ErrorStatus; }
AAC_DECODER_ERROR aacDecoder_drcSetParam ( HANDLE_AAC_DRC self, AACDEC_DRC_PARAM param, INT value ) { AAC_DECODER_ERROR ErrorStatus = AAC_DEC_OK; switch (param) { case DRC_CUT_SCALE: /* set attenuation scale factor */ if ( (value < 0) || (value > DRC_MAX_QUANT_FACTOR) ) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.usrCut = (FIXP_DBL)((INT)(DRC_PARAM_QUANT_STEP>>DRC_PARAM_SCALE) * (INT)value); if (self->params.applyHeavyCompression == 0) self->params.cut = self->params.usrCut; break; case DRC_BOOST_SCALE: /* set boost factor */ if ( (value < 0) || (value > DRC_MAX_QUANT_FACTOR) ) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.usrBoost = (FIXP_DBL)((INT)(DRC_PARAM_QUANT_STEP>>DRC_PARAM_SCALE) * (INT)value); if (self->params.applyHeavyCompression == 0) self->params.boost = self->params.usrBoost; break; case TARGET_REF_LEVEL: if ( value > MAX_REFERENCE_LEVEL || value < -MAX_REFERENCE_LEVEL ) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } if (value < 0) { self->params.applyDigitalNorm = 0; self->params.targetRefLevel = -1; } else { /* ref_level must be between 0 and MAX_REFERENCE_LEVEL, inclusive */ self->params.applyDigitalNorm = 1; if (self->params.targetRefLevel != (SCHAR)value) { self->params.targetRefLevel = (SCHAR)value; self->progRefLevel = (SCHAR)value; /* Always set the program reference level equal to the target level according to 4.5.2.7.3 of ISO/IEC 14496-3. */ } } break; case APPLY_NORMALIZATION: if (value < 0 || value > 1) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } /* Store new parameter value */ self->params.applyDigitalNorm = (UCHAR)value; break; case APPLY_HEAVY_COMPRESSION: if (value < 0 || value > 1) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } if (self->params.applyHeavyCompression != (UCHAR)value) { if (value == 1) { /* Disable scaling of DRC values by setting the max values */ self->params.boost = FL2FXCONST_DBL(1.0f/(float)(1<<DRC_PARAM_SCALE)); self->params.cut = FL2FXCONST_DBL(1.0f/(float)(1<<DRC_PARAM_SCALE)); } else { /* Restore the user params */ self->params.boost = self->params.usrBoost; self->params.cut = self->params.usrCut; } /* Store new parameter value */ self->params.applyHeavyCompression = (UCHAR)value; } break; case DRC_BS_DELAY: if (value < 0 || value > 1) { return AAC_DEC_SET_PARAM_FAIL; } if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.bsDelayEnable = value; break; case DRC_DATA_EXPIRY_FRAME: if (self == NULL) { return AAC_DEC_INVALID_HANDLE; } self->params.expiryFrame = (UINT)value; break; default: return AAC_DEC_SET_PARAM_FAIL; } /* switch(param) */ /* switch on/off processing */ self->enable = ( (self->params.boost > (FIXP_DBL)0) || (self->params.cut > (FIXP_DBL)0) || (self->params.applyHeavyCompression != 0) || (self->params.targetRefLevel >= 0) ); return ErrorStatus; }
C
Android
0
CVE-2011-3045
https://www.cvedetails.com/cve/CVE-2011-3045/
CWE-189
https://github.com/chromium/chromium/commit/4cf106cdb83dd6b35d3b26d06cc67d1d2d99041e
4cf106cdb83dd6b35d3b26d06cc67d1d2d99041e
Pull follow-up tweak from upstream. BUG=116162 Review URL: http://codereview.chromium.org/9546033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125311 0039d316-1c4b-4281-b951-d872f2087c98
png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_textp text_ptr; png_charp key, lang, text, lang_key; int comp_flag; int comp_type = 0; int ret; png_size_t slength, prefix_len, data_len; png_debug(1, "in png_handle_iTXt"); #ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { if (png_ptr->user_chunk_cache_max == 1) { png_crc_finish(png_ptr, length); return; } if (--png_ptr->user_chunk_cache_max == 1) { png_warning(png_ptr, "No space in chunk cache for iTXt"); png_crc_finish(png_ptr, length); return; } } #endif if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before iTXt"); if (png_ptr->mode & PNG_HAVE_IDAT) png_ptr->mode |= PNG_AFTER_IDAT; #ifdef PNG_MAX_MALLOC_64K /* We will no doubt have problems with chunks even half this size, but there is no hard and fast rule to tell us where to stop. */ if (length > (png_uint_32)65535L) { png_warning(png_ptr, "iTXt chunk too large to fit in memory"); png_crc_finish(png_ptr, length); return; } #endif png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) { png_warning(png_ptr, "No memory to process iTXt chunk."); return; } slength = (png_size_t)length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, 0)) { png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } png_ptr->chunkdata[slength] = 0x00; for (lang = png_ptr->chunkdata; *lang; lang++) /* Empty loop */ ; lang++; /* Skip NUL separator */ /* iTXt must have a language tag (possibly empty), two compression bytes, * translated keyword (possibly empty), and possibly some text after the * keyword */ if (lang >= png_ptr->chunkdata + slength - 3) { png_warning(png_ptr, "Truncated iTXt chunk"); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } else { comp_flag = *lang++; comp_type = *lang++; } for (lang_key = lang; *lang_key; lang_key++) /* Empty loop */ ; lang_key++; /* Skip NUL separator */ if (lang_key >= png_ptr->chunkdata + slength) { png_warning(png_ptr, "Truncated iTXt chunk"); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } for (text = lang_key; *text; text++) /* Empty loop */ ; text++; /* Skip NUL separator */ if (text >= png_ptr->chunkdata + slength) { png_warning(png_ptr, "Malformed iTXt chunk"); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } prefix_len = text - png_ptr->chunkdata; key=png_ptr->chunkdata; if (comp_flag) png_decompress_chunk(png_ptr, comp_type, (size_t)length, prefix_len, &data_len); else data_len = png_strlen(png_ptr->chunkdata + prefix_len); text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)png_sizeof(png_text)); if (text_ptr == NULL) { png_warning(png_ptr, "Not enough memory to process iTXt chunk."); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } text_ptr->compression = (int)comp_flag + 1; text_ptr->lang_key = png_ptr->chunkdata + (lang_key - key); text_ptr->lang = png_ptr->chunkdata + (lang - key); text_ptr->itxt_length = data_len; text_ptr->text_length = 0; text_ptr->key = png_ptr->chunkdata; text_ptr->text = png_ptr->chunkdata + prefix_len; ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); png_free(png_ptr, text_ptr); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; if (ret) png_error(png_ptr, "Insufficient memory to store iTXt chunk."); }
png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_textp text_ptr; png_charp key, lang, text, lang_key; int comp_flag; int comp_type = 0; int ret; png_size_t slength, prefix_len, data_len; png_debug(1, "in png_handle_iTXt"); #ifdef PNG_USER_LIMITS_SUPPORTED if (png_ptr->user_chunk_cache_max != 0) { if (png_ptr->user_chunk_cache_max == 1) { png_crc_finish(png_ptr, length); return; } if (--png_ptr->user_chunk_cache_max == 1) { png_warning(png_ptr, "No space in chunk cache for iTXt"); png_crc_finish(png_ptr, length); return; } } #endif if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before iTXt"); if (png_ptr->mode & PNG_HAVE_IDAT) png_ptr->mode |= PNG_AFTER_IDAT; #ifdef PNG_MAX_MALLOC_64K /* We will no doubt have problems with chunks even half this size, but there is no hard and fast rule to tell us where to stop. */ if (length > (png_uint_32)65535L) { png_warning(png_ptr, "iTXt chunk too large to fit in memory"); png_crc_finish(png_ptr, length); return; } #endif png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) { png_warning(png_ptr, "No memory to process iTXt chunk."); return; } slength = (png_size_t)length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, 0)) { png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } png_ptr->chunkdata[slength] = 0x00; for (lang = png_ptr->chunkdata; *lang; lang++) /* Empty loop */ ; lang++; /* Skip NUL separator */ /* iTXt must have a language tag (possibly empty), two compression bytes, * translated keyword (possibly empty), and possibly some text after the * keyword */ if (lang >= png_ptr->chunkdata + slength - 3) { png_warning(png_ptr, "Truncated iTXt chunk"); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } else { comp_flag = *lang++; comp_type = *lang++; } for (lang_key = lang; *lang_key; lang_key++) /* Empty loop */ ; lang_key++; /* Skip NUL separator */ if (lang_key >= png_ptr->chunkdata + slength) { png_warning(png_ptr, "Truncated iTXt chunk"); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } for (text = lang_key; *text; text++) /* Empty loop */ ; text++; /* Skip NUL separator */ if (text >= png_ptr->chunkdata + slength) { png_warning(png_ptr, "Malformed iTXt chunk"); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } prefix_len = text - png_ptr->chunkdata; key=png_ptr->chunkdata; if (comp_flag) png_decompress_chunk(png_ptr, comp_type, (size_t)length, prefix_len, &data_len); else data_len = png_strlen(png_ptr->chunkdata + prefix_len); text_ptr = (png_textp)png_malloc_warn(png_ptr, (png_uint_32)png_sizeof(png_text)); if (text_ptr == NULL) { png_warning(png_ptr, "Not enough memory to process iTXt chunk."); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; return; } text_ptr->compression = (int)comp_flag + 1; text_ptr->lang_key = png_ptr->chunkdata + (lang_key - key); text_ptr->lang = png_ptr->chunkdata + (lang - key); text_ptr->itxt_length = data_len; text_ptr->text_length = 0; text_ptr->key = png_ptr->chunkdata; text_ptr->text = png_ptr->chunkdata + prefix_len; ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); png_free(png_ptr, text_ptr); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; if (ret) png_error(png_ptr, "Insufficient memory to store iTXt chunk."); }
C
Chrome
0
CVE-2013-2850
https://www.cvedetails.com/cve/CVE-2013-2850/
CWE-119
https://github.com/torvalds/linux/commit/cea4dcfdad926a27a18e188720efe0f2c9403456
cea4dcfdad926a27a18e188720efe0f2c9403456
iscsi-target: fix heap buffer overflow on error If a key was larger than 64 bytes, as checked by iscsi_check_key(), the error response packet, generated by iscsi_add_notunderstood_response(), would still attempt to copy the entire key into the packet, overflowing the structure on the heap. Remote preauthentication kernel memory corruption was possible if a target was configured and listening on the network. CVE-2013-2850 Signed-off-by: Kees Cook <[email protected]> Cc: [email protected] Signed-off-by: Nicholas Bellinger <[email protected]>
int iscsi_encode_text_output( u8 phase, u8 sender, char *textbuf, u32 *length, struct iscsi_param_list *param_list) { char *output_buf = NULL; struct iscsi_extra_response *er; struct iscsi_param *param; output_buf = textbuf + *length; if (iscsi_enforce_integrity_rules(phase, param_list) < 0) return -1; list_for_each_entry(param, &param_list->param_list, p_list) { if (!(param->sender & sender)) continue; if (IS_PSTATE_ACCEPTOR(param) && !IS_PSTATE_RESPONSE_SENT(param) && !IS_PSTATE_REPLY_OPTIONAL(param) && (param->phase & phase)) { *length += sprintf(output_buf, "%s=%s", param->name, param->value); *length += 1; output_buf = textbuf + *length; SET_PSTATE_RESPONSE_SENT(param); pr_debug("Sending key: %s=%s\n", param->name, param->value); continue; } if (IS_PSTATE_NEGOTIATE(param) && !IS_PSTATE_ACCEPTOR(param) && !IS_PSTATE_PROPOSER(param) && (param->phase & phase)) { *length += sprintf(output_buf, "%s=%s", param->name, param->value); *length += 1; output_buf = textbuf + *length; SET_PSTATE_PROPOSER(param); iscsi_check_proposer_for_optional_reply(param); pr_debug("Sending key: %s=%s\n", param->name, param->value); } } list_for_each_entry(er, &param_list->extra_response_list, er_list) { *length += sprintf(output_buf, "%s=%s", er->key, er->value); *length += 1; output_buf = textbuf + *length; pr_debug("Sending key: %s=%s\n", er->key, er->value); } iscsi_release_extra_responses(param_list); return 0; }
int iscsi_encode_text_output( u8 phase, u8 sender, char *textbuf, u32 *length, struct iscsi_param_list *param_list) { char *output_buf = NULL; struct iscsi_extra_response *er; struct iscsi_param *param; output_buf = textbuf + *length; if (iscsi_enforce_integrity_rules(phase, param_list) < 0) return -1; list_for_each_entry(param, &param_list->param_list, p_list) { if (!(param->sender & sender)) continue; if (IS_PSTATE_ACCEPTOR(param) && !IS_PSTATE_RESPONSE_SENT(param) && !IS_PSTATE_REPLY_OPTIONAL(param) && (param->phase & phase)) { *length += sprintf(output_buf, "%s=%s", param->name, param->value); *length += 1; output_buf = textbuf + *length; SET_PSTATE_RESPONSE_SENT(param); pr_debug("Sending key: %s=%s\n", param->name, param->value); continue; } if (IS_PSTATE_NEGOTIATE(param) && !IS_PSTATE_ACCEPTOR(param) && !IS_PSTATE_PROPOSER(param) && (param->phase & phase)) { *length += sprintf(output_buf, "%s=%s", param->name, param->value); *length += 1; output_buf = textbuf + *length; SET_PSTATE_PROPOSER(param); iscsi_check_proposer_for_optional_reply(param); pr_debug("Sending key: %s=%s\n", param->name, param->value); } } list_for_each_entry(er, &param_list->extra_response_list, er_list) { *length += sprintf(output_buf, "%s=%s", er->key, er->value); *length += 1; output_buf = textbuf + *length; pr_debug("Sending key: %s=%s\n", er->key, er->value); } iscsi_release_extra_responses(param_list); return 0; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/a03d4448faf2c40f4ef444a88cb9aace5b98e8c4
a03d4448faf2c40f4ef444a88cb9aace5b98e8c4
Introduce background.scripts feature for extension manifests. This optimizes for the common use case where background pages just include a reference to one or more script files and no additional HTML. BUG=107791 Review URL: http://codereview.chromium.org/9150008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117110 0039d316-1c4b-4281-b951-d872f2087c98
void TestingAutomationProvider::WaitForBrowserWindowCountToBecome( int target_count, IPC::Message* reply_message) { if (static_cast<int>(BrowserList::size()) == target_count) { AutomationMsg_WaitForBrowserWindowCountToBecome::WriteReplyParams( reply_message, true); Send(reply_message); return; } new BrowserCountChangeNotificationObserver(target_count, this, reply_message); }
void TestingAutomationProvider::WaitForBrowserWindowCountToBecome( int target_count, IPC::Message* reply_message) { if (static_cast<int>(BrowserList::size()) == target_count) { AutomationMsg_WaitForBrowserWindowCountToBecome::WriteReplyParams( reply_message, true); Send(reply_message); return; } new BrowserCountChangeNotificationObserver(target_count, this, reply_message); }
C
Chrome
0
CVE-2018-6034
https://www.cvedetails.com/cve/CVE-2018-6034/
CWE-125
https://github.com/chromium/chromium/commit/3298d3abf47b3a7a10e44c07d821c68a5c8aa935
3298d3abf47b3a7a10e44c07d821c68a5c8aa935
Tighten about IntRect use in WebGL with overflow detection BUG=784183 TEST=test case in the bug in ASAN build [email protected] 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: Ie25ca328af99de7828e28e6a6e3d775f1bebc43f Reviewed-on: https://chromium-review.googlesource.com/811826 Reviewed-by: Kenneth Russell <[email protected]> Commit-Queue: Zhenyao Mo <[email protected]> Cr-Commit-Position: refs/heads/master@{#522213}
void WebGLRenderingContextBase::TexImageByGPU( TexImageFunctionID function_id, WebGLTexture* texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, CanvasImageSource* image, const IntRect& source_sub_rectangle) { DCHECK(image->IsCanvasElement() || image->IsImageBitmap()); int width = source_sub_rectangle.Width(); int height = source_sub_rectangle.Height(); ScopedTexture2DRestorer restorer(this); GLuint target_texture = texture->Object(); bool possible_direct_copy = false; if (function_id == kTexImage2D || function_id == kTexSubImage2D) { possible_direct_copy = Extensions3DUtil::CanUseCopyTextureCHROMIUM(target); } GLint copy_x_offset = xoffset; GLint copy_y_offset = yoffset; GLenum copy_target = target; if (!possible_direct_copy) { ContextGL()->GenTextures(1, &target_texture); ContextGL()->BindTexture(GL_TEXTURE_2D, target_texture); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ContextGL()->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); copy_x_offset = 0; copy_y_offset = 0; copy_target = GL_TEXTURE_2D; } { ScopedUnpackParametersResetRestore temporaryResetUnpack(this); if (image->IsCanvasElement()) { TexImageCanvasByGPU(function_id, static_cast<HTMLCanvasElement*>(image), copy_target, target_texture, copy_x_offset, copy_y_offset, source_sub_rectangle); } else { TexImageBitmapByGPU(static_cast<ImageBitmap*>(image), copy_target, target_texture, !unpack_flip_y_, copy_x_offset, copy_y_offset, source_sub_rectangle); } } if (!possible_direct_copy) { GLuint tmp_fbo; ContextGL()->GenFramebuffers(1, &tmp_fbo); ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, tmp_fbo); ContextGL()->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, target_texture, 0); ContextGL()->BindTexture(texture->GetTarget(), texture->Object()); if (function_id == kTexImage2D) { ContextGL()->CopyTexSubImage2D(target, level, 0, 0, 0, 0, width, height); } else if (function_id == kTexSubImage2D) { ContextGL()->CopyTexSubImage2D(target, level, xoffset, yoffset, 0, 0, width, height); } else if (function_id == kTexSubImage3D) { ContextGL()->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, 0, 0, width, height); } ContextGL()->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); RestoreCurrentFramebuffer(); ContextGL()->DeleteFramebuffers(1, &tmp_fbo); ContextGL()->DeleteTextures(1, &target_texture); } }
void WebGLRenderingContextBase::TexImageByGPU( TexImageFunctionID function_id, WebGLTexture* texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, CanvasImageSource* image, const IntRect& source_sub_rectangle) { DCHECK(image->IsCanvasElement() || image->IsImageBitmap()); int width = source_sub_rectangle.Width(); int height = source_sub_rectangle.Height(); ScopedTexture2DRestorer restorer(this); GLuint target_texture = texture->Object(); bool possible_direct_copy = false; if (function_id == kTexImage2D || function_id == kTexSubImage2D) { possible_direct_copy = Extensions3DUtil::CanUseCopyTextureCHROMIUM(target); } GLint copy_x_offset = xoffset; GLint copy_y_offset = yoffset; GLenum copy_target = target; if (!possible_direct_copy) { ContextGL()->GenTextures(1, &target_texture); ContextGL()->BindTexture(GL_TEXTURE_2D, target_texture); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ContextGL()->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ContextGL()->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); copy_x_offset = 0; copy_y_offset = 0; copy_target = GL_TEXTURE_2D; } { ScopedUnpackParametersResetRestore temporaryResetUnpack(this); if (image->IsCanvasElement()) { TexImageCanvasByGPU(function_id, static_cast<HTMLCanvasElement*>(image), copy_target, target_texture, copy_x_offset, copy_y_offset, source_sub_rectangle); } else { TexImageBitmapByGPU(static_cast<ImageBitmap*>(image), copy_target, target_texture, !unpack_flip_y_, copy_x_offset, copy_y_offset, source_sub_rectangle); } } if (!possible_direct_copy) { GLuint tmp_fbo; ContextGL()->GenFramebuffers(1, &tmp_fbo); ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, tmp_fbo); ContextGL()->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, target_texture, 0); ContextGL()->BindTexture(texture->GetTarget(), texture->Object()); if (function_id == kTexImage2D) { ContextGL()->CopyTexSubImage2D(target, level, 0, 0, 0, 0, width, height); } else if (function_id == kTexSubImage2D) { ContextGL()->CopyTexSubImage2D(target, level, xoffset, yoffset, 0, 0, width, height); } else if (function_id == kTexSubImage3D) { ContextGL()->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, 0, 0, width, height); } ContextGL()->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); RestoreCurrentFramebuffer(); ContextGL()->DeleteFramebuffers(1, &tmp_fbo); ContextGL()->DeleteTextures(1, &target_texture); } }
C
Chrome
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
static void ipa_udata_free(wmfAPI * API, wmfUserData_t * userdata) { (void) API; (void) userdata; /* wmf_magick_t* ddata = WMF_MAGICK_GetData (API); */ }
static void ipa_udata_free(wmfAPI * API, wmfUserData_t * userdata) { (void) API; (void) userdata; /* wmf_magick_t* ddata = WMF_MAGICK_GetData (API); */ }
C
ImageMagick
0
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 GDataDirectory::RemoveEntry(GDataEntry* entry) { DCHECK(entry); RemoveChild(entry); delete entry; }
void GDataDirectory::RemoveEntry(GDataEntry* entry) { DCHECK(entry); RemoveChild(entry); delete entry; }
C
Chrome
0
CVE-2012-5534
https://www.cvedetails.com/cve/CVE-2012-5534/
CWE-20
https://git.savannah.gnu.org/gitweb/?p=weechat.git;a=commitdiff_plain;h=efb795c74fe954b9544074aafcebb1be4452b03a
efb795c74fe954b9544074aafcebb1be4452b03a
null
hook_print_log () { int type, i, j; struct t_hook *ptr_hook; struct tm *local_time; char text_time[1024]; for (type = 0; type < HOOK_NUM_TYPES; type++) { for (ptr_hook = weechat_hooks[type]; ptr_hook; ptr_hook = ptr_hook->next_hook) { log_printf (""); log_printf ("[hook (addr:0x%lx)]", ptr_hook); log_printf (" plugin. . . . . . . . . : 0x%lx ('%s')", ptr_hook->plugin, plugin_get_name (ptr_hook->plugin)); log_printf (" subplugin . . . . . . . : '%s'", ptr_hook->subplugin); log_printf (" type. . . . . . . . . . : %d (%s)", ptr_hook->type, hook_type_string[ptr_hook->type]); log_printf (" deleted . . . . . . . . : %d", ptr_hook->deleted); log_printf (" running . . . . . . . . : %d", ptr_hook->running); log_printf (" priority. . . . . . . . : %d", ptr_hook->priority); log_printf (" callback_data . . . . . : 0x%lx", ptr_hook->callback_data); switch (ptr_hook->type) { case HOOK_TYPE_COMMAND: if (!ptr_hook->deleted) { log_printf (" command data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMMAND(ptr_hook, callback)); log_printf (" command . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, command)); log_printf (" description . . . . . : '%s'", HOOK_COMMAND(ptr_hook, description)); log_printf (" args. . . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, args)); log_printf (" args_description. . . : '%s'", HOOK_COMMAND(ptr_hook, args_description)); log_printf (" completion. . . . . . : '%s'", HOOK_COMMAND(ptr_hook, completion)); log_printf (" cplt_num_templates. . : %d", HOOK_COMMAND(ptr_hook, cplt_num_templates)); for (i = 0; i < HOOK_COMMAND(ptr_hook, cplt_num_templates); i++) { log_printf (" cplt_templates[%04d] . . . : '%s'", i, HOOK_COMMAND(ptr_hook, cplt_templates)[i]); log_printf (" cplt_templates_static[%04d]: '%s'", i, HOOK_COMMAND(ptr_hook, cplt_templates_static)[i]); log_printf (" num_args. . . . . . : %d", HOOK_COMMAND(ptr_hook, cplt_template_num_args)[i]); for (j = 0; j < HOOK_COMMAND(ptr_hook, cplt_template_num_args)[i]; j++) { log_printf (" args[%04d]. . . . . : '%s'", j, HOOK_COMMAND(ptr_hook, cplt_template_args)[i][j]); } } log_printf (" num_args_concat . . . : %d", HOOK_COMMAND(ptr_hook, cplt_template_num_args_concat)); for (i = 0; i < HOOK_COMMAND(ptr_hook, cplt_template_num_args_concat); i++) { log_printf (" args_concat[%04d] . . : '%s'", i, HOOK_COMMAND(ptr_hook, cplt_template_args_concat)[i]); } } break; case HOOK_TYPE_COMMAND_RUN: if (!ptr_hook->deleted) { log_printf (" command_run data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMMAND_RUN(ptr_hook, callback)); log_printf (" command . . . . . . . : '%s'", HOOK_COMMAND_RUN(ptr_hook, command)); } break; case HOOK_TYPE_TIMER: if (!ptr_hook->deleted) { log_printf (" timer data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_TIMER(ptr_hook, callback)); log_printf (" interval. . . . . . . : %ld", HOOK_TIMER(ptr_hook, interval)); log_printf (" align_second. . . . . : %d", HOOK_TIMER(ptr_hook, align_second)); log_printf (" remaining_calls . . . : %d", HOOK_TIMER(ptr_hook, remaining_calls)); text_time[0] = '\0'; local_time = localtime (&HOOK_TIMER(ptr_hook, last_exec).tv_sec); if (local_time) { strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); } log_printf (" last_exec.tv_sec. . . : %ld (%s)", HOOK_TIMER(ptr_hook, last_exec.tv_sec), text_time); log_printf (" last_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, last_exec.tv_usec)); text_time[0] = '\0'; local_time = localtime (&HOOK_TIMER(ptr_hook, next_exec).tv_sec); if (local_time) { strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); } log_printf (" next_exec.tv_sec. . . : %ld (%s)", HOOK_TIMER(ptr_hook, next_exec.tv_sec), text_time); log_printf (" next_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, next_exec.tv_usec)); } break; case HOOK_TYPE_FD: if (!ptr_hook->deleted) { log_printf (" fd data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_FD(ptr_hook, callback)); log_printf (" fd. . . . . . . . . . : %d", HOOK_FD(ptr_hook, fd)); log_printf (" flags . . . . . . . . : %d", HOOK_FD(ptr_hook, flags)); log_printf (" error . . . . . . . . : %d", HOOK_FD(ptr_hook, error)); } break; case HOOK_TYPE_PROCESS: if (!ptr_hook->deleted) { log_printf (" process data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, callback)); log_printf (" command . . . . . . . : '%s'", HOOK_PROCESS(ptr_hook, command)); log_printf (" options . . . . . . . : 0x%lx (hashtable: '%s')", HOOK_PROCESS(ptr_hook, options), hashtable_get_string (HOOK_PROCESS(ptr_hook, options), "keys_values")); log_printf (" timeout . . . . . . . : %d", HOOK_PROCESS(ptr_hook, timeout)); log_printf (" child_read[stdout]. . : %d", HOOK_PROCESS(ptr_hook, child_read[HOOK_PROCESS_STDOUT])); log_printf (" child_write[stdout] . : %d", HOOK_PROCESS(ptr_hook, child_write[HOOK_PROCESS_STDOUT])); log_printf (" child_read[stderr]. . : %d", HOOK_PROCESS(ptr_hook, child_read[HOOK_PROCESS_STDERR])); log_printf (" child_write[stderr] . : %d", HOOK_PROCESS(ptr_hook, child_write[HOOK_PROCESS_STDERR])); log_printf (" child_pid . . . . . . : %d", HOOK_PROCESS(ptr_hook, child_pid)); log_printf (" hook_fd[stdout] . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd[HOOK_PROCESS_STDOUT])); log_printf (" hook_fd[stderr] . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd[HOOK_PROCESS_STDERR])); log_printf (" hook_timer. . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_timer)); } break; case HOOK_TYPE_CONNECT: if (!ptr_hook->deleted) { log_printf (" connect data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, callback)); log_printf (" address . . . . . . . : '%s'", HOOK_CONNECT(ptr_hook, address)); log_printf (" port. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, port)); log_printf (" sock. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, sock)); log_printf (" ipv6. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, ipv6)); log_printf (" retry . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, retry)); #ifdef HAVE_GNUTLS log_printf (" gnutls_sess . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, gnutls_sess)); log_printf (" gnutls_cb . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, gnutls_cb)); log_printf (" gnutls_dhkey_size . . : %d", HOOK_CONNECT(ptr_hook, gnutls_dhkey_size)); log_printf (" gnutls_priorities . . : '%s'", HOOK_CONNECT(ptr_hook, gnutls_priorities)); #endif log_printf (" local_hostname. . . . : '%s'", HOOK_CONNECT(ptr_hook, local_hostname)); log_printf (" child_read. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_read)); log_printf (" child_write . . . . . : %d", HOOK_CONNECT(ptr_hook, child_write)); log_printf (" child_recv. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_recv)); log_printf (" child_send. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_send)); log_printf (" child_pid . . . . . . : %d", HOOK_CONNECT(ptr_hook, child_pid)); log_printf (" hook_child_timer. . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_child_timer)); log_printf (" hook_fd . . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_fd)); log_printf (" handshake_hook_fd . . : 0x%lx", HOOK_CONNECT(ptr_hook, handshake_hook_fd)); log_printf (" handshake_hook_timer. : 0x%lx", HOOK_CONNECT(ptr_hook, handshake_hook_timer)); log_printf (" handshake_fd_flags. . : %d", HOOK_CONNECT(ptr_hook, handshake_fd_flags)); log_printf (" handshake_ip_address. : '%s'", HOOK_CONNECT(ptr_hook, handshake_ip_address)); #ifdef HOOK_CONNECT_MAX_SOCKETS for (i = 0; i < HOOK_CONNECT_MAX_SOCKETS; i++) { log_printf (" sock_v4[%d]. . . . . . : '%d'", HOOK_CONNECT(ptr_hook, sock_v4[i])); log_printf (" sock_v6[%d]. . . . . . : '%d'", HOOK_CONNECT(ptr_hook, sock_v6[i])); } #endif } break; case HOOK_TYPE_PRINT: if (!ptr_hook->deleted) { log_printf (" print data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, callback)); log_printf (" buffer. . . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, buffer)); log_printf (" tags_count. . . . . . : %d", HOOK_PRINT(ptr_hook, tags_count)); log_printf (" tags_array. . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, tags_array)); log_printf (" message . . . . . . . : '%s'", HOOK_PRINT(ptr_hook, message)); log_printf (" strip_colors. . . . . : %d", HOOK_PRINT(ptr_hook, strip_colors)); } break; case HOOK_TYPE_SIGNAL: if (!ptr_hook->deleted) { log_printf (" signal data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_SIGNAL(ptr_hook, callback)); log_printf (" signal. . . . . . . . : '%s'", HOOK_SIGNAL(ptr_hook, signal)); } break; case HOOK_TYPE_HSIGNAL: if (!ptr_hook->deleted) { log_printf (" signal data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_HSIGNAL(ptr_hook, callback)); log_printf (" signal. . . . . . . . : '%s'", HOOK_HSIGNAL(ptr_hook, signal)); } break; case HOOK_TYPE_CONFIG: if (!ptr_hook->deleted) { log_printf (" config data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_CONFIG(ptr_hook, callback)); log_printf (" option. . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, option)); } break; case HOOK_TYPE_COMPLETION: if (!ptr_hook->deleted) { log_printf (" completion data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMPLETION(ptr_hook, callback)); log_printf (" completion_item . . . : '%s'", HOOK_COMPLETION(ptr_hook, completion_item)); log_printf (" description . . . . . : '%s'", HOOK_COMPLETION(ptr_hook, description)); } break; case HOOK_TYPE_MODIFIER: if (!ptr_hook->deleted) { log_printf (" modifier data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_MODIFIER(ptr_hook, callback)); log_printf (" modifier. . . . . . . : '%s'", HOOK_MODIFIER(ptr_hook, modifier)); } break; case HOOK_TYPE_INFO: if (!ptr_hook->deleted) { log_printf (" info data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFO(ptr_hook, callback)); log_printf (" info_name . . . . . . : '%s'", HOOK_INFO(ptr_hook, info_name)); log_printf (" description . . . . . : '%s'", HOOK_INFO(ptr_hook, description)); log_printf (" args_description. . . : '%s'", HOOK_INFO(ptr_hook, args_description)); } break; case HOOK_TYPE_INFO_HASHTABLE: if (!ptr_hook->deleted) { log_printf (" info_hashtable data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFO_HASHTABLE(ptr_hook, callback)); log_printf (" info_name . . . . . . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, info_name)); log_printf (" description . . . . . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, description)); log_printf (" args_description. . . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, args_description)); log_printf (" output_description. . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, output_description)); } break; case HOOK_TYPE_INFOLIST: if (!ptr_hook->deleted) { log_printf (" infolist data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFOLIST(ptr_hook, callback)); log_printf (" infolist_name . . . . : '%s'", HOOK_INFOLIST(ptr_hook, infolist_name)); log_printf (" description . . . . . : '%s'", HOOK_INFOLIST(ptr_hook, description)); log_printf (" pointer_description . : '%s'", HOOK_INFOLIST(ptr_hook, pointer_description)); log_printf (" args_description. . . : '%s'", HOOK_INFOLIST(ptr_hook, args_description)); } break; case HOOK_TYPE_HDATA: if (!ptr_hook->deleted) { log_printf (" hdata data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_HDATA(ptr_hook, callback)); log_printf (" hdata_name. . . . . . : '%s'", HOOK_HDATA(ptr_hook, hdata_name)); log_printf (" description . . . . . : '%s'", HOOK_HDATA(ptr_hook, description)); } break; case HOOK_TYPE_FOCUS: if (!ptr_hook->deleted) { log_printf (" focus data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_FOCUS(ptr_hook, callback)); log_printf (" area. . . . . . . . . : '%s'", HOOK_FOCUS(ptr_hook, area)); } break; case HOOK_NUM_TYPES: /* * this constant is used to count types only, * it is never used as type */ break; } log_printf (" prev_hook . . . . . . . : 0x%lx", ptr_hook->prev_hook); log_printf (" next_hook . . . . . . . : 0x%lx", ptr_hook->next_hook); } } }
hook_print_log () { int type, i, j; struct t_hook *ptr_hook; struct tm *local_time; char text_time[1024]; for (type = 0; type < HOOK_NUM_TYPES; type++) { for (ptr_hook = weechat_hooks[type]; ptr_hook; ptr_hook = ptr_hook->next_hook) { log_printf (""); log_printf ("[hook (addr:0x%lx)]", ptr_hook); log_printf (" plugin. . . . . . . . . : 0x%lx ('%s')", ptr_hook->plugin, plugin_get_name (ptr_hook->plugin)); log_printf (" subplugin . . . . . . . : '%s'", ptr_hook->subplugin); log_printf (" type. . . . . . . . . . : %d (%s)", ptr_hook->type, hook_type_string[ptr_hook->type]); log_printf (" deleted . . . . . . . . : %d", ptr_hook->deleted); log_printf (" running . . . . . . . . : %d", ptr_hook->running); log_printf (" priority. . . . . . . . : %d", ptr_hook->priority); log_printf (" callback_data . . . . . : 0x%lx", ptr_hook->callback_data); switch (ptr_hook->type) { case HOOK_TYPE_COMMAND: if (!ptr_hook->deleted) { log_printf (" command data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMMAND(ptr_hook, callback)); log_printf (" command . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, command)); log_printf (" description . . . . . : '%s'", HOOK_COMMAND(ptr_hook, description)); log_printf (" args. . . . . . . . . : '%s'", HOOK_COMMAND(ptr_hook, args)); log_printf (" args_description. . . : '%s'", HOOK_COMMAND(ptr_hook, args_description)); log_printf (" completion. . . . . . : '%s'", HOOK_COMMAND(ptr_hook, completion)); log_printf (" cplt_num_templates. . : %d", HOOK_COMMAND(ptr_hook, cplt_num_templates)); for (i = 0; i < HOOK_COMMAND(ptr_hook, cplt_num_templates); i++) { log_printf (" cplt_templates[%04d] . . . : '%s'", i, HOOK_COMMAND(ptr_hook, cplt_templates)[i]); log_printf (" cplt_templates_static[%04d]: '%s'", i, HOOK_COMMAND(ptr_hook, cplt_templates_static)[i]); log_printf (" num_args. . . . . . : %d", HOOK_COMMAND(ptr_hook, cplt_template_num_args)[i]); for (j = 0; j < HOOK_COMMAND(ptr_hook, cplt_template_num_args)[i]; j++) { log_printf (" args[%04d]. . . . . : '%s'", j, HOOK_COMMAND(ptr_hook, cplt_template_args)[i][j]); } } log_printf (" num_args_concat . . . : %d", HOOK_COMMAND(ptr_hook, cplt_template_num_args_concat)); for (i = 0; i < HOOK_COMMAND(ptr_hook, cplt_template_num_args_concat); i++) { log_printf (" args_concat[%04d] . . : '%s'", i, HOOK_COMMAND(ptr_hook, cplt_template_args_concat)[i]); } } break; case HOOK_TYPE_COMMAND_RUN: if (!ptr_hook->deleted) { log_printf (" command_run data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMMAND_RUN(ptr_hook, callback)); log_printf (" command . . . . . . . : '%s'", HOOK_COMMAND_RUN(ptr_hook, command)); } break; case HOOK_TYPE_TIMER: if (!ptr_hook->deleted) { log_printf (" timer data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_TIMER(ptr_hook, callback)); log_printf (" interval. . . . . . . : %ld", HOOK_TIMER(ptr_hook, interval)); log_printf (" align_second. . . . . : %d", HOOK_TIMER(ptr_hook, align_second)); log_printf (" remaining_calls . . . : %d", HOOK_TIMER(ptr_hook, remaining_calls)); text_time[0] = '\0'; local_time = localtime (&HOOK_TIMER(ptr_hook, last_exec).tv_sec); if (local_time) { strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); } log_printf (" last_exec.tv_sec. . . : %ld (%s)", HOOK_TIMER(ptr_hook, last_exec.tv_sec), text_time); log_printf (" last_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, last_exec.tv_usec)); text_time[0] = '\0'; local_time = localtime (&HOOK_TIMER(ptr_hook, next_exec).tv_sec); if (local_time) { strftime (text_time, sizeof (text_time), "%d/%m/%Y %H:%M:%S", local_time); } log_printf (" next_exec.tv_sec. . . : %ld (%s)", HOOK_TIMER(ptr_hook, next_exec.tv_sec), text_time); log_printf (" next_exec.tv_usec . . : %ld", HOOK_TIMER(ptr_hook, next_exec.tv_usec)); } break; case HOOK_TYPE_FD: if (!ptr_hook->deleted) { log_printf (" fd data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_FD(ptr_hook, callback)); log_printf (" fd. . . . . . . . . . : %d", HOOK_FD(ptr_hook, fd)); log_printf (" flags . . . . . . . . : %d", HOOK_FD(ptr_hook, flags)); log_printf (" error . . . . . . . . : %d", HOOK_FD(ptr_hook, error)); } break; case HOOK_TYPE_PROCESS: if (!ptr_hook->deleted) { log_printf (" process data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, callback)); log_printf (" command . . . . . . . : '%s'", HOOK_PROCESS(ptr_hook, command)); log_printf (" options . . . . . . . : 0x%lx (hashtable: '%s')", HOOK_PROCESS(ptr_hook, options), hashtable_get_string (HOOK_PROCESS(ptr_hook, options), "keys_values")); log_printf (" timeout . . . . . . . : %d", HOOK_PROCESS(ptr_hook, timeout)); log_printf (" child_read[stdout]. . : %d", HOOK_PROCESS(ptr_hook, child_read[HOOK_PROCESS_STDOUT])); log_printf (" child_write[stdout] . : %d", HOOK_PROCESS(ptr_hook, child_write[HOOK_PROCESS_STDOUT])); log_printf (" child_read[stderr]. . : %d", HOOK_PROCESS(ptr_hook, child_read[HOOK_PROCESS_STDERR])); log_printf (" child_write[stderr] . : %d", HOOK_PROCESS(ptr_hook, child_write[HOOK_PROCESS_STDERR])); log_printf (" child_pid . . . . . . : %d", HOOK_PROCESS(ptr_hook, child_pid)); log_printf (" hook_fd[stdout] . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd[HOOK_PROCESS_STDOUT])); log_printf (" hook_fd[stderr] . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_fd[HOOK_PROCESS_STDERR])); log_printf (" hook_timer. . . . . . : 0x%lx", HOOK_PROCESS(ptr_hook, hook_timer)); } break; case HOOK_TYPE_CONNECT: if (!ptr_hook->deleted) { log_printf (" connect data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, callback)); log_printf (" address . . . . . . . : '%s'", HOOK_CONNECT(ptr_hook, address)); log_printf (" port. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, port)); log_printf (" sock. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, sock)); log_printf (" ipv6. . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, ipv6)); log_printf (" retry . . . . . . . . : %d", HOOK_CONNECT(ptr_hook, retry)); #ifdef HAVE_GNUTLS log_printf (" gnutls_sess . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, gnutls_sess)); log_printf (" gnutls_cb . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, gnutls_cb)); log_printf (" gnutls_dhkey_size . . : %d", HOOK_CONNECT(ptr_hook, gnutls_dhkey_size)); log_printf (" gnutls_priorities . . : '%s'", HOOK_CONNECT(ptr_hook, gnutls_priorities)); #endif log_printf (" local_hostname. . . . : '%s'", HOOK_CONNECT(ptr_hook, local_hostname)); log_printf (" child_read. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_read)); log_printf (" child_write . . . . . : %d", HOOK_CONNECT(ptr_hook, child_write)); log_printf (" child_recv. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_recv)); log_printf (" child_send. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_send)); log_printf (" child_pid . . . . . . : %d", HOOK_CONNECT(ptr_hook, child_pid)); log_printf (" hook_child_timer. . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_child_timer)); log_printf (" hook_fd . . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, hook_fd)); log_printf (" handshake_hook_fd . . : 0x%lx", HOOK_CONNECT(ptr_hook, handshake_hook_fd)); log_printf (" handshake_hook_timer. : 0x%lx", HOOK_CONNECT(ptr_hook, handshake_hook_timer)); log_printf (" handshake_fd_flags. . : %d", HOOK_CONNECT(ptr_hook, handshake_fd_flags)); log_printf (" handshake_ip_address. : '%s'", HOOK_CONNECT(ptr_hook, handshake_ip_address)); #ifdef HOOK_CONNECT_MAX_SOCKETS for (i = 0; i < HOOK_CONNECT_MAX_SOCKETS; i++) { log_printf (" sock_v4[%d]. . . . . . : '%d'", HOOK_CONNECT(ptr_hook, sock_v4[i])); log_printf (" sock_v6[%d]. . . . . . : '%d'", HOOK_CONNECT(ptr_hook, sock_v6[i])); } #endif } break; case HOOK_TYPE_PRINT: if (!ptr_hook->deleted) { log_printf (" print data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, callback)); log_printf (" buffer. . . . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, buffer)); log_printf (" tags_count. . . . . . : %d", HOOK_PRINT(ptr_hook, tags_count)); log_printf (" tags_array. . . . . . : 0x%lx", HOOK_PRINT(ptr_hook, tags_array)); log_printf (" message . . . . . . . : '%s'", HOOK_PRINT(ptr_hook, message)); log_printf (" strip_colors. . . . . : %d", HOOK_PRINT(ptr_hook, strip_colors)); } break; case HOOK_TYPE_SIGNAL: if (!ptr_hook->deleted) { log_printf (" signal data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_SIGNAL(ptr_hook, callback)); log_printf (" signal. . . . . . . . : '%s'", HOOK_SIGNAL(ptr_hook, signal)); } break; case HOOK_TYPE_HSIGNAL: if (!ptr_hook->deleted) { log_printf (" signal data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_HSIGNAL(ptr_hook, callback)); log_printf (" signal. . . . . . . . : '%s'", HOOK_HSIGNAL(ptr_hook, signal)); } break; case HOOK_TYPE_CONFIG: if (!ptr_hook->deleted) { log_printf (" config data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_CONFIG(ptr_hook, callback)); log_printf (" option. . . . . . . . : '%s'", HOOK_CONFIG(ptr_hook, option)); } break; case HOOK_TYPE_COMPLETION: if (!ptr_hook->deleted) { log_printf (" completion data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_COMPLETION(ptr_hook, callback)); log_printf (" completion_item . . . : '%s'", HOOK_COMPLETION(ptr_hook, completion_item)); log_printf (" description . . . . . : '%s'", HOOK_COMPLETION(ptr_hook, description)); } break; case HOOK_TYPE_MODIFIER: if (!ptr_hook->deleted) { log_printf (" modifier data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_MODIFIER(ptr_hook, callback)); log_printf (" modifier. . . . . . . : '%s'", HOOK_MODIFIER(ptr_hook, modifier)); } break; case HOOK_TYPE_INFO: if (!ptr_hook->deleted) { log_printf (" info data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFO(ptr_hook, callback)); log_printf (" info_name . . . . . . : '%s'", HOOK_INFO(ptr_hook, info_name)); log_printf (" description . . . . . : '%s'", HOOK_INFO(ptr_hook, description)); log_printf (" args_description. . . : '%s'", HOOK_INFO(ptr_hook, args_description)); } break; case HOOK_TYPE_INFO_HASHTABLE: if (!ptr_hook->deleted) { log_printf (" info_hashtable data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFO_HASHTABLE(ptr_hook, callback)); log_printf (" info_name . . . . . . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, info_name)); log_printf (" description . . . . . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, description)); log_printf (" args_description. . . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, args_description)); log_printf (" output_description. . : '%s'", HOOK_INFO_HASHTABLE(ptr_hook, output_description)); } break; case HOOK_TYPE_INFOLIST: if (!ptr_hook->deleted) { log_printf (" infolist data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_INFOLIST(ptr_hook, callback)); log_printf (" infolist_name . . . . : '%s'", HOOK_INFOLIST(ptr_hook, infolist_name)); log_printf (" description . . . . . : '%s'", HOOK_INFOLIST(ptr_hook, description)); log_printf (" pointer_description . : '%s'", HOOK_INFOLIST(ptr_hook, pointer_description)); log_printf (" args_description. . . : '%s'", HOOK_INFOLIST(ptr_hook, args_description)); } break; case HOOK_TYPE_HDATA: if (!ptr_hook->deleted) { log_printf (" hdata data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_HDATA(ptr_hook, callback)); log_printf (" hdata_name. . . . . . : '%s'", HOOK_HDATA(ptr_hook, hdata_name)); log_printf (" description . . . . . : '%s'", HOOK_HDATA(ptr_hook, description)); } break; case HOOK_TYPE_FOCUS: if (!ptr_hook->deleted) { log_printf (" focus data:"); log_printf (" callback. . . . . . . : 0x%lx", HOOK_FOCUS(ptr_hook, callback)); log_printf (" area. . . . . . . . . : '%s'", HOOK_FOCUS(ptr_hook, area)); } break; case HOOK_NUM_TYPES: /* * this constant is used to count types only, * it is never used as type */ break; } log_printf (" prev_hook . . . . . . . : 0x%lx", ptr_hook->prev_hook); log_printf (" next_hook . . . . . . . : 0x%lx", ptr_hook->next_hook); } } }
C
savannah
0
CVE-2018-6094
https://www.cvedetails.com/cve/CVE-2018-6094/
CWE-119
https://github.com/chromium/chromium/commit/0749ec24fae74ec32d0567eef0e5ec43c84dbcb9
0749ec24fae74ec32d0567eef0e5ec43c84dbcb9
Call HeapObjectHeader::checkHeader solely for its side-effect. This requires changing its signature. This is a preliminary stage to making it private. BUG=633030 Review-Url: https://codereview.chromium.org/2698673003 Cr-Commit-Position: refs/heads/master@{#460489}
bool LargeObjectPage::isEmpty() { return !heapObjectHeader()->isMarked(); }
bool LargeObjectPage::isEmpty() { return !heapObjectHeader()->isMarked(); }
C
Chrome
0
CVE-2016-5219
https://www.cvedetails.com/cve/CVE-2016-5219/
CWE-416
https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae
a4150b688a754d3d10d2ca385155b1c95d77d6ae
Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM This makes the query of GL_COMPLETION_STATUS_KHR to programs much cheaper by minimizing the round-trip to the GPU thread. Bug: 881152, 957001 Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630 Commit-Queue: Kenneth Russell <[email protected]> Reviewed-by: Kentaro Hara <[email protected]> Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#657568}
void GLES2DecoderImpl::DoFramebufferTextureMultiviewOVR( GLenum target, GLenum attachment, GLuint client_texture_id, GLint level, GLint base_view_index, GLsizei num_views) { NOTREACHED(); }
void GLES2DecoderImpl::DoFramebufferTextureMultiviewOVR( GLenum target, GLenum attachment, GLuint client_texture_id, GLint level, GLint base_view_index, GLsizei num_views) { NOTREACHED(); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/d30a8bd191f17b61938fc87890bffc80049b0774
d30a8bd191f17b61938fc87890bffc80049b0774
[Extensions] Rework inline installation observation Instead of observing through the WebstoreAPI, observe directly in the TabHelper. This is a great deal less code, more direct, and also fixes a lifetime issue with the TabHelper being deleted before the inline installation completes. BUG=613949 Review-Url: https://codereview.chromium.org/2103663002 Cr-Commit-Position: refs/heads/master@{#403188}
WebstoreInlineInstallerTest() : WebstoreInstallerTest( kWebstoreDomain, kTestDataPath, kCrxFilename, kAppDomain, kNonAppDomain) {}
WebstoreInlineInstallerTest() : WebstoreInstallerTest( kWebstoreDomain, kTestDataPath, kCrxFilename, kAppDomain, kNonAppDomain) {}
C
Chrome
0
CVE-2015-1335
https://www.cvedetails.com/cve/CVE-2015-1335/
CWE-59
https://github.com/lxc/lxc/commit/592fd47a6245508b79fe6ac819fe6d3b2c1289be
592fd47a6245508b79fe6ac819fe6d3b2c1289be
CVE-2015-1335: Protect container mounts against symlinks When a container starts up, lxc sets up the container's inital fstree by doing a bunch of mounting, guided by the container configuration file. The container config is owned by the admin or user on the host, so we do not try to guard against bad entries. However, since the mount target is in the container, it's possible that the container admin could divert the mount with symbolic links. This could bypass proper container startup (i.e. confinement of a root-owned container by the restrictive apparmor policy, by diverting the required write to /proc/self/attr/current), or bypass the (path-based) apparmor policy by diverting, say, /proc to /mnt in the container. To prevent this, 1. do not allow mounts to paths containing symbolic links 2. do not allow bind mounts from relative paths containing symbolic links. Details: Define safe_mount which ensures that the container has not inserted any symbolic links into any mount targets for mounts to be done during container setup. The host's mount path may contain symbolic links. As it is under the control of the administrator, that's ok. So safe_mount begins the check for symbolic links after the rootfs->mount, by opening that directory. It opens each directory along the path using openat() relative to the parent directory using O_NOFOLLOW. When the target is reached, it mounts onto /proc/self/fd/<targetfd>. Use safe_mount() in mount_entry(), when mounting container proc, and when needed. In particular, safe_mount() need not be used in any case where: 1. the mount is done in the container's namespace 2. the mount is for the container's rootfs 3. the mount is relative to a tmpfs or proc/sysfs which we have just safe_mount()ed ourselves Since we were using proc/net as a temporary placeholder for /proc/sys/net during container startup, and proc/net is a symbolic link, use proc/tty instead. Update the lxc.container.conf manpage with details about the new restrictions. Finally, add a testcase to test some symbolic link possibilities. Reported-by: Roman Fiedler Signed-off-by: Serge Hallyn <[email protected]> Acked-by: Stéphane Graber <[email protected]>
void lxc_conf_free(struct lxc_conf *conf) { if (!conf) return; if (current_config == conf) current_config = NULL; free(conf->console.log_path); free(conf->console.path); free(conf->rootfs.mount); free(conf->rootfs.options); free(conf->rootfs.path); free(conf->rootfs.pivot); free(conf->logfile); if (conf->logfd != -1) close(conf->logfd); free(conf->utsname); free(conf->ttydir); free(conf->fstab); free(conf->rcfile); free(conf->init_cmd); free(conf->unexpanded_config); free(conf->pty_names); lxc_clear_config_network(conf); free(conf->lsm_aa_profile); free(conf->lsm_se_context); lxc_seccomp_free(conf); lxc_clear_config_caps(conf); lxc_clear_config_keepcaps(conf); lxc_clear_cgroups(conf, "lxc.cgroup"); lxc_clear_hooks(conf, "lxc.hook"); lxc_clear_mount_entries(conf); lxc_clear_saved_nics(conf); lxc_clear_idmaps(conf); lxc_clear_groups(conf); lxc_clear_includes(conf); lxc_clear_aliens(conf); lxc_clear_environment(conf); free(conf); }
void lxc_conf_free(struct lxc_conf *conf) { if (!conf) return; if (current_config == conf) current_config = NULL; free(conf->console.log_path); free(conf->console.path); free(conf->rootfs.mount); free(conf->rootfs.options); free(conf->rootfs.path); free(conf->rootfs.pivot); free(conf->logfile); if (conf->logfd != -1) close(conf->logfd); free(conf->utsname); free(conf->ttydir); free(conf->fstab); free(conf->rcfile); free(conf->init_cmd); free(conf->unexpanded_config); free(conf->pty_names); lxc_clear_config_network(conf); free(conf->lsm_aa_profile); free(conf->lsm_se_context); lxc_seccomp_free(conf); lxc_clear_config_caps(conf); lxc_clear_config_keepcaps(conf); lxc_clear_cgroups(conf, "lxc.cgroup"); lxc_clear_hooks(conf, "lxc.hook"); lxc_clear_mount_entries(conf); lxc_clear_saved_nics(conf); lxc_clear_idmaps(conf); lxc_clear_groups(conf); lxc_clear_includes(conf); lxc_clear_aliens(conf); lxc_clear_environment(conf); free(conf); }
C
lxc
0
CVE-2017-5120
https://www.cvedetails.com/cve/CVE-2017-5120/
null
https://github.com/chromium/chromium/commit/b7277af490d28ac7f802c015bb0ff31395768556
b7277af490d28ac7f802c015bb0ff31395768556
bindings: Support "attribute FrozenArray<T>?" Adds a quick hack to support a case of "attribute FrozenArray<T>?". Bug: 1028047 Change-Id: Ib3cecc4beb6bcc0fb0dbc667aca595454cc90c86 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1933866 Reviewed-by: Hitoshi Yoshida <[email protected]> Commit-Queue: Yuki Shiino <[email protected]> Cr-Commit-Position: refs/heads/master@{#718676}
void V8TestObject::DeprecateAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_DeprecateAsSameValueOverloadedMethod"); test_object_v8_internal::DeprecateAsSameValueOverloadedMethodMethod(info); }
void V8TestObject::DeprecateAsSameValueOverloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_DeprecateAsSameValueOverloadedMethod"); test_object_v8_internal::DeprecateAsSameValueOverloadedMethodMethod(info); }
C
Chrome
0
CVE-2013-6621
https://www.cvedetails.com/cve/CVE-2013-6621/
CWE-399
https://github.com/chromium/chromium/commit/4039d2fcaab746b6c20017ba9bb51c3a2403a76c
4039d2fcaab746b6c20017ba9bb51c3a2403a76c
Add logging to figure out which IPC we're failing to deserialize in RenderFrame. BUG=369553 [email protected] Review URL: https://codereview.chromium.org/263833020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268565 0039d316-1c4b-4281-b951-d872f2087c98
void RenderFrameImpl::willInsertBody(blink::WebLocalFrame* frame) { DCHECK(!frame_ || frame_ == frame); if (!frame->parent()) { render_view_->Send(new ViewHostMsg_WillInsertBody( render_view_->GetRoutingID())); } }
void RenderFrameImpl::willInsertBody(blink::WebLocalFrame* frame) { DCHECK(!frame_ || frame_ == frame); if (!frame->parent()) { render_view_->Send(new ViewHostMsg_WillInsertBody( render_view_->GetRoutingID())); } }
C
Chrome
0
CVE-2018-13405
https://www.cvedetails.com/cve/CVE-2018-13405/
CWE-269
https://github.com/torvalds/linux/commit/0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7
0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7
Fix up non-directory creation in SGID directories sgid directories have special semantics, making newly created files in the directory belong to the group of the directory, and newly created subdirectories will also become sgid. This is historically used for group-shared directories. But group directories writable by non-group members should not imply that such non-group members can magically join the group, so make sure to clear the sgid bit on non-directories for non-members (but remember that sgid without group execute means "mandatory locking", just to confuse things even more). Reported-by: Jann Horn <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran) { /* Avoid division in the common cases 1 ns and 1 s. */ if (gran == 1) { /* nothing */ } else if (gran == NSEC_PER_SEC) { t.tv_nsec = 0; } else if (gran > 1 && gran < NSEC_PER_SEC) { t.tv_nsec -= t.tv_nsec % gran; } else { WARN(1, "illegal file time granularity: %u", gran); } return t; }
struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran) { /* Avoid division in the common cases 1 ns and 1 s. */ if (gran == 1) { /* nothing */ } else if (gran == NSEC_PER_SEC) { t.tv_nsec = 0; } else if (gran > 1 && gran < NSEC_PER_SEC) { t.tv_nsec -= t.tv_nsec % gran; } else { WARN(1, "illegal file time granularity: %u", gran); } return t; }
C
linux
0
CVE-2011-2861
https://www.cvedetails.com/cve/CVE-2011-2861/
CWE-20
https://github.com/chromium/chromium/commit/8262245d384be025f13e2a5b3a03b7e5c98374ce
8262245d384be025f13e2a5b3a03b7e5c98374ce
DevTools: move DevToolsAgent/Client into content. BUG=84078 TEST= Review URL: http://codereview.chromium.org/7461019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93596 0039d316-1c4b-4281-b951-d872f2087c98
void RenderView::OnConnectTcpACK( int request_id, IPC::PlatformFileForTransit socket_for_transit, const PP_Flash_NetAddress& local_addr, const PP_Flash_NetAddress& remote_addr) { pepper_delegate_.OnConnectTcpACK( request_id, IPC::PlatformFileForTransitToPlatformFile(socket_for_transit), local_addr, remote_addr); }
void RenderView::OnConnectTcpACK( int request_id, IPC::PlatformFileForTransit socket_for_transit, const PP_Flash_NetAddress& local_addr, const PP_Flash_NetAddress& remote_addr) { pepper_delegate_.OnConnectTcpACK( request_id, IPC::PlatformFileForTransitToPlatformFile(socket_for_transit), local_addr, remote_addr); }
C
Chrome
0
CVE-2013-6630
https://www.cvedetails.com/cve/CVE-2013-6630/
CWE-189
https://github.com/chromium/chromium/commit/805eabb91d386c86bd64336c7643f6dfa864151d
805eabb91d386c86bd64336c7643f6dfa864151d
Convert ARRAYSIZE_UNSAFE -> arraysize in base/. [email protected] BUG=423134 Review URL: https://codereview.chromium.org/656033009 Cr-Commit-Position: refs/heads/master@{#299835}
size_t CancelableSyncSocket::ReceiveWithTimeout(void* buffer, size_t length, TimeDelta timeout) { return CancelableFileOperation( &ReadFile, handle_, reinterpret_cast<char*>(buffer), length, &file_operation_, &shutdown_event_, this, static_cast<DWORD>(timeout.InMilliseconds())); }
size_t CancelableSyncSocket::ReceiveWithTimeout(void* buffer, size_t length, TimeDelta timeout) { return CancelableFileOperation( &ReadFile, handle_, reinterpret_cast<char*>(buffer), length, &file_operation_, &shutdown_event_, this, static_cast<DWORD>(timeout.InMilliseconds())); }
C
Chrome
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
static void spawn_reactor_thread(reactor_t *reactor) { int ret = pthread_create(&thread, NULL, reactor_thread, reactor); EXPECT_EQ(ret, 0); }
static void spawn_reactor_thread(reactor_t *reactor) { int ret = pthread_create(&thread, NULL, reactor_thread, reactor); EXPECT_EQ(ret, 0); }
C
Android
0