id
int64
0
3.29k
file_name
stringlengths
4
37
programming_language
stringclasses
2 values
method_name
stringlengths
3
112
code_before
stringlengths
701
809k
code_after
stringlengths
701
809k
func_before
stringlengths
40
60.4k
func_after
stringlengths
43
61.2k
diff
stringlengths
67
133k
num_lines_added
int64
1
1.49k
num_lines_deleted
int64
1
1.13k
num_lines_in_file
float64
23
18.6k
num_tokens_in_file
float64
129
172k
num_lines_in_method
int64
1
259
num_tokens_in_method
int64
10
1.29k
method_complexity
int64
1
110
repo
stringclasses
267 values
cve_id
stringlengths
13
16
cwe_id
stringclasses
8 values
2,815
eval.c
C
init_evalarg
/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. */ /* * eval.c: Expression evaluation. */ #d...
/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. */ /* * eval.c: Expression evaluation. */ #d...
init_evalarg(evalarg_T *evalarg) { CLEAR_POINTER(evalarg); ga_init2(&evalarg->eval_tofree_ga, sizeof(char_u *), 20); }
init_evalarg(evalarg_T *evalarg) { CLEAR_POINTER(evalarg); ga_init2(&evalarg->eval_tofree_ga, sizeof(char_u *), 20); }
{'added': [(356, '/*'), (357, ' * Initialize "evalarg" for use.'), (358, ' */'), (359, ' void'), (360, 'init_evalarg(evalarg_T *evalarg)'), (361, '{'), (362, ' CLEAR_POINTER(evalarg);'), (363, ' ga_init2(&evalarg->eval_tofree_ga, sizeof(char_u *), 20);'), (364, '}'), (365, ''), (366, '/*'), (367, ' * If "evala...
60
42
5,145
27,604
5
29
1
https://github.com/vim/vim
CVE-2022-2889
CWE-416
1,761
proc.c
C
mrb_proc_init_copy
/* ** proc.c - Proc class ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/class.h> #include <mruby/proc.h> #include <mruby/opcode.h> #include <mruby/data.h> #include <mruby/presym.h> #include <mruby/array.h> #include <mruby/hash.h> static const mrb_code call_iseq[] = { OP_CALL, }; stati...
/* ** proc.c - Proc class ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/class.h> #include <mruby/proc.h> #include <mruby/opcode.h> #include <mruby/data.h> #include <mruby/presym.h> #include <mruby/array.h> #include <mruby/hash.h> static const mrb_code call_iseq[] = { OP_CALL, }; stati...
mrb_proc_init_copy(mrb_state *mrb, mrb_value self) { mrb_value proc = mrb_get_arg1(mrb); if (!mrb_proc_p(proc)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "not a proc"); } mrb_proc_copy(mrb_proc_ptr(self), mrb_proc_ptr(proc)); return self; }
mrb_proc_init_copy(mrb_state *mrb, mrb_value self) { mrb_value proc = mrb_get_arg1(mrb); if (!mrb_proc_p(proc)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "not a proc"); } mrb_proc_copy(mrb, mrb_proc_ptr(self), mrb_proc_ptr(proc)); return self; }
{'added': [(204, 'mrb_proc_copy(mrb_state *mrb, struct RProc *a, struct RProc *b)'), (212, ' a->upper = b->upper;'), (214, ' mrb_irep_incref(mrb, (mrb_irep*)a->body.irep);'), (230, ' mrb_proc_copy(mrb, p, mrb_proc_ptr(blk));'), (248, ' mrb_proc_copy(mrb, mrb_proc_ptr(self), mrb_proc_ptr(proc));'), (284, ' mrb_...
6
6
364
2,483
9
54
2
https://github.com/mruby/mruby
CVE-2021-4110
CWE-476
923
vf_vignette.c
C
filter_frame
/* * Copyright (c) 2013 Clément Bœsch * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any lat...
/* * Copyright (c) 2013 Clément Bœsch * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any lat...
static int filter_frame(AVFilterLink *inlink, AVFrame *in) { unsigned x, y; AVFilterContext *ctx = inlink->dst; VignetteContext *s = ctx->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; AVFrame *out; out = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!out) { av_f...
static int filter_frame(AVFilterLink *inlink, AVFrame *in) { unsigned x, y; AVFilterContext *ctx = inlink->dst; VignetteContext *s = ctx->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; AVFrame *out; out = ff_get_video_buffer(outlink, outlink->w, outlink->h); if (!out) { av_f...
{'added': [(242, ' for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {')], 'deleted': [(242, ' for (plane = 0; plane < 4 && in->data[plane]; plane++) {')]}
1
1
267
2,095
65
599
14
https://github.com/FFmpeg/FFmpeg
CVE-2013-4263
CWE-119
979
segment.c
C
build_segment_manager
/* * fs/f2fs/segment.c * * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include...
/* * fs/f2fs/segment.c * * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include...
int build_segment_manager(struct f2fs_sb_info *sbi) { struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi); struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); struct f2fs_sm_info *sm_info; int err; sm_info = kzalloc(sizeof(struct f2fs_sm_info), GFP_KERNEL); if (!sm_info) return -ENOMEM; /* init sm info */ s...
int build_segment_manager(struct f2fs_sb_info *sbi) { struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi); struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); struct f2fs_sm_info *sm_info; int err; sm_info = kzalloc(sizeof(struct f2fs_sm_info), GFP_KERNEL); if (!sm_info) return -ENOMEM; /* init sm info */ s...
{'added': [(569, '\tif (!test_opt(sbi, FLUSH_MERGE))'), (570, '\t\treturn err;'), (571, ''), (3246, '\tif (!f2fs_readonly(sbi->sb)) {')], 'deleted': [(3243, '\tif (test_opt(sbi, FLUSH_MERGE) && !f2fs_readonly(sbi->sb)) {')]}
4
1
2,659
17,637
53
340
12
https://github.com/torvalds/linux
CVE-2017-18241
CWE-476
1,436
i2c.c
C
get_alen
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009 * Sergey Kubushyn, himself, ksi@koi8.net * * Changes for unified multibus/multiadapter I2C support. * * (C) Copyright 2001 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. */ /* * I2C Functions similar to the standard memory functions. * * T...
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009 * Sergey Kubushyn, himself, ksi@koi8.net * * Changes for unified multibus/multiadapter I2C support. * * (C) Copyright 2001 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. */ /* * I2C Functions similar to the standard memory functions. * * T...
static uint get_alen(char *arg, int default_len) { int j; int alen; alen = default_len; for (j = 0; j < 8; j++) { if (arg[j] == '.') { alen = arg[j+1] - '0'; break; } else if (arg[j] == '\0') break; } return alen; }
static uint get_alen(char *arg, uint default_len) { uint j; uint alen; alen = default_len; for (j = 0; j < 8; j++) { if (arg[j] == '.') { alen = arg[j+1] - '0'; break; } else if (arg[j] == '\0') break; } return alen; }
{'added': [(203, 'static uint get_alen(char *arg, uint default_len)'), (205, '\tuint\tj;'), (206, '\tuint\talen;'), (250, '\tuint\talen;'), (304, '\tuint\talen;'), (472, '\tuint\talen;'), (473, '\tuint\tj, nbytes, linebytes;'), (592, '\tuint\talen;'), (594, '\tuint\tcount;'), (679, '\tuint\talen;'), (680, '\tuint\tcoun...
12
12
1,240
7,675
14
75
4
https://github.com/u-boot/u-boot
CVE-2022-34835
CWE-787
1,430
i2c.c
C
do_i2c_crc
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009 * Sergey Kubushyn, himself, ksi@koi8.net * * Changes for unified multibus/multiadapter I2C support. * * (C) Copyright 2001 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. */ /* * I2C Functions similar to the standard memory functions. * * T...
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009 * Sergey Kubushyn, himself, ksi@koi8.net * * Changes for unified multibus/multiadapter I2C support. * * (C) Copyright 2001 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. */ /* * I2C Functions similar to the standard memory functions. * * T...
static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { uint chip; ulong addr; int alen; int count; uchar byte; ulong crc; ulong err; int ret = 0; #if CONFIG_IS_ENABLED(DM_I2C) struct udevice *dev; #endif if (argc < 4) return CMD_RET_USAGE; /* * Chip is always spe...
static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { uint chip; ulong addr; uint alen; uint count; uchar byte; ulong crc; ulong err; int ret = 0; #if CONFIG_IS_ENABLED(DM_I2C) struct udevice *dev; #endif if (argc < 4) return CMD_RET_USAGE; /* * Chip is always s...
{'added': [(203, 'static uint get_alen(char *arg, uint default_len)'), (205, '\tuint\tj;'), (206, '\tuint\talen;'), (250, '\tuint\talen;'), (304, '\tuint\talen;'), (472, '\tuint\talen;'), (473, '\tuint\tj, nbytes, linebytes;'), (592, '\tuint\talen;'), (594, '\tuint\tcount;'), (679, '\tuint\talen;'), (680, '\tuint\tcoun...
12
12
1,240
7,675
42
266
12
https://github.com/u-boot/u-boot
CVE-2022-34835
CWE-787
1,511
jp2_cod.c
C
jp2_box_create
/* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image P...
/* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2002 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image P...
jp2_box_t *jp2_box_create(int type) { jp2_box_t *box; jp2_boxinfo_t *boxinfo; if (!(box = jas_malloc(sizeof(jp2_box_t)))) { return 0; } memset(box, 0, sizeof(jp2_box_t)); box->type = type; box->len = 0; if (!(boxinfo = jp2_boxinfolookup(type))) { return 0; } box->info = boxinfo; box->ops = &boxinfo->ops...
jp2_box_t *jp2_box_create(int type) { jp2_box_t *box; jp2_boxinfo_t *boxinfo; if (!(box = jp2_box_create0())) { return 0; } box->type = type; box->len = 0; if (!(boxinfo = jp2_boxinfolookup(type))) { return 0; } box->info = boxinfo; box->ops = &boxinfo->ops; return box; }
{'added': [(186, 'jp2_box_t *jp2_box_create0()'), (193, '\tbox->type = 0;'), (194, '\tbox->len = 0;'), (195, '\t// Mark the box data as never having been constructed'), (196, '\t// so that we will not errantly attempt to destroy it later.'), (197, '\tbox->ops = &jp2_boxinfo_unk.ops;'), (198, '\treturn box;'), (199, '}'...
30
14
747
5,052
17
94
3
https://github.com/mdadams/jasper
CVE-2017-6850
CWE-476
1,650
acsequentialscan.hpp
C++
ACSequentialScan::QMContextSet::DCContextMagnitudeSet::Init
/************************************************************************* This project implements a complete(!) JPEG (Recommendation ITU-T T.81 | ISO/IEC 10918-1) codec, plus a library that can be used to encode and decode JPEG streams. It also implements ISO/IEC 18477 aka JPEG XT which is an extensi...
/************************************************************************* This project implements a complete(!) JPEG (Recommendation ITU-T T.81 | ISO/IEC 10918-1) codec, plus a library that can be used to encode and decode JPEG streams. It also implements ISO/IEC 18477 aka JPEG XT which is an extensi...
void Init(void) { for(int i = 0;i < 19;i++) { #ifdef DEBUG_QMCODER char string[5] = "X0 "; string[1] = (i / 10) + '0'; string[2] = (i % 10) + '0'; X[i].Init(string); string[0] = 'M'; M[i].Init(string); #else X[i].Init(); ...
void Init(void) { for(int i = 0;i < MagnitudeContexts;i++) { #ifdef DEBUG_QMCODER char string[5] = "X0 "; string[1] = (i / 10) + '0'; string[2] = (i % 10) + '0'; X[i].Init(string); string[0] = 'M'; M[i].Init(string); #else X[i].I...
{'added': [(46, '** $Id: acsequentialscan.hpp,v 1.39 2022/05/23 05:56:51 thor Exp $'), (123, ' enum {'), (124, ' MagnitudeContexts = 19'), (125, ' };'), (126, ' //'), (127, ' QMContext X[MagnitudeContexts];'), (128, ' QMContext M[MagnitudeContexts];'), (133, ' for(int i = 0;i < Ma...
16
9
178
1,116
13
101
3
https://github.com/thorfdbg/libjpeg
CVE-2022-31620
CWE-119
538
huffman.c
C
Huff_offsetReceive
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset) { bloc = *offset; while (node && node->symbol == INTERNAL_NODE) { if (get_bit(fin)) { node = node->right; } else { node = node->left; } } if (!node) { *ch = 0; return; // Com_Error(ERR_DROP, "Illegal tree!"); } *ch = node->sy...
void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset, int maxoffset) { bloc = *offset; while (node && node->symbol == INTERNAL_NODE) { if (bloc >= maxoffset) { *ch = 0; *offset = maxoffset + 1; return; } if (get_bit(fin)) { node = node->right; } else { node = node->left; } ...
{'added': [(282, 'void Huff_offsetReceive (node_t *node, int *ch, byte *fin, int *offset, int maxoffset) {'), (285, '\t\tif (bloc >= maxoffset) {'), (286, '\t\t\t*ch = 0;'), (287, '\t\t\t*offset = maxoffset + 1;'), (288, '\t\t\treturn;'), (289, '\t\t}'), (306, 'static void send(node_t *node, node_t *child, byte *fout, ...
18
9
350
2,578
16
87
5
https://github.com/ioquake/ioq3
CVE-2017-11721
CWE-119
2,298
zend-string.cpp
C++
HPHP::string_number_format
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
String string_number_format(double d, int dec, const String& dec_point, const String& thousand_sep) { char *tmpbuf = nullptr, *resbuf; char *s, *t; /* source, target */ char *dp; int integral; int tmplen, reslen=0; int count=0; int is_negative=0; ...
String string_number_format(double d, int dec, const String& dec_point, const String& thousand_sep) { char *tmpbuf = nullptr, *resbuf; char *s, *t; /* source, target */ char *dp; int integral; int tmplen, reslen=0; int count=0; int is_negative=0; ...
{'added': [(1621, " // This actually means 63 bytes for characters + 1 byte for '\\0'"), (1625, ' // From the man page of snprintf, the return value is:'), (1626, ' // The number of characters that would have been written if n had been'), (1627, ' // sufficiently large, not counting the terminating null character.'...
5
1
1,941
16,443
98
657
29
https://github.com/facebook/hhvm
CVE-2019-11929
CWE-119
3,067
hns_dsaf_xgmac.c
C
hns_xgmac_get_sset_count
/* * Copyright (c) 2014-2015 Hisilicon Limited. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include <l...
/* * Copyright (c) 2014-2015 Hisilicon Limited. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include <l...
static int hns_xgmac_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS) return ARRAY_SIZE(g_xgmac_stats_string); return 0; }
static int hns_xgmac_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS) return ARRAY_SIZE(g_xgmac_stats_string); return 0; }
{'added': [(784, '\tif (stringset == ETH_SS_STATS || stringset == ETH_SS_PRIV_FLAGS)')], 'deleted': [(784, '\tif (stringset == ETH_SS_STATS)')]}
1
1
632
5,357
6
22
2
https://github.com/torvalds/linux
CVE-2017-18222
CWE-119
3,284
events_base.c
C
clear_evtchn_to_irq_row
// SPDX-License-Identifier: GPL-2.0-only /* * Xen event channels * * Xen models interrupts with abstract event channels. Because each * domain gets 1024 event channels, but NR_IRQ is not that large, we * must dynamically map irqs<->event channels. The event channels * interface with the rest of the kernel by de...
// SPDX-License-Identifier: GPL-2.0-only /* * Xen event channels * * Xen models interrupts with abstract event channels. Because each * domain gets 1024 event channels, but NR_IRQ is not that large, we * must dynamically map irqs<->event channels. The event channels * interface with the rest of the kernel by de...
static void clear_evtchn_to_irq_row(unsigned row) { unsigned col; for (col = 0; col < EVTCHN_PER_ROW; col++) evtchn_to_irq[row][col] = -1; }
static void clear_evtchn_to_irq_row(unsigned row) { unsigned col; for (col = 0; col < EVTCHN_PER_ROW; col++) WRITE_ONCE(evtchn_to_irq[row][col], -1); }
{'added': [(36, '#include <linux/spinlock.h>'), (75, '/*'), (76, ' * Lock protecting event handling loop against removing event channels.'), (77, ' * Adding of event channels is no issue as the associated IRQ becomes active'), (78, ' * only after everything is setup (before request_[threaded_]irq() the handler'), (79, ...
36
5
1,214
6,641
6
34
2
https://github.com/torvalds/linux
CVE-2020-27675
CWE-362
2,411
cil_reset_ast.c
C
cil_reset_classperms_set
#include "cil_internal.h" #include "cil_log.h" #include "cil_list.h" #include "cil_reset_ast.h" #include "cil_symtab.h" static inline void cil_reset_classperms_list(struct cil_list *cp_list); static inline void cil_reset_level(struct cil_level *level); static inline void cil_reset_levelrange(struct cil_levelrange *le...
#include "cil_internal.h" #include "cil_log.h" #include "cil_list.h" #include "cil_reset_ast.h" #include "cil_symtab.h" static inline void cil_reset_classperms_list(struct cil_list *cp_list); static inline void cil_reset_level(struct cil_level *level); static inline void cil_reset_levelrange(struct cil_levelrange *le...
static void cil_reset_classperms_set(struct cil_classperms_set *cp_set) { cil_reset_classpermission(cp_set->set); }
static void cil_reset_classperms_set(struct cil_classperms_set *cp_set) { if (cp_set == NULL) { return; } cp_set->set = NULL; }
{'added': [(62, '\tif (cp_set == NULL) {'), (63, '\t\treturn;'), (64, '\t}'), (65, ''), (66, '\tcp_set->set = NULL;')], 'deleted': [(62, '\tcil_reset_classpermission(cp_set->set);')]}
5
1
505
2,377
4
16
1
https://github.com/SELinuxProject/selinux
CVE-2021-36086
CWE-416
380
str.c
C++
caml_bitvect_test
/***********************************************************************/ /* */ /* OCaml */ /* */ /* Xavier Ler...
/***********************************************************************/ /* */ /* OCaml */ /* */ /* Xavier Ler...
CAMLprim value caml_bitvect_test(value bv, value n) { int pos = Int_val(n); return Val_int(Byte_u(bv, pos >> 3) & (1 << (pos & 7))); }
CAMLprim value caml_bitvect_test(value bv, value n) { intnat pos = Long_val(n); return Val_int(Byte_u(bv, pos >> 3) & (1 << (pos & 7))); }
{'added': [(269, ' memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Long_val(n));'), (281, ' intnat pos = Long_val(n);')], 'deleted': [(269, ' memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Int_val(n));'), (281, ' int pos = Int_val(n);')]}
2
2
259
2,103
5
43
1
https://github.com/ocaml/ocaml
CVE-2015-8869
CWE-119
1,295
pixel-accessor.h
C
GetPixelChannel
/* Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required ...
/* Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. You may obtain a copy of the License at https://imagemagick.org/script/license.php Unless required ...
static inline Quantum GetPixelChannel(const Image *magick_restrict image, const PixelChannel channel,const Quantum *magick_restrict pixel) { if (image->channel_map[channel].traits == UndefinedPixelTrait) return((Quantum) 0); return(pixel[image->channel_map[channel].offset]); }
static inline Quantum GetPixelChannel(const Image *magick_restrict image, const PixelChannel channel,const Quantum *magick_restrict pixel) { if (image->channel_map[image->channel_map[channel].offset].traits == UndefinedPixelTrait) return((Quantum) 0); return(pixel[image->channel_map[channel].offset]); }
{'added': [(114, ' if (image->channel_map[image->channel_map[channel].offset].traits == UndefinedPixelTrait)')], 'deleted': [(114, ' if (image->channel_map[channel].traits == UndefinedPixelTrait)')]}
1
1
740
5,255
7
56
2
https://github.com/ImageMagick/ImageMagick
CVE-2019-13299
CWE-125
1,786
catc.c
C
catc_probe
/* * Copyright (c) 2001 Vojtech Pavlik * * CATC EL1210A NetMate USB Ethernet driver * * Sponsored by SuSE * * Based on the work of * Donald Becker * * Old chipset support added by Simon Evans <spse@secret.org.uk> 2002 * - adds support for Belkin F5U011 */ /* * This program is free software; you ...
/* * Copyright (c) 2001 Vojtech Pavlik * * CATC EL1210A NetMate USB Ethernet driver * * Sponsored by SuSE * * Based on the work of * Donald Becker * * Old chipset support added by Simon Evans <spse@secret.org.uk> 2002 * - adds support for Belkin F5U011 */ /* * This program is free software; you ...
static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct device *dev = &intf->dev; struct usb_device *usbdev = interface_to_usbdev(intf); struct net_device *netdev; struct catc *catc; u8 broadcast[ETH_ALEN]; int i, pktsz, ret; if (usb_set_interface(usbdev, intf->altsetting->...
static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct device *dev = &intf->dev; struct usb_device *usbdev = interface_to_usbdev(intf); struct net_device *netdev; struct catc *catc; u8 broadcast[ETH_ALEN]; int pktsz, ret; if (usb_set_interface(usbdev, intf->altsetting->des...
{'added': [(779, '\tint pktsz, ret;'), (843, '\t\tu32 *buf;'), (844, '\t\tint i;'), (845, ''), (848, '\t\tbuf = kmalloc(4, GFP_KERNEL);'), (849, '\t\tif (!buf) {'), (850, '\t\t\tret = -ENOMEM;'), (851, '\t\t\tgoto fail_free;'), (852, '\t\t}'), (853, ''), (854, '\t\t*buf = 0x12345678;'), (855, '\t\tcatc_write_mem(catc, ...
18
7
694
4,711
125
976
17
https://github.com/torvalds/linux
CVE-2017-8070
CWE-119
2,008
PcxDecode.c
C
ImagingPcxDecode
/* * The Python Imaging Library. * $Id$ * * decoder for PCX image data. * * history: * 95-09-14 fl Created * * Copyright (c) Fredrik Lundh 1995. * Copyright (c) Secret Labs AB 1997. * * See the README file for information on usage and redistribution. */ #include "Imaging.h" int ImagingPcxDecode(Imaging ...
/* * The Python Imaging Library. * $Id$ * * decoder for PCX image data. * * history: * 95-09-14 fl Created * * Copyright (c) Fredrik Lundh 1995. * Copyright (c) Secret Labs AB 1997. * * See the README file for information on usage and redistribution. */ #include "Imaging.h" int ImagingPcxDecode(Imaging ...
ImagingPcxDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8 n; UINT8* ptr; if (strcmp(im->mode, "1") == 0 && state->xsize > state->bytes * 8) { state->errcode = IMAGING_CODEC_OVERRUN; return -1; } else if (strcmp(im->mode, "P") == 0 && state->xsize > stat...
ImagingPcxDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8 n; UINT8* ptr; if ((state->xsize * state->bits + 7) / 8 > state->bytes) { state->errcode = IMAGING_CODEC_OVERRUN; return -1; } ptr = buf; for (;;) { if (bytes < 1) return ptr - b...
{'added': [(25, ' if ((state->xsize * state->bits + 7) / 8 > state->bytes) {')], 'deleted': [(25, ' if (strcmp(im->mode, "1") == 0 && state->xsize > state->bytes * 8) {'), (26, ' state->errcode = IMAGING_CODEC_OVERRUN;'), (27, ' return -1;'), (28, ' } else if (strcmp(im->mode, "P") == 0 && state-...
1
4
52
352
53
386
16
https://github.com/python-pillow/Pillow
CVE-2020-10378
CWE-125
197
pooling.cc
C++
tflite::ops::builtin::pooling::MaxEval
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus MaxEval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLitePoolParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); TfLiteTensor* output = GetOutput(context, node, 0); const TfLiteTensor* input = GetInput(context, node, 0); switc...
TfLiteStatus MaxEval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLitePoolParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); TfLiteTensor* output; TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output)); const TfLiteTensor* i...
{'added': [(74, ' TfLiteTensor* output;'), (75, ' TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));'), (76, ' const TfLiteTensor* input;'), (77, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));'), (373, ' TfLiteTensor* output;'), (374, ' TF_LITE_ENSURE_OK(context, GetOutpu...
16
8
325
2,047
28
191
5
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
227
shm.c
C
shm_destroy
/* * linux/ipc/shm.c * Copyright (C) 1992, 1993 Krishna Balasubramanian * Many improvements/fixes by Bruno Haible. * Replaced `struct shm_desc' by `struct vm_area_struct', July 1994. * Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli. * * /proc/sysvipc/shm support (c) 1999 Dragos Acos...
/* * linux/ipc/shm.c * Copyright (C) 1992, 1993 Krishna Balasubramanian * Many improvements/fixes by Bruno Haible. * Replaced `struct shm_desc' by `struct vm_area_struct', July 1994. * Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli. * * /proc/sysvipc/shm support (c) 1999 Dragos Acos...
static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) { ns->shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT; shm_rmid(ns, shp); shm_unlock(shp); if (!is_file_hugepages(shp->shm_file)) shmem_lock(shp->shm_file, 0, shp->mlock_user); else if (shp->mlock_user) user_shm_unlock(file_i...
static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) { struct file *shm_file; shm_file = shp->shm_file; shp->shm_file = NULL; ns->shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT; shm_rmid(ns, shp); shm_unlock(shp); if (!is_file_hugepages(shm_file)) shmem_lock(shm_file, 0, shp-...
{'added': [(211, '\tstruct file *shm_file;'), (212, ''), (213, '\tshm_file = shp->shm_file;'), (214, '\tshp->shm_file = NULL;'), (218, '\tif (!is_file_hugepages(shm_file))'), (219, '\t\tshmem_lock(shm_file, 0, shp->mlock_user);'), (221, '\t\tuser_shm_unlock(file_inode(shm_file)->i_size, shp->mlock_user);'), (222, '\tfp...
23
5
947
5,897
13
103
3
https://github.com/torvalds/linux
CVE-2013-7026
CWE-362
176
vgacon.c
C
vgacon_startup
/* * linux/drivers/video/vgacon.c -- Low level VGA based console driver * * Created 28 Sep 1997 by Geert Uytterhoeven * * Rewritten by Martin Mares <mj@ucw.cz>, July 1998 * * This file is based on the old console.c, vga.c and vesa_blank.c drivers. * * Copyright (C) 1991, 1992 Linus Torvalds * 1995 J...
/* * linux/drivers/video/vgacon.c -- Low level VGA based console driver * * Created 28 Sep 1997 by Geert Uytterhoeven * * Rewritten by Martin Mares <mj@ucw.cz>, July 1998 * * This file is based on the old console.c, vga.c and vesa_blank.c drivers. * * Copyright (C) 1991, 1992 Linus Torvalds * 1995 J...
static const char *vgacon_startup(void) { const char *display_desc = NULL; u16 saved1, saved2; volatile u16 *p; if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB || screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) { no_vga: #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; return conswitchp->co...
static const char *vgacon_startup(void) { const char *display_desc = NULL; u16 saved1, saved2; volatile u16 *p; if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB || screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) { no_vga: #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; return conswitchp->co...
{'added': [(363, '\tvga_init_done = true;')], 'deleted': [(168, '#ifdef CONFIG_VGACON_SOFT_SCROLLBACK'), (169, '/* software scrollback */'), (170, 'struct vgacon_scrollback_info {'), (171, '\tvoid *data;'), (172, '\tint tail;'), (173, '\tint size;'), (174, '\tint rows;'), (175, '\tint cnt;'), (176, '\tint cur;'), (177,...
1
220
906
5,743
152
840
25
https://github.com/torvalds/linux
CVE-2020-28097
CWE-125
1,075
lsh_projection.cc
C++
tflite::ops::builtin::lsh_projection::Resize
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus Resize(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteLSHProjectionParams*>(node->builtin_data); TF_LITE_ENSURE(context, NumInputs(node) == 2 || NumInputs(node) == 3); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* hash = GetInput(cont...
TfLiteStatus Resize(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteLSHProjectionParams*>(node->builtin_data); TF_LITE_ENSURE(context, NumInputs(node) == 2 || NumInputs(node) == 3); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* hash; TF_LITE_ENSU...
{'added': [(76, ' const TfLiteTensor* hash;'), (77, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &hash));'), (82, ' const TfLiteTensor* input;'), (83, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 1, &input));'), (87, ' const TfLiteTensor* weight;'), (88, ' TF_LITE_ENSURE_OK(context,...
15
7
129
1,007
30
272
5
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
2,110
ipv6_routing.c
C
ipv6AddRoute
/** * @file ipv6_routing.c * @brief IPv6 routing * * @section License * * SPDX-License-Identifier: GPL-2.0-or-later * * Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved. * * This file is part of CycloneTCP Open. * * This program is free software; you can redistribute it and/or * modify it un...
/** * @file ipv6_routing.c * @brief IPv6 routing * * @section License * * SPDX-License-Identifier: GPL-2.0-or-later * * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved. * * This file is part of CycloneTCP Open. * * This program is free software; you can redistribute it and/or * modify it un...
error_t ipv6AddRoute(const Ipv6Addr *prefix, uint_t prefixLen, NetInterface *interface, const Ipv6Addr *nextHop, uint_t metric) { error_t error; uint_t i; Ipv6RoutingTableEntry *entry; Ipv6RoutingTableEntry *firstFreeEntry; //Check parameters if(prefix == NULL || interface == NULL) return ER...
error_t ipv6AddRoute(const Ipv6Addr *prefix, uint_t prefixLen, NetInterface *interface, const Ipv6Addr *nextHop, uint_t metric) { error_t error; uint_t i; Ipv6RoutingTableEntry *entry; Ipv6RoutingTableEntry *firstFreeEntry; //Check parameters if(prefix == NULL || interface == NULL) return ER...
{'added': [(9, ' * Copyright (C) 2010-2021 Oryx Embedded SARL. All rights reserved.'), (28, ' * @version 2.0.2'), (172, ' //Successful processing')], 'deleted': [(9, ' * Copyright (C) 2010-2020 Oryx Embedded SARL. All rights reserved.'), (28, ' * @version 2.0.0'), (172, ' //Sucessful processing')]}
3
3
325
1,488
50
220
11
https://github.com/Oryx-Embedded/CycloneTCP
CVE-2021-26788
CWE-20
3,235
ip6_tables.c
C
get_chainname_rulenum
/* * Packet matching code. * * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling * Copyright (C) 2000-2005 Netfilter Core Team <coreteam@netfilter.org> * Copyright (c) 2006-2010 Patrick McHardy <kaber@trash.net> * * This program is free software; you can redistribute it and/or modify * it under the t...
/* * Packet matching code. * * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling * Copyright (C) 2000-2005 Netfilter Core Team <coreteam@netfilter.org> * Copyright (c) 2006-2010 Patrick McHardy <kaber@trash.net> * * This program is free software; you can redistribute it and/or modify * it under the t...
get_chainname_rulenum(const struct ip6t_entry *s, const struct ip6t_entry *e, const char *hookname, const char **chainname, const char **comment, unsigned int *rulenum) { const struct xt_standard_target *t = (void *)ip6t_get_target_c(s); if (strcmp(t->target.u.kernel.target->name, XT_ERROR_TARGET) ==...
get_chainname_rulenum(const struct ip6t_entry *s, const struct ip6t_entry *e, const char *hookname, const char **chainname, const char **comment, unsigned int *rulenum) { const struct xt_standard_target *t = (void *)ip6t_get_target_c(s); if (strcmp(t->target.u.kernel.target->name, XT_ERROR_TARGET) ==...
{'added': [(201, 'static inline bool unconditional(const struct ip6t_entry *e)'), (205, '\treturn e->target_offset == sizeof(struct ip6t_entry) &&'), (206, '\t memcmp(&e->ipv6, &uncond, sizeof(uncond)) == 0;'), (262, '\t\tif (unconditional(s) &&'), (265, '\t\t t->verdict < 0) {'), (491, '\t\t\tif ((uncondition...
11
12
1,806
11,126
24
183
8
https://github.com/torvalds/linux
CVE-2016-3134
CWE-119
891
av_parsers.c
C
gf_avc_read_pps_bs_internal
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre, Romain Bouqueau, Cyril Concolato * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it unde...
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre, Romain Bouqueau, Cyril Concolato * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it unde...
static s32 gf_avc_read_pps_bs_internal(GF_BitStream *bs, AVCState *avc, u32 nal_hdr) { s32 pps_id; AVC_PPS *pps; gf_bs_enable_emulation_byte_removal(bs, GF_TRUE); if (!nal_hdr) { gf_bs_read_int_log(bs, 1, "forbidden_zero_bit"); gf_bs_read_int_log(bs, 2, "nal_ref_idc"); gf_bs_read_int_log(bs, 5, "nal_unit_ty...
static s32 gf_avc_read_pps_bs_internal(GF_BitStream *bs, AVCState *avc, u32 nal_hdr) { s32 pps_id; AVC_PPS *pps; gf_bs_enable_emulation_byte_removal(bs, GF_TRUE); if (!nal_hdr) { gf_bs_read_int_log(bs, 1, "forbidden_zero_bit"); gf_bs_read_int_log(bs, 2, "nal_ref_idc"); gf_bs_read_int_log(bs, 5, "nal_unit_ty...
{'added': [(5118, '\tif ((sps_id < 0) || (sps_id >= 32)) {'), (5447, '\tif ((pps_id<0) || (pps_id >= 255)) {'), (5455, '\tif ((pps->sps_id<0) || (pps->sps_id >= 32)) {'), (6843, '\tif ((pps_id<0) || (pps_id >= 64))'), (7666, '\tif ((vps_id<0) || (vps_id >= 16)) return -1;'), (7895, '\tif ((vps_id<0) || (vps_id >= 16)) ...
12
15
8,400
60,423
67
552
17
https://github.com/gpac/gpac
CVE-2021-30014
CWE-190
3,008
nsc_encode.c
C
nsc_encode_argb_to_aycocg
/** * FreeRDP: A Remote Desktop Protocol Implementation * NSCodec Encoder * * Copyright 2012 Vic Lee * Copyright 2016 Armin Novak <armin.novak@thincast.com> * Copyright 2016 Thincast Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in comp...
/** * FreeRDP: A Remote Desktop Protocol Implementation * NSCodec Encoder * * Copyright 2012 Vic Lee * Copyright 2016 Armin Novak <armin.novak@thincast.com> * Copyright 2016 Thincast Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in comp...
static void nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data, UINT32 scanline) { UINT16 x; UINT16 y; UINT16 rw; BYTE ccl; const BYTE* src; BYTE* yplane = NULL; BYTE* coplane = NULL; BYTE* cgplane = NULL; BYTE* aplane = NULL; INT16 r_val; INT16 g_val; INT...
static BOOL nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data, UINT32 scanline) { UINT16 x; UINT16 y; UINT16 rw; BYTE ccl; const BYTE* src; BYTE* yplane = NULL; BYTE* coplane = NULL; BYTE* cgplane = NULL; BYTE* aplane = NULL; INT16 r_val; INT16 g_val; INT...
{'added': [(54, ''), (91, 'static BOOL nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data,'), (108, ''), (109, '\tif (!context || data || (scanline == 0))'), (110, '\t\treturn FALSE;'), (111, ''), (116, '\tif (context->priv->PlaneBuffersLength < rw * scanline)'), (117, '\t\treturn FALSE;'), (118, ''), (11...
44
18
513
3,961
137
1,107
19
https://github.com/FreeRDP/FreeRDP
CVE-2018-8788
CWE-787
2,454
HexOutStream.cxx
C++
HexOutStream::HexOutStream
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Thi...
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Thi...
HexOutStream::HexOutStream(OutStream& os, int buflen) : out_stream(os), offset(0), bufSize(buflen ? buflen : DEFAULT_BUF_LEN) { if (bufSize % 2) bufSize--; ptr = start = new U8[bufSize]; end = start + bufSize; }
HexOutStream::HexOutStream(OutStream& os, size_t buflen) : out_stream(os), offset(0), bufSize(buflen ? buflen : DEFAULT_BUF_LEN) { if (bufSize % 2) bufSize--; ptr = start = new U8[bufSize]; end = start + bufSize; }
{'added': [(26, 'static inline size_t min(size_t a, size_t b) {return a<b ? a : b;}'), (28, 'HexOutStream::HexOutStream(OutStream& os, size_t buflen)'), (51, 'char* HexOutStream::binToHexStr(const char* data, size_t length) {'), (53, ' for (size_t i=0; i<length; i++) {'), (73, ' size_t length = min(ptr-pos, (oend-o...
10
10
73
537
8
57
2
https://github.com/CendioOssman/tigervnc
CVE-2019-15694
CWE-787
3,026
cipso_ipv4.c
C
cipso_v4_sock_getattr
/* * CIPSO - Commercial IP Security Option * * This is an implementation of the CIPSO 2.2 protocol as specified in * draft-ietf-cipso-ipsecurity-01.txt with additional tag types as found in * FIPS-188. While CIPSO never became a full IETF RFC standard many vendors * have chosen to adopt the protocol and over the...
/* * CIPSO - Commercial IP Security Option * * This is an implementation of the CIPSO 2.2 protocol as specified in * draft-ietf-cipso-ipsecurity-01.txt with additional tag types as found in * FIPS-188. While CIPSO never became a full IETF RFC standard many vendors * have chosen to adopt the protocol and over the...
int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr) { struct ip_options *opt; opt = inet_sk(sk)->opt; if (opt == NULL || opt->cipso == 0) return -ENOMSG; return cipso_v4_getattr(opt->__data + opt->cipso - sizeof(struct iphdr), secattr); }
int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr) { struct ip_options_rcu *opt; int res = -ENOMSG; rcu_read_lock(); opt = rcu_dereference(inet_sk(sk)->inet_opt); if (opt && opt->opt.cipso) res = cipso_v4_getattr(opt->opt.__data + opt->opt.cipso - sizeof(struct iphdr), ...
{'added': [(1860, 'static void opt_kfree_rcu(struct rcu_head *head)'), (1861, '{'), (1862, '\tkfree(container_of(head, struct ip_options_rcu, rcu));'), (1863, '}'), (1864, ''), (1887, '\tstruct ip_options_rcu *old, *opt = NULL;'), (1923, '\tmemcpy(opt->opt.__data, buf, buf_len);'), (1924, '\topt->opt.optlen = opt_len;'...
63
50
1,360
7,485
9
64
3
https://github.com/torvalds/linux
CVE-2012-3552
CWE-362
1,525
unistr.cpp
C++
UnicodeString::doAppend
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * Copyright (C) 1999-2016, International Business Machines Corporation and * others. All Rights Reserved. ********************...
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ****************************************************************************** * Copyright (C) 1999-2016, International Business Machines Corporation and * others. All Rights Reserved. ********************...
UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLength) { if(!isWritable() || srcLength == 0 || srcChars == NULL) { return *this; } // Perform all remaining operations relative to srcChars + srcStart. // From this point forward, do not use srcStart. srcChars += srcStart; if...
UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLength) { if(!isWritable() || srcLength == 0 || srcChars == NULL) { return *this; } // Perform all remaining operations relative to srcChars + srcStart. // From this point forward, do not use srcStart. srcChars += srcStart; if...
{'added': [(1566, ' int32_t newLength;'), (1567, ' if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {'), (1568, ' setToBogus();'), (1569, ' return *this;'), (1570, ' }')], 'deleted': [(1566, ' int32_t newLength = oldLength + srcLength;')]}
5
1
1,437
8,275
33
218
14
https://github.com/unicode-org/icu
CVE-2020-10531
CWE-787
3,167
filter_manager.cc
C++
Envoy::Http::ActiveStreamDecoderFilter::complete
#include "source/common/http/filter_manager.h" #include <functional> #include "envoy/http/header_map.h" #include "envoy/matcher/matcher.h" #include "source/common/common/enum_to_int.h" #include "source/common/common/scope_tracked_object_stack.h" #include "source/common/common/scope_tracker.h" #include "source/common...
#include "source/common/http/filter_manager.h" #include <functional> #include "envoy/http/header_map.h" #include "envoy/matcher/matcher.h" #include "source/common/common/enum_to_int.h" #include "source/common/common/scope_tracked_object_stack.h" #include "source/common/common/scope_tracker.h" #include "source/common...
bool ActiveStreamDecoderFilter::complete() { return parent_.state_.remote_complete_; }
bool ActiveStreamDecoderFilter::complete() { return parent_.state_.remote_decode_complete_; }
{'added': [(306, 'bool ActiveStreamEncoderFilter::canContinue() {'), (307, ' // As with ActiveStreamDecoderFilter::canContinue() make sure we do not'), (308, ' // continue if a local reply has been sent.'), (309, ' return !parent_.state_.remote_encode_complete_;'), (310, '}'), (311, ''), (325, 'bool ActiveStreamDeco...
12
3
1,216
8,866
1
14
1
https://github.com/envoyproxy/envoy
CVE-2021-43825
CWE-416
2,974
rtadv.c
C
rtadv_read
/* Router advertisement * Copyright (C) 2005 6WIND <jean-mickael.guerin@6wind.com> * Copyright (C) 1999 Kunihiro Ishiguro * * This file is part of GNU Zebra. * * GNU Zebra is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free So...
/* Router advertisement * Copyright (C) 2005 6WIND <jean-mickael.guerin@6wind.com> * Copyright (C) 1999 Kunihiro Ishiguro * * This file is part of GNU Zebra. * * GNU Zebra is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free So...
rtadv_read (struct thread *thread) { int sock; int len; u_char buf[RTADV_MSG_SIZE]; struct sockaddr_in6 from; ifindex_t ifindex = 0; int hoplimit = -1; struct zebra_vrf *zvrf = THREAD_ARG (thread); sock = THREAD_FD (thread); zvrf->rtadv.ra_read = NULL; /* Register myself. */ rtadv_event (zvrf, R...
rtadv_read (struct thread *thread) { int sock; int len; u_char buf[RTADV_MSG_SIZE]; struct sockaddr_in6 from; ifindex_t ifindex = 0; int hoplimit = -1; struct zebra_vrf *zvrf = THREAD_ARG (thread); sock = THREAD_FD (thread); zvrf->rtadv.ra_read = NULL; /* Register myself. */ rtadv_event (zvrf, R...
{'added': [(485, ' len = rtadv_recv_packet (sock, buf, sizeof (buf), &from, &ifindex, &hoplimit);')], 'deleted': [(485, ' len = rtadv_recv_packet (sock, buf, BUFSIZ, &from, &ifindex, &hoplimit);')]}
1
1
1,425
6,821
21
132
2
https://github.com/Quagga/quagga
CVE-2016-1245
CWE-119
3,044
bus-polkit.c
C
bus_verify_polkit_async
/* SPDX-License-Identifier: LGPL-2.1+ */ #include "bus-internal.h" #include "bus-message.h" #include "bus-polkit.h" #include "strv.h" #include "user-util.h" static int check_good_user(sd_bus_message *m, uid_t good_user) { _cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL; uid_t sender_uid; ...
/* SPDX-License-Identifier: LGPL-2.1+ */ #include "bus-internal.h" #include "bus-message.h" #include "bus-polkit.h" #include "strv.h" #include "user-util.h" static int check_good_user(sd_bus_message *m, uid_t good_user) { _cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL; uid_t sender_uid; ...
int bus_verify_polkit_async( sd_bus_message *call, int capability, const char *action, const char **details, bool interactive, uid_t good_user, Hashmap **registry, sd_bus_error *ret_error) { ...
int bus_verify_polkit_async( sd_bus_message *call, int capability, const char *action, const char **details, bool interactive, uid_t good_user, Hashmap **registry, sd_bus_error *ret_error) { ...
{'added': [(163, ''), (165, ' sd_event_source *defer_event_source;'), (183, ' sd_event_source_disable_unref(q->defer_event_source);'), (187, 'static int async_polkit_defer(sd_event_source *s, void *userdata) {'), (188, ' AsyncPolkitQuery *q = userdata;'), (189, ''), (190, ' assert(s);'), (19...
50
26
290
1,631
125
701
32
https://github.com/systemd/systemd
CVE-2020-1712
CWE-416
2,435
activations.cc
C++
tflite::ops::builtin::activations::SoftmaxEval
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus SoftmaxEval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteSoftmaxParams*>(node->builtin_data); SoftmaxOpData* data = reinterpret_cast<SoftmaxOpData*>(node->user_data); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(conte...
TfLiteStatus SoftmaxEval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteSoftmaxParams*>(node->builtin_data); SoftmaxOpData* data = reinterpret_cast<SoftmaxOpData*>(node->user_data); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));...
{'added': [(255, ' const TfLiteTensor* input;'), (256, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));'), (257, ' TfLiteTensor* output;'), (258, ' TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));'), (277, ' const TfLiteTensor* input;'), (278, ' TF_LITE_ENSURE_OK(context,...
88
44
1,316
9,729
51
282
9
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
3,259
rdppm.c
C
get_word_rgb_row
/* * rdppm.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 2009 by Bill Allombert, Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2015-2017, D. R. Commander. * For conditions of distribution and use, see the accompanying ...
/* * rdppm.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 2009 by Bill Allombert, Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2015-2017, D. R. Commander. * For conditions of distribution and use, see the accompanying ...
get_word_rgb_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading raw-word-format PPM files with any maxval */ { ppm_source_ptr source = (ppm_source_ptr)sinfo; register JSAMPROW ptr; register U_CHAR *bufferptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; unsigned...
get_word_rgb_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading raw-word-format PPM files with any maxval */ { ppm_source_ptr source = (ppm_source_ptr)sinfo; register JSAMPROW ptr; register U_CHAR *bufferptr; register JSAMPLE *rescale = source->rescale; JDIMENSION col; unsigned...
{'added': [(78, ' unsigned int maxval;'), (128, ' ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);'), (512, ' ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);'), (539, ' ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);'), (544, ' ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);'), (549, ' ERREXIT(cinfo, JERR_PPM_OUTOFRANGE);')], 'deleted': [(...
6
6
541
3,909
32
244
6
https://github.com/libjpeg-turbo/libjpeg-turbo
CVE-2018-14498
CWE-125
767
print-ip.c
C
ip_printroute
/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above co...
/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above co...
ip_printroute(netdissect_options *ndo, register const u_char *cp, u_int length) { register u_int ptr; register u_int len; if (length < 3) { ND_PRINT((ndo, " [bad length %u]", length)); return; } if ((length + 1) & 3) ND_PRINT((ndo, " [bad length %u]", length)); ptr = cp[2] - 1; if (ptr < 3 |...
ip_printroute(netdissect_options *ndo, register const u_char *cp, u_int length) { register u_int ptr; register u_int len; if (length < 3) { ND_PRINT((ndo, " [bad length %u]", length)); return (0); } if ((length + 1) & 3) ND_PRINT((ndo, " [bad length %u]", length)); ND_TCHECK(cp[2]); ptr = cp...
{'added': [(57, 'static int'), (66, '\t\treturn (0);'), (70, '\tND_TCHECK(cp[2]);'), (76, '\t\tND_TCHECK2(cp[len], 4);'), (81, '\treturn (0);'), (82, ''), (83, 'trunc:'), (84, '\treturn (-1);'), (287, '\t\t\tif (ip_printroute(ndo, cp, option_len) == -1)'), (288, '\t\t\t\tgoto trunc;')], 'deleted': [(57, 'static void'),...
10
3
519
3,441
20
163
8
https://github.com/the-tcpdump-group/tcpdump
CVE-2017-13022
CWE-125
564
locale_methods.c
C
get_icu_value_src_php
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is ...
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is ...
static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { const char* loc_name = NULL; int loc_name_len = 0; char* tag_value = NULL; char* empty_result = ""; int result = 0; char* msg = NULL; UErrorCode status =...
static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { const char* loc_name = NULL; int loc_name_len = 0; char* tag_value = NULL; char* empty_result = ""; int result = 0; char* msg = NULL; UErrorCode status = ...
{'added': [(68, '\t"cel-gaulish",\t\t"en-GB-oed",\t\t"i-ami",'), (69, '\t"i-bnn",\t\t"i-default",\t\t"i-enochian",'), (70, '\t"i-mingo",\t\t"i-pwn", \t\t"i-tao",'), (75, '\t"zh-min-nan", \t\t"zh-wuu", \t\t"zh-xiang",'), (81, '* This is in sync with the array LOC_GRANDFATHERED'), (87, '\t"nv", \t\t\t"nb",\t\t\t"nn",'),...
118
117
1,039
6,142
37
221
7
https://github.com/php/php-src
CVE-2016-5093
CWE-125
1,272
uas-detect.h
C
uas_find_uas_alt_setting
#include <linux/usb.h> #include <linux/usb/hcd.h> #include "usb.h" static int uas_is_interface(struct usb_host_interface *intf) { return (intf->desc.bInterfaceClass == USB_CLASS_MASS_STORAGE && intf->desc.bInterfaceSubClass == USB_SC_SCSI && intf->desc.bInterfaceProtocol == USB_PR_UAS); } static int uas_find_uas...
#include <linux/usb.h> #include <linux/usb/hcd.h> #include "usb.h" static int uas_is_interface(struct usb_host_interface *intf) { return (intf->desc.bInterfaceClass == USB_CLASS_MASS_STORAGE && intf->desc.bInterfaceSubClass == USB_SC_SCSI && intf->desc.bInterfaceProtocol == USB_PR_UAS); } static struct usb_host_...
static int uas_find_uas_alt_setting(struct usb_interface *intf) { int i; for (i = 0; i < intf->num_altsetting; i++) { struct usb_host_interface *alt = &intf->altsetting[i]; if (uas_is_interface(alt)) return alt->desc.bAlternateSetting; } return -ENODEV; }
static struct usb_host_interface *uas_find_uas_alt_setting( struct usb_interface *intf) { int i; for (i = 0; i < intf->num_altsetting; i++) { struct usb_host_interface *alt = &intf->altsetting[i]; if (uas_is_interface(alt)) return alt; } return NULL; }
{'added': [(12, 'static struct usb_host_interface *uas_find_uas_alt_setting('), (13, '\t\tstruct usb_interface *intf)'), (21, '\t\t\treturn alt;'), (24, '\treturn NULL;'), (62, '\tstruct usb_host_interface *alt;'), (63, '\tint r;'), (66, '\tif (!alt)'), (69, '\tr = uas_find_endpoints(alt, eps);')], 'deleted': [(12, 'st...
8
7
97
605
10
60
3
https://github.com/torvalds/linux
CVE-2017-16530
CWE-125
1,913
libmspack.c
C
mspack_fmap_free
/* * Glue code for libmspack handling. * Author: 웃 Sebastian Andrzej Siewior * ✉ sebastian @ breakpoint ̣cc */ #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <fcntl.h> #include <mspack.h> #include "clamav.h" #include "fmap.h" #include "scanners.h" #include "others.h" enum mspack_type { F...
/* * Glue code for libmspack handling. * Author: 웃 Sebastian Andrzej Siewior * ✉ sebastian @ breakpoint ̣cc */ #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <fcntl.h> #include <mspack.h> #include "clamav.h" #include "fmap.h" #include "scanners.h" #include "others.h" enum mspack_type { F...
static void mspack_fmap_free(void *mem) { free(mem); }
static void mspack_fmap_free(void *mem) { if(mem) { free(mem); mem = NULL; } return; }
{'added': [(267, ' if(mem) {'), (268, ' free(mem);'), (269, ' mem = NULL;'), (270, ' }'), (271, ' return;')], 'deleted': [(267, '\tfree(mem);')]}
5
1
433
2,255
4
13
1
https://github.com/vrtadmin/clamav-devel
CVE-2017-6419
CWE-119
1,767
ptabasic.c
C
ptaReadStream
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source c...
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source c...
ptaReadStream(FILE *fp) { char typestr[128]; l_int32 i, n, ix, iy, type, version; l_float32 x, y; PTA *pta; PROCNAME("ptaReadStream"); if (!fp) return (PTA *)ERROR_PTR("stream not defined", procName, NULL); if (fscanf(fp, "\n Pta Version %d\n", &version) != 1) return (PTA...
ptaReadStream(FILE *fp) { char typestr[128]; /* hardcoded below in fscanf */ l_int32 i, n, ix, iy, type, version; l_float32 x, y; PTA *pta; PROCNAME("ptaReadStream"); if (!fp) return (PTA *)ERROR_PTR("stream not defined", procName, NULL); if (fscanf(fp, "\n Pta Version %d\n", &v...
{'added': [(692, 'char typestr[128]; /* hardcoded below in fscanf */'), (706, ' if (fscanf(fp, " Number of pts = %d; format = %127s\\n", &n, typestr) != 2)')], 'deleted': [(692, 'char typestr[128];'), (706, ' if (fscanf(fp, " Number of pts = %d; format = %s\\n", &n, typestr) != 2)')]}
2
2
806
5,172
38
309
11
https://github.com/DanBloomberg/leptonica
CVE-2018-7186
CWE-787
2,801
hashtable_lookup.cc
C++
tflite::ops::builtin::Prepare
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 3); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 2); const TfLiteTensor* lookup = GetInput(context, node, 0); TF_LITE_ENSURE_EQ(context, NumDimensions(lookup), 1); TF_LITE_ENSURE_EQ(context, lookup->t...
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 3); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 2); const TfLiteTensor* lookup; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &lookup)); TF_LITE_ENSURE_EQ(context, NumDimensions(lookup), ...
{'added': [(40, '#include "tensorflow/lite/kernels/internal/compatibility.h"'), (58, ' const TfLiteTensor* lookup;'), (59, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &lookup));'), (63, ' const TfLiteTensor* key;'), (64, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 1, &key));'), (68, ' ...
21
10
108
884
36
361
5
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
2,420
activations.cc
C++
tflite::ops::builtin::activations::GenericPrepare
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus GenericPrepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); TF_LITE_ENSURE_TYPES_EQ(context, ...
TfLiteStatus GenericPrepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input)); TfLiteTensor* output; TF_LITE_ENSURE_OK(cont...
{'added': [(255, ' const TfLiteTensor* input;'), (256, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));'), (257, ' TfLiteTensor* output;'), (258, ' TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));'), (277, ' const TfLiteTensor* input;'), (278, ' TF_LITE_ENSURE_OK(context,...
88
44
1,316
9,729
9
93
1
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
869
print-wb.c
C
wb_prep
/* * Copyright (c) 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in...
/* * Copyright (c) 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in...
wb_prep(netdissect_options *ndo, const struct pkt_prep *prep, u_int len) { int n; const struct pgstate *ps; const u_char *ep = ndo->ndo_snapend; ND_PRINT((ndo, " wb-prep:")); if (len < sizeof(*prep)) { return (-1); } n = EXTRACT_32BITS(&prep->pp_n); ps = (const struct pgstate *)(prep + 1); while (--...
wb_prep(netdissect_options *ndo, const struct pkt_prep *prep, u_int len) { int n; const struct pgstate *ps; const u_char *ep = ndo->ndo_snapend; ND_PRINT((ndo, " wb-prep:")); if (len < sizeof(*prep)) { return (-1); } n = EXTRACT_32BITS(&prep->pp_n); ps = (const struct pgstate *)(prep + 1); while (--...
{'added': [(204, '\tif (ND_TTEST2(cp, len)) {'), (269, '\twhile (--n >= 0 && ND_TTEST(*ps)) {'), (278, '\t\tfor (ie = io + ps->nid; io < ie && ND_TTEST(*io); ++io) {')], 'deleted': [(204, '\tif (!ND_TTEST2(cp, len)) {'), (269, '\twhile (--n >= 0 && !ND_TTEST(*ps)) {'), (278, '\t\tfor (ie = io + ps->nid; io < ie && !ND_...
3
3
298
1,873
30
261
7
https://github.com/the-tcpdump-group/tcpdump
CVE-2015-3138
CWE-20
2,266
array.c
C
mrb_ary_shift_m
/* ** array.c - Array class ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/string.h> #include <mruby/range.h> #include <mruby/proc.h> #include <mruby/presym.h> #include "value_array.h" #define ARY_DEFAULT_LEN 4 #define ARY_SHRINK_RATIO ...
/* ** array.c - Array class ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/string.h> #include <mruby/range.h> #include <mruby/proc.h> #include <mruby/presym.h> #include "value_array.h" #define ARY_DEFAULT_LEN 4 #define ARY_SHRINK_RATIO ...
mrb_ary_shift_m(mrb_state *mrb, mrb_value self) { struct RArray *a = mrb_ary_ptr(self); mrb_int len = ARY_LEN(a); mrb_int n; mrb_value val; if (mrb_get_args(mrb, "|i", &n) == 0) { return mrb_ary_shift(mrb, self); }; ary_modify_check(mrb, a); if (len == 0 || n == 0) return mrb_ary_new(mrb); if (n ...
mrb_ary_shift_m(mrb_state *mrb, mrb_value self) { mrb_int n; if (mrb_get_args(mrb, "|i", &n) == 0) { return mrb_ary_shift(mrb, self); } struct RArray *a = mrb_ary_ptr(self); mrb_int len = ARY_LEN(a); mrb_value val; ary_modify_check(mrb, a); if (len == 0 || n == 0) return mrb_ary_new(mrb); if (n...
{'added': [(588, ' }'), (589, ''), (590, ' struct RArray *a = mrb_ary_ptr(self);'), (591, ' mrb_int len = ARY_LEN(a);'), (592, ' mrb_value val;'), (593, '')], 'deleted': [(584, ' struct RArray *a = mrb_ary_ptr(self);'), (585, ' mrb_int len = ARY_LEN(a);'), (587, ' mrb_value val;'), (591, ' };')]}
6
4
1,074
7,307
38
241
10
https://github.com/mruby/mruby
CVE-2021-4188
CWE-476
976
opj_mj2_extract.c
C
main
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholiqu...
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholiqu...
int main(int argc, char *argv[]) { opj_dinfo_t* dinfo; opj_event_mgr_t event_mgr; /* event manager */ int tnum; unsigned int snum; opj_mj2_t *movie; mj2_tk_t *track; mj2_sample_t *sample; unsigned char* frame_codestream; FILE *file, *outfile; char outfilename[50]; mj2_dp...
int main(int argc, char *argv[]) { opj_dinfo_t* dinfo; opj_event_mgr_t event_mgr; /* event manager */ int tnum; unsigned int snum; opj_mj2_t *movie; mj2_tk_t *track; mj2_sample_t *sample; unsigned char* frame_codestream; FILE *file, *outfile; char outfilename[50]; mj2_dp...
{'added': [(143, ' {'), (144, ' int num = snprintf(outfilename, sizeof(outfilename),'), (145, ' "%s_%05d.j2k", argv[2],'), (146, ' snum);'), (147, ' if (num >= sizeof(outfilename)) {'), (148, ' fprintf(stderr, "maxim...
12
1
98
592
65
435
8
https://github.com/uclouvain/openjpeg
CVE-2018-7648
CWE-119
2,433
activations.cc
C++
tflite::ops::builtin::activations::SigmoidEval
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus SigmoidEval(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); switch (input->type) { case kTfLiteFloat32: { if (kernel_type == ...
TfLiteStatus SigmoidEval(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input)); TfLiteTensor* output; TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &outp...
{'added': [(255, ' const TfLiteTensor* input;'), (256, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));'), (257, ' TfLiteTensor* output;'), (258, ' TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));'), (277, ' const TfLiteTensor* input;'), (278, ' TF_LITE_ENSURE_OK(context,...
88
44
1,316
9,729
71
465
10
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
733
new_rbtree.c
C
r_crbtree_insert
/* BSD 2-Clause License Copyright (c) 2018, lynnl Cleaned up and refactored for r2 in 2021 - 2022: condret All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain...
/* BSD 2-Clause License Copyright (c) 2018, lynnl Cleaned up and refactored for r2 in 2021 - 2022: condret All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain...
R_API bool r_crbtree_insert(RRBTree *tree, void *data, RRBComparator cmp, void *user) { r_return_val_if_fail (tree && data && cmp, false); bool inserted = false; if (tree->root == NULL) { tree->root = _node_new (data, NULL); if (tree->root == NULL) { return false; } inserted = true; goto out_exit; } ...
R_API bool r_crbtree_insert(RRBTree *tree, void *data, RRBComparator cmp, void *user) { r_return_val_if_fail (tree && data && cmp, false); bool inserted = false; if (!tree->root) { tree->root = _node_new (data, NULL); if (!tree->root) { return false; } inserted = true; goto out_exit; } RRBNode head;...
{'added': [(141, '\tif (!tree->root) {'), (143, '\t\tif (!tree->root) {')], 'deleted': [(141, '\tif (tree->root == NULL) {'), (143, '\t\tif (tree->root == NULL) {')]}
2
2
341
2,407
62
413
18
https://github.com/radareorg/radare2
CVE-2022-1444
CWE-416
1,763
proc.c
C
proc_lambda
/* ** proc.c - Proc class ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/class.h> #include <mruby/proc.h> #include <mruby/opcode.h> #include <mruby/data.h> #include <mruby/presym.h> #include <mruby/array.h> #include <mruby/hash.h> static const mrb_code call_iseq[] = { OP_CALL, }; stati...
/* ** proc.c - Proc class ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/class.h> #include <mruby/proc.h> #include <mruby/opcode.h> #include <mruby/data.h> #include <mruby/presym.h> #include <mruby/array.h> #include <mruby/hash.h> static const mrb_code call_iseq[] = { OP_CALL, }; stati...
proc_lambda(mrb_state *mrb, mrb_value self) { mrb_value blk; struct RProc *p; mrb_get_args(mrb, "&", &blk); if (mrb_nil_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Proc object without a block"); } if (!mrb_proc_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "not a proc"); } p = mrb_...
proc_lambda(mrb_state *mrb, mrb_value self) { mrb_value blk; struct RProc *p; mrb_get_args(mrb, "&", &blk); if (mrb_nil_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Proc object without a block"); } if (!mrb_proc_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "not a proc"); } p = mrb_...
{'added': [(204, 'mrb_proc_copy(mrb_state *mrb, struct RProc *a, struct RProc *b)'), (212, ' a->upper = b->upper;'), (214, ' mrb_irep_incref(mrb, (mrb_irep*)a->body.irep);'), (230, ' mrb_proc_copy(mrb, p, mrb_proc_ptr(blk));'), (248, ' mrb_proc_copy(mrb, mrb_proc_ptr(self), mrb_proc_ptr(proc));'), (284, ' mrb_...
6
6
364
2,483
20
121
4
https://github.com/mruby/mruby
CVE-2021-4110
CWE-476
2,633
sub.cc
C++
tflite::ops::builtin::sub::Prepare
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); auto* params = reinterpret_cast<TfLiteSubParams*>(node->builtin_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTens...
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); auto* params = reinterpret_cast<TfLiteSubParams*>(node->builtin_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTens...
{'added': [(220, ' const TfLiteTensor* input1;'), (221, ' TF_LITE_ENSURE_OK(context,'), (222, ' GetInputSafe(context, node, kInputTensor1, &input1));'), (223, ' const TfLiteTensor* input2;'), (224, ' TF_LITE_ENSURE_OK(context,'), (225, ' GetInputSafe(context, node, kInputTensor...
18
6
389
2,572
50
416
13
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
3,176
auth_x.c
C
ceph_x_proc_ticket_reply
#include <linux/ceph/ceph_debug.h> #include <linux/err.h> #include <linux/module.h> #include <linux/random.h> #include <linux/slab.h> #include <linux/ceph/decode.h> #include <linux/ceph/auth.h> #include "crypto.h" #include "auth_x.h" #include "auth_x_protocol.h" #define TEMP_TICKET_BUF_LEN 256 static void ceph_x_...
#include <linux/ceph/ceph_debug.h> #include <linux/err.h> #include <linux/module.h> #include <linux/random.h> #include <linux/slab.h> #include <linux/ceph/decode.h> #include <linux/ceph/auth.h> #include "crypto.h" #include "auth_x.h" #include "auth_x_protocol.h" static void ceph_x_validate_tickets(struct ceph_auth...
static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac, struct ceph_crypto_key *secret, void *buf, void *end) { void *p = buf; char *dbuf; char *ticket_buf; u8 reply_struct_v; u32 num; int ret; dbuf = kmalloc(TEMP_TICKET_BUF_LEN, GFP_NOFS); if (!dbuf) return -ENOMEM; ret = -ENOMEM;...
static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac, struct ceph_crypto_key *secret, void *buf, void *end) { void *p = buf; u8 reply_struct_v; u32 num; int ret; ceph_decode_8_safe(&p, end, reply_struct_v, bad); if (reply_struct_v != 1) return -EINVAL; ceph_decode_32_safe(&p, end, ...
{'added': [(65, '\t\t\t void **p, void *end, void **obuf, size_t olen)'), (76, '\tif (*obuf == NULL) {'), (77, '\t\t*obuf = kmalloc(len, GFP_NOFS);'), (78, '\t\tif (!*obuf)'), (79, '\t\t\treturn -ENOMEM;'), (80, '\t\tolen = len;'), (81, '\t}'), (82, ''), (83, '\tret = ceph_decrypt2(secret, &head, &head_len, *obuf, &ol...
29
35
594
3,817
38
189
6
https://github.com/torvalds/linux
CVE-2014-6416
CWE-119
1,606
xsDataView.c
C++
fx_DataView
/* * Copyright (c) 2016-2017 Moddable Tech, Inc. * * This file is part of the Moddable SDK Runtime. * * The Moddable SDK Runtime is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either v...
/* * Copyright (c) 2016-2017 Moddable Tech, Inc. * * This file is part of the Moddable SDK Runtime. * * The Moddable SDK Runtime is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either v...
void fx_DataView(txMachine* the) { txSlot* slot; txBoolean flag = 0; txInteger offset, size; txSlot* info; txSlot* instance; txSlot* view; txSlot* buffer; if (mxIsUndefined(mxTarget)) mxTypeError("call: DataView"); if ((mxArgc > 0) && (mxArgv(0)->kind == XS_REFERENCE_KIND)) { slot = mxArgv(0)->value.refere...
void fx_DataView(txMachine* the) { txSlot* slot; txBoolean flag = 0; txInteger offset, size; txSlot* info; txSlot* instance; txSlot* view; txSlot* buffer; if (mxIsUndefined(mxTarget)) mxTypeError("call: DataView"); if ((mxArgc > 0) && (mxArgv(0)->kind == XS_REFERENCE_KIND)) { slot = mxArgv(0)->value.refere...
{'added': [(776, '\t\ttxInteger end = offset + size;'), (777, '\t\tif ((info->value.bufferInfo.length < end) || (end < offset))'), (797, '\t\t\ttxInteger end = offset + size;'), (798, '\t\t\tif ((info->value.bufferInfo.length < end) || (end < offset))'), (1365, '\t\t\t\ttxInteger delta = size << shift;'), (1366, '\t\t\...
9
5
2,594
21,236
52
386
16
https://github.com/Moddable-OpenSource/moddable
CVE-2022-29368
CWE-125
2,811
alloc.c
C
xmalloc
/* * alloc.c -- Useful allocation function/defintions * * Copyright (C)1999-2006 Mark Simpson <damned@world.std.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or...
/* * alloc.c -- Useful allocation function/defintions * * Copyright (C)1999-2006 Mark Simpson <damned@world.std.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or...
xmalloc (size_t size) { void *ptr = malloc (size); if (!ptr && (size != 0)) /* some libc don't like size == 0 */ { perror ("xmalloc: Memory allocation failure"); abort(); } return ptr; }
xmalloc (size_t num, size_t size) { size_t res; if (check_mul_overflow(num, size, &res)) abort(); void *ptr = malloc (res); if (!ptr && (size != 0)) /* some libc don't like size == 0 */ { perror ("xmalloc: Memory allocation failure"); abort(); } retur...
{'added': [(43, 'size_t'), (44, 'check_mul_overflow(size_t a, size_t b, size_t* res)'), (45, '{'), (46, ' size_t tmp = a * b;'), (47, ' if (a != 0 && tmp / a != b) return 1;'), (48, ' *res = tmp;'), (49, ' return 0;'), (50, '}'), (51, ''), (55, ' fprintf (stderr,'), (59, ' (unsigned long)allo...
39
16
88
369
11
41
3
https://github.com/verdammelt/tnef
CVE-2017-6308
CWE-190
1,577
host_calls.cc
C++
enc_untrusted_read
/* * * Copyright 2019 Asylo authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
/* * * Copyright 2019 Asylo authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
ssize_t enc_untrusted_read(int fd, void *buf, size_t count) { return static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall( asylo::system_call::kSYS_read, fd, buf, count)); }
ssize_t enc_untrusted_read(int fd, void *buf, size_t count) { ssize_t ret = static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall( asylo::system_call::kSYS_read, fd, buf, count)); if (ret != -1 && ret > count) { ::asylo::primitives::TrustedPrimitives::BestEffortAbort( "enc_untrusted_read: read ...
{'added': [(229, ' ssize_t ret = static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall('), (231, ' if (ret != -1 && ret > count) {'), (232, ' ::asylo::primitives::TrustedPrimitives::BestEffortAbort('), (233, ' "enc_untrusted_read: read result exceeds requested");'), (234, ' }'), (235, ' return ret;')],...
6
1
1,340
9,264
4
36
1
https://github.com/google/asylo
CVE-2020-8942
CWE-125
881
njs_async.c
C
njs_async_function_frame_invoke
/* * Copyright (C) Alexander Borisov * Copyright (C) Nginx, Inc. */ #include <njs_main.h> static void njs_async_context_free(njs_vm_t *vm, njs_async_ctx_t *ctx); njs_int_t njs_async_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval) { njs_int_t ret; njs_value_t ctor;...
/* * Copyright (C) Alexander Borisov * Copyright (C) Nginx, Inc. */ #include <njs_main.h> static void njs_async_context_free(njs_vm_t *vm, njs_async_ctx_t *ctx); njs_int_t njs_async_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval) { njs_int_t ret; njs_value_t ctor;...
njs_async_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval) { njs_int_t ret; njs_value_t ctor; njs_native_frame_t *frame; njs_promise_capability_t *capability; frame = vm->top_frame; frame->retval = retval; njs_set_function(&ctor, &vm->construct...
njs_async_function_frame_invoke(njs_vm_t *vm, njs_value_t *retval) { njs_int_t ret; njs_value_t ctor; njs_native_frame_t *frame; njs_promise_capability_t *capability; frame = vm->top_frame; frame->retval = retval; njs_set_function(&ctor, &vm->construct...
{'added': [(32, ' ret = njs_function_lambda_call(vm, capability, NULL);'), (96, ' ret = njs_vmcode_interpreter(vm, ctx->pc, ctx->capability, ctx);')], 'deleted': [(32, ' frame->function->context = capability;'), (33, ''), (34, ' ret = njs_function_lambda_call(vm);'), (66, ' njs_function_t *function;...
2
13
169
1,064
31
205
6
https://github.com/nginx/njs
CVE-2022-25139
CWE-416
187
ne.c
C
r_bin_ne_get_symbols
/* radare - LGPL - Copyright 2019-2022 - GustavoLCR */ #include "ne.h" #define NE_BUG 0 static char *__get_target_os(r_bin_ne_obj_t *bin) { switch (bin->ne_header->targOS) { case 1: return "OS/2"; case 2: return "Windows"; case 3: return "European MS-DOS 4.x"; case 4: return "Windows 386"; case 5: ret...
/* radare - LGPL - Copyright 2019-2022 - GustavoLCR */ #include "ne.h" #define NE_BUG 0 static char *__get_target_os(r_bin_ne_obj_t *bin) { switch (bin->ne_header->targOS) { case 1: return "OS/2"; case 2: return "Windows"; case 3: return "European MS-DOS 4.x"; case 4: return "Windows 386"; case 5: ret...
RList *r_bin_ne_get_symbols(r_bin_ne_obj_t *bin) { RBinSymbol *sym; ut16 off = bin->ne_header->ResidNamTable + bin->header_offset; RList *symbols = r_list_newf (free); if (!symbols) { return NULL; } RList *entries = r_bin_ne_get_entrypoints (bin); bool resident = true, first = true; while (true) { ut8 sz = ...
RList *r_bin_ne_get_symbols(r_bin_ne_obj_t *bin) { RBinSymbol *sym; ut16 off = bin->ne_header->ResidNamTable + bin->header_offset; RList *symbols = r_list_newf (free); if (!symbols) { return NULL; } RList *entries = r_bin_ne_get_entrypoints (bin); bool resident = true, first = true; while (entries) { ut8 sz...
{'added': [(118, '\twhile (entries) {'), (355, '\tif (!bin->entry_table) {'), (356, '\t\treturn NULL;'), (357, '\t}')], 'deleted': [(118, '\twhile (true) {')]}
4
1
623
3,774
72
399
12
https://github.com/radareorg/radare2
CVE-2022-1283
CWE-476
186
jpegc.cxx
C++
ReadJPEG
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozil...
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozil...
void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, Size const & previewSize ) { jpeg_decompress_struct cinfo; ErrorManagerStruct jerr; if ( setjmp( jerr.setjmp_buffer ) ) { jpeg_destroy_decompress( &cinfo ); return; } cinfo.err = jpeg_std_e...
void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, Size const & previewSize ) { jpeg_decompress_struct cinfo; ErrorManagerStruct jerr; if ( setjmp( jerr.setjmp_buffer ) ) { jpeg_destroy_decompress( &cinfo ); return; } cinfo.err = jpeg_std_e...
{'added': [(135, ' jpeg_calc_output_dimensions(&cinfo);'), (192, ' SAL_WARN("vcl.filter", "jpg with unknown out color space, forcing to :" << best_out_color_space << " gray ");'), (196, ' jpeg_start_decompress(&cinfo);'), (197, '')], 'deleted': [(135, ' jpeg_start_decompress( &cinfo );')...
4
3
334
1,964
169
1,034
35
https://github.com/LibreOffice/core
CVE-2017-8358
CWE-119
1,298
spl_array.c
C
spl_array_has_dimension_ex
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +---------...
/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +---------...
static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); long index; zval *rv, *value = NULL, **tmp; if (check_inherited && intern->fptr_offset_has) { ...
static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */ { spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); long index; zval *rv, *value = NULL, **tmp; if (check_inherited && intern->fptr_offset_has) { ...
{'added': [(311, '\tif (!offset || !ht) {'), (629, '\t\t\tcase IS_STRING:'), (641, '\t\t\tcase IS_BOOL:'), (1813, '\t\tif (!php_var_unserialize(&intern->array, &p, s + buf_len, &var_hash TSRMLS_CC)'), (1814, '\t\t\t\t|| (Z_TYPE_P(intern->array) != IS_ARRAY && Z_TYPE_P(intern->array) != IS_OBJECT)) {'), (1815, '\t\t\tzv...
6
4
1,540
10,658
65
389
23
https://github.com/php/php-src
CVE-2016-7417
CWE-20
312
icmp.c
C
icmp_send
/* * NET3: Implementation of the ICMP protocol layer. * * Alan Cox, <alan@lxorguk.ukuu.org.uk> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (a...
/* * NET3: Implementation of the ICMP protocol layer. * * Alan Cox, <alan@lxorguk.ukuu.org.uk> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (a...
void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) { struct iphdr *iph; int room; struct icmp_bxm icmp_param; struct rtable *rt = skb_rtable(skb_in); struct ipcm_cookie ipc; __be32 saddr; u8 tos; struct net *net; struct sock *sk; if (!rt) goto out; net = dev_net(rt->dst.dev); /* ...
void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) { struct iphdr *iph; int room; struct icmp_bxm icmp_param; struct rtable *rt = skb_rtable(skb_in); struct ipcm_cookie ipc; __be32 saddr; u8 tos; struct net *net; struct sock *sk; if (!rt) goto out; net = dev_net(rt->dst.dev); /* ...
{'added': [(111, '\tstruct ip_options_data replyopts;'), (335, '\tif (ip_options_echo(&icmp_param->replyopts.opt.opt, skb))'), (349, '\tif (icmp_param->replyopts.opt.opt.optlen) {'), (350, '\t\tipc.opt = &icmp_param->replyopts.opt;'), (351, '\t\tif (ipc.opt->opt.srr)'), (352, '\t\t\tdaddr = icmp_param->replyopts.opt.op...
11
12
764
4,430
95
630
23
https://github.com/torvalds/linux
CVE-2012-3552
CWE-362
978
revision.c
C
show_object_with_name
#include "cache.h" #include "tag.h" #include "blob.h" #include "tree.h" #include "commit.h" #include "diff.h" #include "refs.h" #include "revision.h" #include "graph.h" #include "grep.h" #include "reflog-walk.h" #include "patch-ids.h" #include "decorate.h" #include "log-tree.h" #include "string-list.h" #include "line-l...
#include "cache.h" #include "tag.h" #include "blob.h" #include "tree.h" #include "commit.h" #include "diff.h" #include "refs.h" #include "revision.h" #include "graph.h" #include "grep.h" #include "reflog-walk.h" #include "patch-ids.h" #include "decorate.h" #include "log-tree.h" #include "string-list.h" #include "line-l...
void show_object_with_name(FILE *out, struct object *obj, struct strbuf *path, const char *component) { char *name = path_name(path, component); char *p; fprintf(out, "%s ", oid_to_hex(&obj->oid)); for (p = name; *p && *p != '\n'; p++) fputc(*p, out); fputc('\n', out); free(name); }
void show_object_with_name(FILE *out, struct object *obj, const char *name) { const char *p; fprintf(out, "%s ", oid_to_hex(&obj->oid)); for (p = name; *p && *p != '\n'; p++) fputc(*p, out); fputc('\n', out); }
{'added': [(28, 'void show_object_with_name(FILE *out, struct object *obj, const char *name)'), (30, '\tconst char *p;')], 'deleted': [(28, 'char *path_name(struct strbuf *path, const char *name)'), (30, '\tstruct strbuf ret = STRBUF_INIT;'), (31, '\tif (path)'), (32, '\t\tstrbuf_addbuf(&ret, path);'), (33, '\tstrbuf_a...
2
15
2,418
16,753
11
90
3
https://github.com/git/git
CVE-2016-2315
CWE-119
2,986
print-isoclns.c
C
isis_print_extd_ip_reach
/* * Copyright (c) 1992, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragr...
/* * Copyright (c) 1992, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragr...
isis_print_extd_ip_reach(netdissect_options *ndo, const uint8_t *tptr, const char *ident, uint16_t afi) { char ident_buffer[20]; uint8_t prefix[sizeof(struct in6_addr)]; /* shared copy buffer for IPv4 and IPv6 prefixes */ u_int metric, status_byte, bit_length, byte_length, sublen, p...
isis_print_extd_ip_reach(netdissect_options *ndo, const uint8_t *tptr, const char *ident, uint16_t afi) { char ident_buffer[20]; uint8_t prefix[sizeof(struct in6_addr)]; /* shared copy buffer for IPv4 and IPv6 prefixes */ u_int metric, status_byte, bit_length, byte_length, sublen, p...
{'added': [(2041, ' if (!ND_TTEST2(*tptr, 2)) /* fetch status & prefix_len byte */')], 'deleted': [(2041, ' if (!ND_TTEST2(*tptr, 1)) /* fetch status & prefix_len byte */')]}
1
1
2,403
14,614
85
568
25
https://github.com/the-tcpdump-group/tcpdump
CVE-2017-12998
CWE-125
2,910
jas_stream.c
C
mem_read
/* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image P...
/* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image P...
static int mem_read(jas_stream_obj_t *obj, char *buf, int cnt) { int n; assert(cnt >= 0); assert(buf); JAS_DBGLOG(100, ("mem_read(%p, %p, %d)\n", obj, buf, cnt)); jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj; n = m->len_ - m->pos_; cnt = JAS_MIN(n, cnt); memcpy(buf, &m->buf_[m->pos_], cnt); m->pos_ += ...
static int mem_read(jas_stream_obj_t *obj, char *buf, int cnt) { ssize_t n; assert(cnt >= 0); assert(buf); JAS_DBGLOG(100, ("mem_read(%p, %p, %d)\n", obj, buf, cnt)); jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj; n = m->len_ - m->pos_; cnt = JAS_MIN(n, cnt); memcpy(buf, &m->buf_[m->pos_], cnt); m->pos_...
{'added': [(172, '#if 0'), (173, ''), (174, '/* Obsolete code. */'), (175, ''), (245, '#else'), (246, ''), (247, '/*'), (248, 'This function will eventually replace jas_stream_memopen.'), (249, 'If buf is 0 and bufsize > 0:'), (250, '\ta buffer is dynamically allocated with size bufsize and this buffer is'), (251, '\tn...
170
13
911
5,339
13
100
1
https://github.com/mdadams/jasper
CVE-2016-9262
CWE-190
253
mach0.c
C
parse_import_ptr
/* radare - LGPL - Copyright 2010-2018 - nibble, pancake */ #include <stdio.h> #include <r_types.h> #include <r_util.h> #include "mach0.h" #define bprintf if (bin->verbose) eprintf typedef struct _ulebr { ut8 *p; } ulebr; // OMG; THIS SHOULD BE KILLED; this var exposes the local native endian, which is completely ...
/* radare - LGPL - Copyright 2010-2018 - nibble, pancake */ #include <stdio.h> #include <r_types.h> #include <r_util.h> #include "mach0.h" #define bprintf if (bin->verbose) eprintf typedef struct _ulebr { ut8 *p; } ulebr; // OMG; THIS SHOULD BE KILLED; this var exposes the local native endian, which is completely ...
static int parse_import_ptr(struct MACH0_(obj_t)* bin, struct reloc_t *reloc, int idx) { int i, j, sym, wordsize; ut32 stype; wordsize = MACH0_(get_bits)(bin) / 8; if (idx < 0 || idx >= bin->nsymtab) { return 0; } if ((bin->symtab[idx].n_desc & REFERENCE_TYPE) == REFERENCE_FLAG_UNDEFINED_LAZY) { stype = S_LAZ...
static int parse_import_ptr(struct MACH0_(obj_t)* bin, struct reloc_t *reloc, int idx) { int i, j, sym, wordsize; ut32 stype; wordsize = MACH0_(get_bits)(bin) / 8; if (idx < 0 || idx >= bin->nsymtab) { return 0; } if ((bin->symtab[idx].n_desc & REFERENCE_TYPE) == REFERENCE_FLAG_UNDEFINED_LAZY) { stype = S_LAZ...
{'added': [(1589, '\t\tif (parse_import_stub(bin, &symbols[j], i)) {'), (1591, '\t\t}'), (1666, '\t\t\tfor (j = 0, sym = -1; bin->sects[i].reserved1 + j < bin->nindirectsyms; j++) {'), (1667, '\t\t\t\tint indidx = bin->sects[i].reserved1 + j;'), (1668, '\t\t\t\tif (indidx < 0 || indidx >= bin->nindirectsyms) {'), (1669...
11
5
2,270
18,097
36
287
10
https://github.com/radare/radare2
CVE-2018-11380
CWE-125
2,128
snmp-api.c
C
snmp_api_set_time_ticks
/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above co...
/* * Copyright (C) 2019-2020 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the abo...
snmp_api_set_time_ticks(snmp_varbind_t *varbind, uint32_t *oid, uint32_t integer) { snmp_api_replace_oid(varbind, oid); varbind->value_type = SNMP_DATA_TYPE_TIME_TICKS; varbind->value.integer = integer; }
snmp_api_set_time_ticks(snmp_varbind_t *varbind, snmp_oid_t *oid, uint32_t integer) { memcpy(&varbind->oid, oid, sizeof(snmp_oid_t)); varbind->value_type = BER_DATA_TYPE_TIMETICKS; varbind->value.integer = integer; }
{'added': [(2, ' * Copyright (C) 2019-2020 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br>'), (35, ' * SNMP Implementation of the public API'), (49, 'snmp_api_set_string(snmp_varbind_t *varbind, snmp_oid_t *oid, char *string)'), (51, ' memcpy(&varbind->oid, oid, sizeof(snmp_oid_t));'), (58, 'snmp_api_set_t...
11
27
31
184
6
36
1
https://github.com/contiki-ng/contiki-ng
CVE-2020-12141
CWE-125
2,814
eval.c
C
eval_next_line
/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. */ /* * eval.c: Expression evaluation. */ #d...
/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. */ /* * eval.c: Expression evaluation. */ #d...
eval_next_line(char_u *arg, evalarg_T *evalarg) { garray_T *gap = &evalarg->eval_ga; char_u *line; if (arg != NULL) { if (*arg == NL) return newline_skip_comments(arg); // Truncate before a trailing comment, so that concatenating the lines // won't turn the rest into a comment. if (*skipwhite(...
eval_next_line(char_u *arg, evalarg_T *evalarg) { garray_T *gap = &evalarg->eval_ga; char_u *line; if (arg != NULL) { if (*arg == NL) return newline_skip_comments(arg); // Truncate before a trailing comment, so that concatenating the lines // won't turn the rest into a comment. if (*skipwhite(...
{'added': [(356, '/*'), (357, ' * Initialize "evalarg" for use.'), (358, ' */'), (359, ' void'), (360, 'init_evalarg(evalarg_T *evalarg)'), (361, '{'), (362, ' CLEAR_POINTER(evalarg);'), (363, ' ga_init2(&evalarg->eval_tofree_ga, sizeof(char_u *), 20);'), (364, '}'), (365, ''), (366, '/*'), (367, ' * If "evala...
60
42
5,145
27,604
38
228
11
https://github.com/vim/vim
CVE-2022-2889
CWE-416
20
scene_dump.c
C
gf_dump_vrml_field
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2022 * All rights reserved * * This file is part of GPAC / Scene Management sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser...
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2022 * All rights reserved * * This file is part of GPAC / Scene Management sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser...
static void gf_dump_vrml_field(GF_SceneDumper *sdump, GF_Node *node, GF_FieldInfo field) { u32 i, sf_type; Bool needs_field_container; GF_ChildNodeItem *list; void *slot_ptr; switch (field.fieldType) { case GF_SG_VRML_SFNODE: assert ( *(GF_Node **)field.far_ptr); if (sdump->XMLDump) { if (!sdump->X3DDump...
static void gf_dump_vrml_field(GF_SceneDumper *sdump, GF_Node *node, GF_FieldInfo field) { u32 i, sf_type; Bool needs_field_container; GF_ChildNodeItem *list; void *slot_ptr; switch (field.fieldType) { case GF_SG_VRML_SFNODE: assert ( *(GF_Node **)field.far_ptr); if (sdump->XMLDump) { if (!sdump->X3DDump...
{'added': [(788, '\t\tfor (i=0; mffield && (i<mffield->count); i++) {'), (941, '\t\tfor (i=0; mffield && (i<mffield->count); i++) {'), (942, '\t\t\tif (i) gf_fprintf(sdump->trace, " ");'), (943, '\t\t\tgf_sg_vrml_mf_get_item(field.far_ptr, field.fieldType, &slot_ptr, i);'), (944, '\t\t\tgf_dump_vrml_sffield(sdump, sf_t...
12
16
3,131
22,359
146
1,023
48
https://github.com/gpac/gpac
CVE-2022-2549
CWE-476
1,286
tightDecode.h
C++
rfb::TightDecoder::FilterGradient
/* Copyright (C) 2000-2003 Constantin Kaplinsky. All Rights Reserved. * Copyright 2004-2005 Cendio AB. * Copyright 2009-2015 Pierre Ossman for Cendio AB * Copyright (C) 2011 D. R. Commander. All Rights Reserved. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU...
/* Copyright (C) 2000-2003 Constantin Kaplinsky. All Rights Reserved. * Copyright 2004-2005 Cendio AB. * Copyright 2009-2015 Pierre Ossman for Cendio AB * Copyright (C) 2011 D. R. Commander. All Rights Reserved. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU...
void TightDecoder::FilterGradient(const rdr::U8* inbuf, const PixelFormat& pf, PIXEL_T* outbuf, int stride, const Rect& r) { int x, y, c; static rdr::U8 prevRow[TIGHT_MAX_WIDTH*3]; static rdr::U8 thisRow[TIGHT_MAX_WIDTH*3]; rdr::U8 pix[3]; i...
void TightDecoder::FilterGradient(const rdr::U8* inbuf, const PixelFormat& pf, PIXEL_T* outbuf, int stride, const Rect& r) { int x, y, c; static rdr::U8 prevRow[TIGHT_MAX_WIDTH*3]; static rdr::U8 thisRow[TIGHT_MAX_WIDTH*3]; rdr::U8 pix[3]; i...
{'added': [(59, ' for (x = 0; x < rectWidth; x++) {'), (60, ' /* First pixel in a row */'), (61, ' if (x == 0) {'), (62, ' for (c = 0; c < 3; c++) {'), (63, ' pix[c] = inbuf[y*rectWidth*3+c] + prevRow[c];'), (64, ' thisRow[c] = pix[c];'), (65, ' }'), (66, ' pf.bufferF...
21
16
115
1,025
36
389
8
https://github.com/CendioOssman/tigervnc
CVE-2019-15693
CWE-787
1,574
regcomp.c
C
S_grok_bslash_N
/* regcomp.c */ /* * 'A fair jaw-cracker dwarf-language must be.' --Samwise Gamgee * * [p.285 of _The Lord of the Rings_, II/iii: "The Ring Goes South"] */ /* This file contains functions for compiling a regular expression. See * also regexec.c which funnily enough, contains functions for exe...
/* regcomp.c */ /* * 'A fair jaw-cracker dwarf-language must be.' --Samwise Gamgee * * [p.285 of _The Lord of the Rings_, II/iii: "The Ring Goes South"] */ /* This file contains functions for compiling a regular expression. See * also regexec.c which funnily enough, contains functions for exe...
S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode ** node_p, UV * code_point_p, int * cp_count, I32 * flagp, const bool strict, const U32 depth ) { /* This routine teases apart the various meanings of \N and retu...
S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state, regnode ** node_p, UV * code_point_p, int * cp_count, I32 * flagp, const bool strict, const U32 depth ) { /* This routine teases apart the various meanings of \N and retu...
{'added': [(12059, " endbrace = (char *) memchr(RExC_parse, '}', RExC_end - RExC_parse);"), (12776, ' char * endbrace = NULL;'), (12778, ' if (RExC_parse < RExC_end) {'), (12779, " endbrace = (char *) memchr(RExC_parse, '}', RExC_end - RExC_parse);"), (12780, ' ...
6
4
12,668
72,494
159
774
32
https://github.com/Perl/perl5
CVE-2018-18313
CWE-125
1,203
jpgfile.c
C++
ReadJpegSections
//-------------------------------------------------------------------------- // Program to pull the information out of various types of EXIF digital // camera files and show it in a reasonably consistent way // // This module handles basic Jpeg file handling // // Matthias Wandel //-----------------------------...
//-------------------------------------------------------------------------- // Program to pull the information out of various types of EXIF digital // camera files and show it in a reasonably consistent way // // This module handles basic Jpeg file handling // // Matthias Wandel //-----------------------------...
int ReadJpegSections (FILE * infile, ReadMode_t ReadMode) { int a; int HaveCom = FALSE; a = fgetc(infile); if (a != 0xff || fgetc(infile) != M_SOI){ return FALSE; } ImageInfo.JfifHeader.XDensity = ImageInfo.JfifHeader.YDensity = 300; ImageInfo.JfifHeader.ResolutionUnit...
int ReadJpegSections (FILE * infile, ReadMode_t ReadMode) { int a; int HaveCom = FALSE; a = fgetc(infile); if (a != 0xff || fgetc(infile) != M_SOI){ return FALSE; } ImageInfo.JfifHeader.XDensity = ImageInfo.JfifHeader.YDensity = 300; ImageInfo.JfifHeader.ResolutionUnit...
{'added': [(172, ' // Allocate an extra 20 bytes more than needed, because sometimes when reading structures,'), (173, ' // if the section erroneously ends before short structures that should be there, that can trip'), (174, ' // memory checkers in combination with fuzzers.'), (175, ' Data =...
5
2
542
3,310
177
1,028
57
https://github.com/F-ZhaoYang/jhead
CVE-2020-26208
CWE-787
2,407
pack-bitmap.c
C
show_object
#include "cache.h" #include "commit.h" #include "tag.h" #include "diff.h" #include "revision.h" #include "progress.h" #include "list-objects.h" #include "pack.h" #include "pack-bitmap.h" #include "pack-revindex.h" #include "pack-objects.h" /* * An entry on the bitmap index, representing the bitmap for a given * comm...
#include "cache.h" #include "commit.h" #include "tag.h" #include "diff.h" #include "revision.h" #include "progress.h" #include "list-objects.h" #include "pack.h" #include "pack-bitmap.h" #include "pack-revindex.h" #include "pack-objects.h" /* * An entry on the bitmap index, representing the bitmap for a given * comm...
static void show_object(struct object *object, struct strbuf *path, const char *last, void *data) { struct bitmap *base = data; int bitmap_pos; bitmap_pos = bitmap_position(object->oid.hash); if (bitmap_pos < 0) { char *name = path_name(path, last); bitmap_pos = ext_index_add_object(object, name); free(n...
static void show_object(struct object *object, const char *name, void *data) { struct bitmap *base = data; int bitmap_pos; bitmap_pos = bitmap_position(object->oid.hash); if (bitmap_pos < 0) bitmap_pos = ext_index_add_object(object, name); bitmap_set(base, bitmap_pos); }
{'added': [(417, 'static void show_object(struct object *object, const char *name, void *data)'), (424, '\tif (bitmap_pos < 0)'), (893, 'static void test_show_object(struct object *object, const char *name,'), (894, '\t\t\t void *data)')], 'deleted': [(417, 'static void show_object(struct object *object, struct str...
4
9
744
4,729
13
84
2
https://github.com/git/git
CVE-2016-2315
CWE-119
3,247
color.c
C
sycc444_to_rgb
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholi...
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholi...
static void sycc444_to_rgb(opj_image_t *img) { int *d0, *d1, *d2, *r, *g, *b; const int *y, *cb, *cr; unsigned int maxw, maxh, max, i; int offset, upb; upb = (int)img->comps[0].prec; offset = 1<<(upb - 1); upb = (1<<upb)-1; maxw = (unsigned int)img->comps[0].w; maxh = (unsigned int)img->comps[0].h; max = maxw...
static void sycc444_to_rgb(opj_image_t *img) { int *d0, *d1, *d2, *r, *g, *b; const int *y, *cb, *cr; size_t maxw, maxh, max, i; int offset, upb; upb = (int)img->comps[0].prec; offset = 1<<(upb - 1); upb = (1<<upb)-1; maxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h; max = maxw * maxh; y = img...
{'added': [(94, '\tsize_t maxw, maxh, max, i;'), (100, '\tmaxw = (size_t)img->comps[0].w; maxh = (size_t)img->comps[0].h;'), (107, '\td0 = r = (int*)malloc(sizeof(int) * max);'), (108, '\td1 = g = (int*)malloc(sizeof(int) * max);'), (109, '\td2 = b = (int*)malloc(sizeof(int) * max);'), (121, '\timg->color_space = OPJ_C...
86
62
686
6,633
31
393
8
https://github.com/uclouvain/openjpeg
CVE-2016-3183
CWE-125
3,205
vf_delogo.c
C
filter_frame
/* * Copyright (c) 2002 Jindrich Makovicka <makovick@gmail.com> * Copyright (c) 2011 Stefano Sabatini * Copyright (c) 2013 Jean Delvare <khali@linux-fr.org> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License ...
/* * Copyright (c) 2002 Jindrich Makovicka <makovick@gmail.com> * Copyright (c) 2011 Stefano Sabatini * Copyright (c) 2013 Jean Delvare <khali@linux-fr.org> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License ...
static int filter_frame(AVFilterLink *inlink, AVFrame *in) { DelogoContext *s = inlink->dst->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); AVFrame *out; int hsub0 = desc->log2_chroma_w; int vsub0 = desc->log2_chroma_h...
static int filter_frame(AVFilterLink *inlink, AVFrame *in) { DelogoContext *s = inlink->dst->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); AVFrame *out; int hsub0 = desc->log2_chroma_w; int vsub0 = desc->log2_chroma_h...
{'added': [(240, ' for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {')], 'deleted': [(240, ' for (plane = 0; plane < 4 && in->data[plane]; plane++) {')]}
1
1
195
1,697
42
366
11
https://github.com/FFmpeg/FFmpeg
CVE-2013-4263
CWE-119
2,155
udp.c
C
udp_recvmsg
/* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * The User Datagram Protocol (UDP). * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG...
/* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * The User Datagram Protocol (UDP). * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG...
int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sk_buff *skb; unsigned int ulen, copied; int peeked, off = 0; int err; int is...
int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sk_buff *skb; unsigned int ulen, copied; int peeked, off = 0; int err; int is...
{'added': [(1299, '\t\t*addr_len = sizeof(*sin);')], 'deleted': [(1238, '\t/*'), (1239, '\t *\tCheck any passed addresses'), (1240, '\t */'), (1241, '\tif (addr_len)'), (1242, '\t\t*addr_len = sizeof(*sin);'), (1243, '')]}
1
6
1,857
12,006
80
509
20
https://github.com/torvalds/linux
CVE-2013-7263
CWE-20
1,887
gather.cc
C++
tflite::ops::builtin::gather::Eval
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const auto* params = reinterpret_cast<const TfLiteGatherParams*>(node->builtin_data); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input)); const TfLiteTensor* positions; TF_LITE_ENSURE_OK(c...
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const auto* params = reinterpret_cast<const TfLiteGatherParams*>(node->builtin_data); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input)); const TfLiteTensor* positions; TF_LITE_ENSURE_OK(c...
{'added': [(120, 'TfLiteStatus Gather(TfLiteContext* context, const TfLiteGatherParams& params,'), (121, ' const TfLiteTensor* input, const TfLiteTensor* positions,'), (122, ' TfLiteTensor* output) {'), (123, ' const PositionsT* indexes = GetTensorData<PositionsT>(positions);'), (...
53
16
224
1,524
64
521
19
https://github.com/tensorflow/tensorflow
CVE-2021-37687
CWE-125
3,240
image.cxx
C
gif_read_lzw
/* * Image handling routines for HTMLDOC, a HTML document processing program. * * Copyright © 2011-2022 by Michael R Sweet. * Copyright © 1997-2010 by Easy Software Products. All rights reserved. * * This program is free software. Distribution and use rights are outlined in * the file "COPYING". */ /* * Inc...
/* * Image handling routines for HTMLDOC, a HTML document processing program. * * Copyright © 2011-2022 by Michael R Sweet. * Copyright © 1997-2010 by Easy Software Products. All rights reserved. * * This program is free software. Distribution and use rights are outlined in * the file "COPYING". */ /* * Inc...
gif_read_lzw(FILE *fp, /* I - File to read from */ int first_time, /* I - 1 = first time, 0 = not first time */ int input_code_size) /* I - Code size in bits */ { int i, /* Looping var */ code, /* Current code */ incode; /* Input code */ static short fresh = 0, /* 1 = empty buffers */ ...
gif_read_lzw(FILE *fp, /* I - File to read from */ int first_time, /* I - 1 = first time, 0 = not first time */ int input_code_size) /* I - Code size in bits */ { int i, /* Looping var */ code, /* Current code */ incode; /* Input code */ static short fresh = 0, /* 1 = empty buffers */ ...
{'added': [(308, ' if (code_size > 12)'), (309, ' {'), (310, ' progress_error(HD_ERROR_READ_ERROR, "Bad GIF file \\"%s\\" - invalid code size %d.", img->filename, code_size);'), (311, ' return (-1);'), (312, ' }'), (313, ''), (441, ' while ((code = gif_get_code(fp, code_size, 0)) >= 0)')], 'deleted': [(435, '...
7
1
1,215
7,491
106
604
21
https://github.com/michaelrsweet/htmldoc
CVE-2022-0534
CWE-125
1,486
readelf.c
C
do_bid_note
/* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice immediately at t...
/* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice immediately at t...
do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, int swap __attribute__((__unused__)), uint32_t namesz, uint32_t descsz, size_t noff, size_t doff, int *flags) { if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) { ...
do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, int swap __attribute__((__unused__)), uint32_t namesz, uint32_t descsz, size_t noff, size_t doff, int *flags) { if (namesz == 4 && strcmp((char *)&nbuf[noff], "GNU") == 0 && type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) { ...
{'added': [(30, 'FILE_RCSID("@(#)$File: readelf.c,v 1.138 2017/08/27 07:55:02 christos Exp $")'), (514, '\t type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) {')], 'deleted': [(30, 'FILE_RCSID("@(#)$File: readelf.c,v 1.137 2017/08/13 00:21:47 christos Exp $")'), (514, '\t type == NT_GNU_BUILD_ID && (descs...
2
2
1,136
6,923
34
213
12
https://github.com/file/file
CVE-2017-1000249
CWE-119
761
BlockCodec.cpp
C++
BlockCodec::runPull
/* Audio File Library Copyright (C) 2013 Michael Pruett <michael@68k.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later...
/* Audio File Library Copyright (C) 2013 Michael Pruett <michael@68k.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later...
void BlockCodec::runPull() { AFframecount framesToRead = m_outChunk->frameCount; AFframecount framesRead = 0; assert(framesToRead % m_framesPerPacket == 0); int blockCount = framesToRead / m_framesPerPacket; // Read the compressed data. ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount);...
void BlockCodec::runPull() { AFframecount framesToRead = m_outChunk->frameCount; AFframecount framesRead = 0; assert(framesToRead % m_framesPerPacket == 0); int blockCount = framesToRead / m_framesPerPacket; // Read the compressed data. ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount);...
{'added': [(55, '\t\tif (decodeBlock(static_cast<const uint8_t *>(m_inChunk->buffer) + i * m_bytesPerPacket,'), (56, '\t\t\tstatic_cast<int16_t *>(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount)==0)'), (57, '\t\t\tbreak;')], 'deleted': [(55, '\t\tdecodeBlock(static_cast<const uint8_t *>(m_inChunk...
3
2
81
558
20
158
4
https://github.com/antlarr/audiofile
CVE-2017-6839
CWE-190
2,735
assign_variable.cc
C++
tflite::ops::custom::assign_variable::Prepare
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); // TODO(b/137042749): TFLite infrastructure (converter, delegate) doesn't // fully support 0-output ops yet. Currently it works if we manually crfat // a TFLite graph that contains variable ops. Note...
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); // TODO(b/137042749): TFLite infrastructure (converter, delegate) doesn't // fully support 0-output ops yet. Currently it works if we manually crfat // a TFLite graph that contains variable ops. Note...
{'added': [(43, ' const TfLiteTensor* input_resource_id_tensor;'), (44, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputVariableId,'), (45, ' &input_resource_id_tensor));'), (55, ' const TfLiteTensor* input_resource_id_tensor;'), (56, ' TF_LITE_ENSURE_OK(conte...
9
5
47
291
9
76
1
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
794
jsparse.c
C++
jspeFactorDelete
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http...
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http...
NO_INLINE JsVar *jspeFactorDelete() { JSP_ASSERT_MATCH(LEX_R_DELETE); JsVar *parent = 0; JsVar *a = jspeFactorMember(jspeFactor(), &parent); JsVar *result = 0; if (JSP_SHOULD_EXECUTE) { bool ok = false; if (jsvIsName(a) && !jsvIsNewChild(a)) { // if no parent, check in root? if (!parent &&...
NO_INLINE JsVar *jspeFactorDelete() { JSP_ASSERT_MATCH(LEX_R_DELETE); JsVar *parent = 0; JsVar *a = jspeFactorMember(jspeFactor(), &parent); JsVar *result = 0; if (JSP_SHOULD_EXECUTE) { bool ok = false; if (jsvIsName(a) && !jsvIsNewChild(a)) { // if no parent, check in root? if (!parent &&...
{'added': [(955, ' JsVar *p = jsvSkipNameAndUnLock(jspNewPrototype(objName));'), (956, " // jspNewPrototype returns a 'prototype' name that's already a child of eg. an array"), (957, " // Create a new 'name' called __proto__ that links to it"), (958, ' JsVar *i = jsvNewFromString(JSPARSE_INH...
13
3
2,428
16,105
26
158
8
https://github.com/espruino/Espruino
CVE-2022-25044
CWE-787
3,055
comparisons.cc
C++
tflite::ops::builtin::comparisons::GreaterEqualEval
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus GreaterEqualEval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); bool requires_broadcast = !HaveSameS...
TfLiteStatus GreaterEqualEval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input1; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor1, &input1)); const TfLiteTensor* input2; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInput...
{'added': [(44, ' const TfLiteTensor* input1;'), (45, ' TF_LITE_ENSURE_OK(context,'), (46, ' GetInputSafe(context, node, kInputTensor1, &input1));'), (47, ' const TfLiteTensor* input2;'), (48, ' TF_LITE_ENSURE_OK(context,'), (49, ' GetInputSafe(context, node, kInputTensor2, &in...
63
21
416
2,500
34
208
6
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
16
unpack50mt.cpp
C++
Unpack::ProcessDecoded
#define UNP_READ_SIZE_MT 0x400000 #define UNP_BLOCKS_PER_THREAD 2 struct UnpackThreadDataList { UnpackThreadData *D; uint BlockCount; }; THREAD_PROC(UnpackDecodeThread) { UnpackThreadDataList *DL=(UnpackThreadDataList *)Data; for (uint I=0;I<DL->BlockCount;I++) DL->D->UnpackPtr->UnpackDe...
#define UNP_READ_SIZE_MT 0x400000 #define UNP_BLOCKS_PER_THREAD 2 struct UnpackThreadDataList { UnpackThreadData *D; uint BlockCount; }; THREAD_PROC(UnpackDecodeThread) { UnpackThreadDataList *DL=(UnpackThreadDataList *)Data; for (uint I=0;I<DL->BlockCount;I++) DL->D->UnpackPtr->UnpackDe...
bool Unpack::ProcessDecoded(UnpackThreadData &D) { UnpackDecodedItem *Item=D.Decoded,*Border=D.Decoded+D.DecodedSize; while (Item<Border) { UnpPtr&=MaxWinMask; if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr) { UnpWriteBuf(); if (WrittenFileSize>DestUnpSize) ...
bool Unpack::ProcessDecoded(UnpackThreadData &D) { UnpackDecodedItem *Item=D.Decoded,*Border=D.Decoded+D.DecodedSize; while (Item<Border) { UnpPtr&=MaxWinMask; if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_INC_LZ_MATCH && WriteBorder!=UnpPtr) { UnpWriteBuf(); if (WrittenFileSize>DestUnpSize)...
{'added': [(454, ' if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_INC_LZ_MATCH && WriteBorder!=UnpPtr)'), (562, ' if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_INC_LZ_MATCH && WriteBorder!=UnpPtr)')], 'deleted': [(454, ' if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr)'), (562, ' if...
2
2
524
2,999
61
357
16
https://github.com/aawc/unrar
CVE-2017-20006
CWE-787
3,061
lookup.c
C
label
/* lookup.c - implementation of IDNA2008 lookup functions Copyright (C) 2011-2017 Simon Josefsson Libidn2 is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of...
/* lookup.c - implementation of IDNA2008 lookup functions Copyright (C) 2011-2017 Simon Josefsson Libidn2 is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of...
label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen, int flags) { size_t plen; uint32_t *p; int rc; size_t tmpl; if (_idn2_ascii_p (src, srclen)) { if (flags & IDN2_ALABEL_ROUNDTRIP) /* FIXME implement this MAY: If the input to this procedure appears to be an A-la...
label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen, int flags) { size_t plen; uint32_t *p; const uint8_t *src_org = NULL; uint8_t *src_allocated = NULL; int rc, check_roundtrip = 0; size_t tmpl, srclen_org = 0; uint32_t label_u32[IDN2_LABEL_MAX_LENGTH]; size_t label32_len =...
{'added': [(54, ' if (((*flags) & IDN2_ALABEL_ROUNDTRIP) && ((*flags) & IDN2_NO_ALABEL_ROUNDTRIP))'), (55, ' return IDN2_INVALID_FLAGS;'), (56, ''), (69, ' const uint8_t *src_org = NULL;'), (70, ' uint8_t *src_allocated = NULL;'), (71, ' int rc, check_roundtrip = 0;'), (72, ' size_t tmpl, srclen_org = 0;'), (73...
74
31
480
2,448
53
275
11
https://gitlab.com/libidn/libidn2
CVE-2019-12290
CWE-20
503
trusted.c
C
trusted_update
/* * Copyright (C) 2010 IBM Corporation * * Author: * David Safford <safford@us.ibm.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2 of the License. * * See Documentati...
/* * Copyright (C) 2010 IBM Corporation * * Author: * David Safford <safford@us.ibm.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2 of the License. * * See Documentati...
static int trusted_update(struct key *key, struct key_preparsed_payload *prep) { struct trusted_key_payload *p; struct trusted_key_payload *new_p; struct trusted_key_options *new_o; size_t datalen = prep->datalen; char *datablob; int ret = 0; if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) return -ENOKEY; p = ...
static int trusted_update(struct key *key, struct key_preparsed_payload *prep) { struct trusted_key_payload *p; struct trusted_key_payload *new_p; struct trusted_key_options *new_o; size_t datalen = prep->datalen; char *datablob; int ret = 0; if (key_is_negative(key)) return -ENOKEY; p = key->payload.data[0]...
{'added': [(1069, '\tif (key_is_negative(key))')], 'deleted': [(1069, '\tif (test_bit(KEY_FLAG_NEGATIVE, &key->flags))')]}
1
1
1,026
6,151
67
382
14
https://github.com/torvalds/linux
CVE-2017-15951
CWE-20
2,477
orders.c
C
update_write_brush
/** * FreeRDP: A Remote Desktop Protocol Implementation * Drawing Orders * * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2016 Armin Novak <armin.novak@thincast.com> * Copyright 2016 Thincast Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * yo...
/** * FreeRDP: A Remote Desktop Protocol Implementation * Drawing Orders * * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2016 Armin Novak <armin.novak@thincast.com> * Copyright 2016 Thincast Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * yo...
static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) { if (fieldFlags & ORDER_FIELD_01) { Stream_Write_UINT8(s, brush->x); } if (fieldFlags & ORDER_FIELD_02) { Stream_Write_UINT8(s, brush->y); } if (fieldFlags & ORDER_FIELD_03) { Stream_Write_UINT8(s, brush->style); } i...
static INLINE BOOL update_write_brush(wStream* s, rdpBrush* brush, BYTE fieldFlags) { if (fieldFlags & ORDER_FIELD_01) { Stream_Write_UINT8(s, brush->x); } if (fieldFlags & ORDER_FIELD_02) { Stream_Write_UINT8(s, brush->y); } if (fieldFlags & ORDER_FIELD_03) { Stream_Write_UINT8(s, brush->style); } i...
{'added': [(116, 'static BYTE get_cbr2_bpp(UINT32 bpp, BOOL* pValid)'), (117, '{'), (118, '\tif (pValid)'), (119, '\t\t*pValid = TRUE;'), (120, '\tswitch (bpp)'), (121, '\t{'), (122, '\t\tcase 3:'), (123, '\t\t\treturn 8;'), (124, '\t\tcase 4:'), (125, '\t\t\treturn 16;'), (126, '\t\tcase 5:'), (127, '\t\t\treturn 24;'...
98
24
3,271
19,873
39
246
8
https://github.com/FreeRDP/FreeRDP
CVE-2020-11096
CWE-125
984
gup.c
C
gup_huge_pmd
#include <linux/kernel.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/spinlock.h> #include <linux/mm.h> #include <linux/memremap.h> #include <linux/pagemap.h> #include <linux/rmap.h> #include <linux/swap.h> #include <linux/swapops.h> #include <linux/sched/signal.h> #include <linux/rwsem.h> #includ...
#include <linux/kernel.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/spinlock.h> #include <linux/mm.h> #include <linux/memremap.h> #include <linux/pagemap.h> #include <linux/rmap.h> #include <linux/swap.h> #include <linux/swapops.h> #include <linux/sched/signal.h> #include <linux/rwsem.h> #includ...
static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, unsigned long end, int write, struct page **pages, int *nr) { struct page *head, *page; int refs; if (!pmd_access_permitted(orig, write)) return 0; if (pmd_devmap(orig)) return __gup_device_huge_pmd(orig, pmdp, addr, end, pages, nr); ref...
static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr, unsigned long end, int write, struct page **pages, int *nr) { struct page *head, *page; int refs; if (!pmd_access_permitted(orig, write)) return 0; if (pmd_devmap(orig)) return __gup_device_huge_pmd(orig, pmdp, addr, end, pages, nr); ref...
{'added': [(160, '\tif (flags & FOLL_GET) {'), (161, '\t\tif (unlikely(!try_get_page(page))) {'), (162, '\t\t\tpage = ERR_PTR(-ENOMEM);'), (163, '\t\t\tgoto out;'), (164, '\t\t}'), (165, '\t}'), (302, '\t\t\tif (unlikely(!try_get_page(page))) {'), (303, '\t\t\t\tspin_unlock(ptl);'), (304, '\t\t\t\treturn ERR_PTR(-ENOME...
36
12
1,194
7,593
31
208
7
https://github.com/torvalds/linux
CVE-2019-11487
CWE-416
2,975
sparse_fill_empty_rows_op.cc
C++
tensorflow::SparseFillEmptyRowsOpImpl
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
void SparseFillEmptyRowsOpImpl(OpKernelContext* context, AsyncOpKernel::DoneCallback done = nullptr) { // Note that setting this empty lambda as the default parameter value directly // can cause strange compiler/linker errors, so we do it like this instead. if (!done) { done = [...
void SparseFillEmptyRowsOpImpl(OpKernelContext* context, AsyncOpKernel::DoneCallback done = nullptr) { // Note that setting this empty lambda as the default parameter value directly // can cause strange compiler/linker errors, so we do it like this instead. if (!done) { done = [...
{'added': [(231, ' // Also add check that dense rank > 0.'), (232, ' OP_REQUIRES_ASYNC(context, dense_shape_t.NumElements() != 0,'), (233, ' errors::InvalidArgument("Dense shape cannot be empty."),'), (234, ' done);')], 'deleted': [(231, ' // dense_shape. Also add check that de...
4
1
283
2,031
37
279
2
https://github.com/tensorflow/tensorflow
CVE-2021-29565
CWE-476
2,194
interface.c
C
PHP_FUNCTION
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +---------...
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +---------...
PHP_FUNCTION(curl_unescape) { char *str = NULL, *out = NULL; size_t str_len = 0; int out_len; zval *zid; php_curl *ch; if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) { return; } if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, ...
PHP_FUNCTION(curl_unescape) { char *str = NULL, *out = NULL; size_t str_len = 0; int out_len; zval *zid; php_curl *ch; if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) { return; } if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, ...
{'added': [(3520, '\tsize_t str_len = 0;'), (3532, '\tif (ZEND_SIZE_T_INT_OVFL(str_len)) {'), (3533, '\t\tRETURN_FALSE;'), (3534, '\t}'), (3535, ''), (3563, '\tif (ZEND_SIZE_T_INT_OVFL(str_len)) {')], 'deleted': [(3520, '\tsize_t str_len = 0;'), (3559, '\tif (str_len > INT_MAX) {')]}
6
2
2,517
15,553
23
136
5
https://github.com/php/php-src
CVE-2016-7134
CWE-119
1,207
ldo.c
C
luaD_callnoyield
/* ** $Id: ldo.c $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ #define ldo_c #define LUA_CORE #include "lprefix.h" #include <setjmp.h> #include <stdlib.h> #include <string.h> #include "lua.h" #include "lapi.h" #include "ldebug.h" #include "ldo.h" #include "lfunc.h" #include "lgc.h" #inc...
/* ** $Id: ldo.c $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ #define ldo_c #define LUA_CORE #include "lprefix.h" #include <setjmp.h> #include <stdlib.h> #include <string.h> #include "lua.h" #include "lapi.h" #include "ldebug.h" #include "ldo.h" #include "lfunc.h" #include "lgc.h" #inc...
void luaD_callnoyield (lua_State *L, StkId func, int nResults) { incXCcalls(L); if (getCcalls(L) <= CSTACKERR) /* possible stack overflow? */ luaE_freeCI(L); luaD_call(L, func, nResults); decXCcalls(L); }
void luaD_callnoyield (lua_State *L, StkId func, int nResults) { incXCcalls(L); if (getCcalls(L) <= CSTACKERR) { /* possible C stack overflow? */ luaE_exitCcall(L); /* to compensate decrement in next call */ luaE_enterCcall(L); /* check properly */ } luaD_call(L, func, nResults); decXCcalls(L); }
{'added': [(521, ' if (getCcalls(L) <= CSTACKERR) { /* possible C stack overflow? */'), (522, ' luaE_exitCcall(L); /* to compensate decrement in next call */'), (523, ' luaE_enterCcall(L); /* check properly */'), (524, ' }')], 'deleted': [(518, '** If there is a stack overflow, freeing all CI structures will...
4
5
581
4,293
7
47
2
https://github.com/lua/lua
CVE-2020-24342
CWE-119
3,163
verifier.c
C
check_alu_op
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * Copyright (c) 2016 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in th...
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * Copyright (c) 2016 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in th...
static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); int err; if (opcode == BPF_END || opcode == BPF_NEG) { if (opcode == BPF_NEG) { if (BPF_SRC(insn->code) != 0 || insn->src_reg != BPF_REG_0 || ...
static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); int err; if (opcode == BPF_END || opcode == BPF_NEG) { if (opcode == BPF_NEG) { if (BPF_SRC(insn->code) != 0 || insn->src_reg != BPF_REG_0 || ...
{'added': [(1070, '/* truncate register to smaller size (in bytes)'), (1071, ' * must be called with size < BPF_REG_SIZE'), (1072, ' */'), (1073, 'static void coerce_reg_to_size(struct bpf_reg_state *reg, int size)'), (1074, '{'), (1075, '\tu64 mask;'), (1076, ''), (1077, '\t/* clear high bits in bit representation */'...
27
17
3,248
20,663
117
811
49
https://github.com/torvalds/linux
CVE-2017-16996
CWE-119
2,425
activations.cc
C++
tflite::ops::builtin::activations::LogSoftmaxEval
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
TfLiteStatus LogSoftmaxEval(TfLiteContext* context, TfLiteNode* node) { const LogSoftmaxOpData* data = reinterpret_cast<LogSoftmaxOpData*>(node->user_data); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); switch (input->type) { case kTfLiteFl...
TfLiteStatus LogSoftmaxEval(TfLiteContext* context, TfLiteNode* node) { const LogSoftmaxOpData* data = reinterpret_cast<LogSoftmaxOpData*>(node->user_data); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input)); TfLiteTensor* output; TF_LITE_ENSURE_OK(context, Get...
{'added': [(255, ' const TfLiteTensor* input;'), (256, ' TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, 0, &input));'), (257, ' TfLiteTensor* output;'), (258, ' TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output));'), (277, ' const TfLiteTensor* input;'), (278, ' TF_LITE_ENSURE_OK(context,...
88
44
1,316
9,729
56
379
6
https://github.com/tensorflow/tensorflow
CVE-2020-15211
CWE-125
1,631
imagew-main.c
C
iw_process_rows_intermediate_to_final
// imagew-main.c // Part of ImageWorsener, Copyright (c) 2011 by Jason Summers. // For more information, see the readme.txt file. #include "imagew-config.h" #include <stdlib.h> #include <string.h> #include <math.h> #include "imagew-internals.h" // Given a color type having an alpha channel, returns the index of th...
// imagew-main.c // Part of ImageWorsener, Copyright (c) 2011 by Jason Summers. // For more information, see the readme.txt file. #include "imagew-config.h" #include <stdlib.h> #include <string.h> #include <math.h> #include "imagew-internals.h" // Given a color type having an alpha channel, returns the index of th...
static int iw_process_rows_intermediate_to_final(struct iw_context *ctx, int intermed_channel, const struct iw_csdescr *out_csdescr) { int i,j; int z; int k; int retval=0; iw_tmpsample tmpsamp; iw_tmpsample alphasamp = 0.0; iw_tmpsample *inpix_tofree = NULL; // Used if we need a separate temp buffer for input s...
static int iw_process_rows_intermediate_to_final(struct iw_context *ctx, int intermed_channel, const struct iw_csdescr *out_csdescr) { int i,j; int z; int k; int retval=0; iw_tmpsample tmpsamp; iw_tmpsample alphasamp = 0.0; iw_tmpsample *inpix_tofree = NULL; // Used if we need a separate temp buffer for input s...
{'added': [(952, '\tstruct iw_channelinfo_out default_ci_out;'), (959, '\tif(output_channel>=0) {'), (960, '\t\tout_ci = &ctx->img2_ci[output_channel];'), (961, '\t}'), (962, '\telse {'), (963, '\t\t// If there is no output channelinfo struct, create a temporary one to'), (964, '\t\t// use.'), (965, '\t\t// TODO: This ...
15
3
1,670
13,487
151
1,086
48
https://github.com/jsummers/imageworsener
CVE-2017-9203
CWE-787
2,725
ngiflib.c
C
WritePixel
#ifndef NGIFLIB_NO_FILE #include <stdio.h> #endif /* NGIFLIB_NO_FILE */ #include "ngiflib.h" /* decodeur GIF en C portable (pas de pb big/little endian) * Thomas BERNARD. janvier 2004. * (c) 2004-2017 Thomas Bernard. All rights reserved */ /* Fonction de debug */ #ifdef DEBUG void fprintf_ngiflib_img(FILE * f, st...
#ifndef NGIFLIB_NO_FILE #include <stdio.h> #endif /* NGIFLIB_NO_FILE */ #include "ngiflib.h" /* decodeur GIF en C portable (pas de pb big/little endian) * Thomas BERNARD. janvier 2004. * (c) 2004-2019 Thomas Bernard. All rights reserved */ /* Fonction de debug */ #ifdef DEBUG void fprintf_ngiflib_img(FILE * f, st...
static void WritePixel(struct ngiflib_img * i, struct ngiflib_decode_context * context, u8 v) { struct ngiflib_gif * p = i->parent; if(v!=i->gce.transparent_color || !i->gce.transparent_flag) { #ifndef NGIFLIB_INDEXED_ONLY if(p->mode & NGIFLIB_MODE_INDEXED) { #endif /* NGIFLIB_INDEXED_ONLY */ *context->frbuff_p...
static void WritePixel(struct ngiflib_img * i, struct ngiflib_decode_context * context, u8 v) { struct ngiflib_gif * p = i->parent; if(v!=i->gce.transparent_color || !i->gce.transparent_flag) { #ifndef NGIFLIB_INDEXED_ONLY if(p->mode & NGIFLIB_MODE_INDEXED) { #endif /* NGIFLIB_INDEXED_ONLY */ *context->frbuff_p...
{'added': [(9, ' * (c) 2004-2019 Thomas Bernard. All rights reserved'), (149, '\t\twhile(context->pass > 0 && context->pass < 4 &&'), (150, '\t\t context->curY >= p->height) {'), (151, '\t\t\tswitch(++context->pass) {'), (152, '\t\t\tcase 2:\t/* 2nd pass : every eighth row starting from 4 */'), (153, '\t\t\t\tcont...
29
25
594
5,196
58
441
19
https://github.com/miniupnp/ngiflib
CVE-2019-16346
CWE-787
2,839
unsquash-4.c
C
read_filesystem_tables_4
/* * Unsquash a squashfs filesystem. This is a highly compressed read only * filesystem. * * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2019 * Phillip Lougher <phillip@squashfs.org.uk> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licen...
/* * Unsquash a squashfs filesystem. This is a highly compressed read only * filesystem. * * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2019 * Phillip Lougher <phillip@squashfs.org.uk> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licen...
int read_filesystem_tables_4() { long long directory_table_end, table_start; if(read_xattrs_from_disk(fd, &sBlk.s, no_xattrs, &table_start) == 0) return FALSE; if(read_uids_guids(&table_start) == FALSE) return FALSE; if(parse_exports_table(&table_start) == FALSE) return FALSE; if(read_fragment_table(&dir...
int read_filesystem_tables_4() { long long table_start; /* Read xattrs */ if(sBlk.s.xattr_id_table_start != SQUASHFS_INVALID_BLK) { /* sanity check super block contents */ if(sBlk.s.xattr_id_table_start >= sBlk.s.bytes_used) { ERROR("read_filesystem_tables: xattr id table start too large in super block\n"); ...
{'added': [(32, 'long long *alloc_index_table(int indexes)'), (34, '\tstatic long long *alloc_table = NULL;'), (35, '\tstatic int alloc_size = 0;'), (36, '\tint length = indexes * sizeof(long long);'), (37, ''), (38, '\tif(alloc_size < length) {'), (39, '\t\tlong long *table = realloc(alloc_table, length);'), (40, ''),...
195
39
416
2,722
21
127
8
https://github.com/plougher/squashfs-tools
CVE-2015-4645
CWE-190
425
archive_read_support_format_iso9660.c
C
choose_volume
/*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Andreas Henriksson <andreas@fatal.se> * Copyright (c) 2009-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * ...
/*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Andreas Henriksson <andreas@fatal.se> * Copyright (c) 2009-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * ...
choose_volume(struct archive_read *a, struct iso9660 *iso9660) { struct file_info *file; int64_t skipsize; struct vd *vd; const void *block; char seenJoliet; vd = &(iso9660->primary); if (!iso9660->opt_support_joliet) iso9660->seenJoliet = 0; if (iso9660->seenJoliet && vd->location > iso9660->joliet.locati...
choose_volume(struct archive_read *a, struct iso9660 *iso9660) { struct file_info *file; int64_t skipsize; struct vd *vd; const void *block; char seenJoliet; vd = &(iso9660->primary); if (!iso9660->opt_support_joliet) iso9660->seenJoliet = 0; if (iso9660->seenJoliet && vd->location > iso9660->joliet.locati...
{'added': [(1094, '\tskipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;'), (1132, '\t\tskipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;')], 'deleted': [(1094, '\tskipsize = LOGICAL_BLOCK_SIZE * vd->location;'), (1132, '\t\tskipsize = LOGICAL_BLOCK_SIZE * vd->location;')]}
2
2
2,297
14,310
65
417
18
https://github.com/libarchive/libarchive
CVE-2016-5844
CWE-190
878
elf.c
C
store_versioninfo_gnu_verneed
/* radare - LGPL - Copyright 2008-2017 - nibble, pancake, alvaro_fe */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <r_types.h> #include <r_util.h> #include "elf.h" #ifdef IFDBG #undef IFDBG #endif #define DO_THE_DBG 0 #define IFDBG if (DO_THE_DBG) #define IFINT if (0) #de...
/* radare - LGPL - Copyright 2008-2017 - nibble, pancake, alvaro_fe */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <r_types.h> #include <r_util.h> #include "elf.h" #ifdef IFDBG #undef IFDBG #endif #define DO_THE_DBG 0 #define IFDBG if (DO_THE_DBG) #define IFINT if (0) #de...
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) {...
static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { ut8 *end, *need = NULL; const char *section_name = ""; Elf_(Shdr) *link_shdr = NULL; const char *link_section_name = ""; Sdb *sdb_vernaux = NULL; Sdb *sdb_version = NULL; Sdb *sdb = NULL; int i, cnt; if (!bin || !bin->dynstr) {...
{'added': [(708, '\tif (shdr->sh_size < 1 || shdr->sh_size > SIZE_MAX) {'), (840, '\tif (shdr->sh_size < 1 || shdr->sh_size > SIZE_MAX) {')], 'deleted': [(708, '\tif (shdr->sh_size < 1) {'), (840, '\tif (shdr->sh_size < 1) {')]}
2
2
2,830
21,469
136
1,055
28
https://github.com/radare/radare2
CVE-2017-16357
CWE-119
678
tee_svc_cryp.c
C
syscall_obj_generate_key
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2014, STMicroelectronics International N.V. */ #include <assert.h> #include <compiler.h> #include <crypto/crypto.h> #include <kernel/tee_ta_manager.h> #include <mm/tee_mmu.h> #include <string_ext.h> #include <string.h> #include <sys/queue.h> #include <tee_a...
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2014, STMicroelectronics International N.V. */ #include <assert.h> #include <compiler.h> #include <crypto/crypto.h> #include <kernel/tee_ta_manager.h> #include <mm/tee_mmu.h> #include <string_ext.h> #include <string.h> #include <sys/queue.h> #include <tee_a...
TEE_Result syscall_obj_generate_key(unsigned long obj, unsigned long key_size, const struct utee_attribute *usr_params, unsigned long param_count) { TEE_Result res; struct tee_ta_session *sess; const struct tee_cryp_obj_type_props *type_props; struct tee_obj *o; struct tee_cryp_obj_secret *key; size_t byte_...
TEE_Result syscall_obj_generate_key(unsigned long obj, unsigned long key_size, const struct utee_attribute *usr_params, unsigned long param_count) { TEE_Result res; struct tee_ta_session *sess; const struct tee_cryp_obj_type_props *type_props; struct tee_obj *o; struct tee_cryp_obj_secret *key; size_t byte_...
{'added': [(1762, '\tsize_t alloc_size = 0;'), (1763, ''), (1764, '\tif (MUL_OVERFLOW(sizeof(TEE_Attribute), param_count, &alloc_size))'), (1765, '\t\treturn TEE_ERROR_OVERFLOW;'), (1766, ''), (1767, '\tparams = malloc(alloc_size);'), (2676, '\tsize_t alloc_size = 0;'), (2677, ''), (2678, '\tif (MUL_OVERFLOW(sizeof(TEE...
12
2
2,819
15,929
104
568
36
https://github.com/OP-TEE/optee_os
CVE-2019-1010297
CWE-787
336
read-packet.c
C
read_32
/* read-packet.c - Read OpenPGP packets * Copyright (C) 2001-2012 Free Software Foundation, Inc. * * Author: Timo Schulz * * This file is part of OpenCDK. * * The OpenCDK library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published...
/* read-packet.c - Read OpenPGP packets * Copyright (C) 2001-2012 Free Software Foundation, Inc. * * Author: Timo Schulz * * This file is part of OpenCDK. * * The OpenCDK library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published...
static u32 read_32(cdk_stream_t s) { byte buf[4]; size_t nread; assert(s != NULL); stream_read(s, buf, 4, &nread); if (nread != 4) return (u32) - 1; return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]; }
static u32 read_32(cdk_stream_t s) { byte buf[4]; size_t nread = 0; assert(s != NULL); stream_read(s, buf, 4, &nread); if (nread != 4) return (u32) -1; return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]; }
{'added': [(45, ''), (59, '\tsize_t nread = 0;'), (65, '\t\treturn (u32) -1;'), (74, '\tsize_t nread = 0;'), (576, '\tint c, c1;'), (591, ''), (594, '\t\tif (size == (u32)-1)'), (595, '\t\t\treturn CDK_Inv_Packet;'), (596, ''), (600, '\t\tif (c1 == EOF)'), (601, '\t\t\treturn CDK_Inv_Packet;'), (602, ''), (869, '\tint ...
35
5
932
5,970
10
78
2
https://gitlab.com/gnutls/gnutls
CVE-2017-5335
CWE-125
2,994
stats_ops.cc
C++
tensorflow::BoostedTreesCalculateBestFeatureSplitOp::Compute
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
void Compute(OpKernelContext* const context) override { // node_id_range const Tensor* node_id_range_t; OP_REQUIRES_OK(context, context->input("node_id_range", &node_id_range_t)); OP_REQUIRES( context, node_id_range_t->NumElements() == 2, errors::InvalidArgument("node_id_range argument...
void Compute(OpKernelContext* const context) override { // node_id_range const Tensor* node_id_range_t; OP_REQUIRES_OK(context, context->input("node_id_range", &node_id_range_t)); OP_REQUIRES( context, node_id_range_t->NumElements() == 2, errors::InvalidArgument("node_id_range argument...
{'added': [(75, ' OP_REQUIRES(context, stats_summary_list[0].dim_size(2) == 2,'), (76, ' errors::InvalidArgument("stats_summary_list[0] must have "'), (77, ' "exactly 2 dimensions, obtained: ",'), (78, ' stats_summary_list[0...
49
6
1,404
10,654
152
1,219
8
https://github.com/tensorflow/tensorflow
CVE-2021-41208
CWE-476
41
dnxhddec.c
C
dnxhd_decode_header
/* * VC3/DNxHD decoder. * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com> * Copyright (c) 2011 MirriAd Ltd * Copyright (c) 2015 Christophe Gisquet * * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com> * Slice multithreading and MB inter...
/* * VC3/DNxHD decoder. * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com> * Copyright (c) 2011 MirriAd Ltd * Copyright (c) 2015 Christophe Gisquet * * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com> * Slice multithreading and MB inter...
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, const uint8_t *buf, int buf_size, int first_field) { int i, cid, ret; int old_bit_depth = ctx->bit_depth, bitdepth; uint64_t header_prefix; if (buf_size < 0x280) { av_l...
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, const uint8_t *buf, int buf_size, int first_field) { int i, cid, ret; int old_bit_depth = ctx->bit_depth, bitdepth; uint64_t header_prefix; if (buf_size < 0x280) { av_l...
{'added': [(301, ' if (ctx->mb_height > 68) {'), (308, ' if ((ctx->mb_height << frame->interlaced_frame) > (ctx->height + 15) >> 4) {'), (309, ' av_log(ctx->avctx, AV_LOG_ERROR,'), (310, ' "mb height too big: %d\\n", ctx->mb_height);'), (311, ' return AVERROR_INVALIDDATA;'), (312,...
6
2
599
4,605
138
1,095
36
https://github.com/FFmpeg/FFmpeg
CVE-2017-11719
CWE-125
1,752
websockets.c
C
webSocketsDecodeHybi
/* * websockets.c - deal with WebSockets clients. * * This code should be independent of any changes in the RFB protocol. It is * an additional handshake and framing of normal sockets: * http://www.whatwg.org/specs/web-socket-protocol/ * */ /* * Copyright (C) 2010 Joel Martin * * This is free software; y...
/* * websockets.c - deal with WebSockets clients. * * This code should be independent of any changes in the RFB protocol. It is * an additional handshake and framing of normal sockets: * http://www.whatwg.org/specs/web-socket-protocol/ * */ /* * Copyright (C) 2010 Joel Martin * * This is free software; y...
webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len) { char *buf, *payload; uint32_t *payload32; int ret = -1, result = -1; int total = 0; ws_mask_t mask; ws_header_t *header; int i; unsigned char opcode; ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx; int flength, fhlen; /* in...
webSocketsDecodeHybi(rfbClientPtr cl, char *dst, int len) { int result = -1; ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx; /* int fin; */ /* not used atm */ /* rfbLog(" <== %s[%d]: %d cl: %p, wsctx: %p-%p (%d)\n", __func__, gettid(), len, cl, wsctx, (char *)wsctx + sizeof(ws_ctx_t), sizeof(ws_ctx_t)); */ ...
{'added': [(80, '#define WS_HYBI_MASK_LEN 4'), (81, ''), (82, '#define ARRAYSIZE(a) ((sizeof(a) / sizeof((a[0]))) / (size_t)(!(sizeof(a) % sizeof((a[0])))))'), (99, ''), (100, 'enum {'), (101, ' /* header not yet received completely */'), (102, ' WS_HYBI_STATE_HEADER_PENDING,'), (103, ' /* data available */'), (104,...
463
132
872
5,734
110
729
21
https://github.com/LibVNC/libvncserver
CVE-2017-18922
CWE-787
721
redis.c
C
genRedisInfoString
/* * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above co...
/* * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above co...
sds genRedisInfoString(void) { sds info; time_t uptime = time(NULL)-server.stat_starttime; int j; char hmem[64]; struct rusage self_ru, c_ru; getrusage(RUSAGE_SELF, &self_ru); getrusage(RUSAGE_CHILDREN, &c_ru); bytesToHuman(hmem,zmalloc_used_memory()); info = sdscatprintf(sdsempty(...
sds genRedisInfoString(void) { sds info; time_t uptime = time(NULL)-server.stat_starttime; int j; char hmem[64]; struct rusage self_ru, c_ru; getrusage(RUSAGE_SELF, &self_ru); getrusage(RUSAGE_CHILDREN, &c_ru); bytesToHuman(hmem,zmalloc_used_memory()); info = sdscatprintf(sdsempty(...
{'added': [(621, ' /* Remove a few cached objects from memory if we are over the'), (622, ' * configured memory limit */'), (623, ' while (server.ds_enabled && zmalloc_used_memory() >'), (624, ' server.cache_max_memory)'), (625, ' {'), (626, ' cacheFreeOneEntry();'), (644, ' /* Awake c...
24
63
1,198
9,350
180
849
14
https://github.com/antirez/redis
CVE-2013-0178
CWE-20
2,555
verifier.c
C
adjust_scalar_min_max_vals
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * Copyright (c) 2016 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in th...
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * Copyright (c) 2016 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in th...
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, struct bpf_insn *insn, struct bpf_reg_state *dst_reg, struct bpf_reg_state src_reg) { struct bpf_reg_state *regs = cur_regs(env); u8 opcode = BPF_OP(insn->code); bool src_known, dst_known; s64 smin_val, smax_val; u64 ...
{'added': [(2899, '\tif (insn_bitness == 32) {'), (2900, '\t\t/* Relevant for 32-bit RSH: Information can propagate towards'), (2901, "\t\t * LSB, so it isn't sufficient to only truncate the output to"), (2902, '\t\t * 32 bits.'), (2903, '\t\t */'), (2904, '\t\tcoerce_reg_to_size(dst_reg, 4);'), (2905, '\t\tcoerce_reg_...
9
1
4,230
27,473
177
1,072
44
https://github.com/torvalds/linux
CVE-2018-18445
CWE-125
2,055
avc_ext.c
C
AV1_RewriteESDescriptorEx
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
void AV1_RewriteESDescriptorEx(GF_MPEGVisualSampleEntryBox *av1, GF_MediaBox *mdia) { GF_BitRateBox *btrt = gf_isom_sample_entry_get_bitrate((GF_SampleEntryBox *)av1, GF_FALSE); if (av1->emul_esd) gf_odf_desc_del((GF_Descriptor *)av1->emul_esd); av1->emul_esd = gf_odf_desc_esd_new(2); av1->emul_esd->decoderConfig-...
void AV1_RewriteESDescriptorEx(GF_MPEGVisualSampleEntryBox *av1, GF_MediaBox *mdia) { GF_BitRateBox *btrt = gf_isom_sample_entry_get_bitrate((GF_SampleEntryBox *)av1, GF_FALSE); if (av1->emul_esd) gf_odf_desc_del((GF_Descriptor *)av1->emul_esd); av1->emul_esd = gf_odf_desc_esd_new(2); av1->emul_esd->decoderConfig-...
{'added': [(1341, 'static GF_AV1Config* AV1_DuplicateConfig(GF_AV1Config const * const cfg)'), (1342, '{'), (1386, '\tif (av1->av1_config && av1->av1_config->config) {'), (2410, '\tif (!entry || !entry->av1_config|| !entry->av1_config->config) return NULL;')], 'deleted': [(1341, 'static GF_AV1Config* AV1_DuplicateConfi...
4
3
3,034
23,825
20
174
5
https://github.com/gpac/gpac
CVE-2021-31262
CWE-476