cwe
stringclasses
9 values
func_name
stringclasses
551 values
func_src_before
stringlengths
72
114k
func_src_after
stringclasses
576 values
line_changes
stringclasses
576 values
char_changes
stringclasses
574 values
commit_link
stringclasses
430 values
file_name
stringclasses
411 values
vul_type
stringclasses
9 values
num_tokens
float64
16
28.1k
⌀
refactored
bool
2 classes
parsing_score
bool
2 classes
generated
bool
2 classes
cwe-125
php_wddx_push_element
*/ static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts) { st_entry ent; wddx_stack *stack = (wddx_stack *)user_data; if (!strcmp(name, EL_PACKET)) { int i; if (atts) for (i=0; atts[i]; i++) { if (!strcmp(atts[i], EL_VERSION)) { /* nothing for now */ } } ...
*/ static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts) { st_entry ent; wddx_stack *stack = (wddx_stack *)user_data; if (!strcmp(name, EL_PACKET)) { int i; if (atts) for (i=0; atts[i]; i++) { if (!strcmp(atts[i], EL_VERSION)) { /* nothing for now */ } } ...
{'deleted': [], 'added': [{'line_no': 71, 'char_start': 1972, 'char_end': 1983, 'line': '\t\t} else {\n'}, {'line_no': 72, 'char_start': 1983, 'char_end': 2009, 'line': '\t\t\tent.type = ST_BOOLEAN;\n'}, {'line_no': 73, 'char_start': 2009, 'char_end': 2031, 'line': '\t\t\tSET_STACK_VARNAME;\n'}, {'line_no': 74, 'char_s...
{'deleted': [], 'added': [{'char_start': 1975, 'char_end': 2125, 'chars': ' else {\n\t\t\tent.type = ST_BOOLEAN;\n\t\t\tSET_STACK_VARNAME;\n\t\t\tZVAL_FALSE(&ent.data);\n\t\t\twddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry));\n\t\t}'}]}
github.com/php/php-src/commit/66fd44209d5ffcb9b3d1bc1b9fd8e35b485040c0
ext/wddx/wddx.c
cwe-125
1,595
false
false
false
cwe-125
hid_input_field
static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; unsigned offset = field->report_offset; unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; __...
static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt) { unsigned n; unsigned count = field->report_count; unsigned offset = field->report_offset; unsigned size = field->report_size; __s32 min = field->logical_minimum; __s32 max = field->logical_maximum; __...
{'deleted': [], 'added': [{'line_no': 26, 'char_start': 740, 'char_end': 782, 'line': '\t\t value[n] - min < field->maxusage &&\n'}, {'line_no': 39, 'char_start': 1088, 'char_end': 1134, 'line': '\t\t\t&& field->value[n] - min < field->maxusage\n'}, {'line_no': 45, 'char_start': 1354, 'char_end': 1393, 'line': '\t\t...
{'deleted': [{'char_start': 803, 'char_end': 803, 'chars': ''}, {'char_start': 1225, 'char_end': 1225, 'chars': ''}], 'added': [{'char_start': 746, 'char_end': 788, 'chars': 'value[n] - min < field->maxusage &&\n\t\t '}, {'char_start': 1088, 'char_end': 1134, 'chars': '\t\t\t&& field->value[n] - min < field->maxusag...
github.com/torvalds/linux/commit/50220dead1650609206efe91f0cc116132d59b3f
drivers/hid/hid-core.c
cwe-125
460
false
true
false
cwe-125
read_quant_matrix_ext
static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb) { int i, j, v; if (get_bits1(gb)) { /* intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->idsp.idct_permutation[ff_zigzag_direct[i]]; s->intra_matrix[j] ...
static int read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb) { int i, j, v; if (get_bits1(gb)) { if (get_bits_left(gb) < 64*8) return AVERROR_INVALIDDATA; /* intra_quantiser_matrix */ for (i = 0; i < 64; i++) { v = get_bits(gb, 8); j = s->id...
{'deleted': [{'line_no': 1, 'char_start': 0, 'char_end': 72, 'line': 'static void read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb)\n'}], 'added': [{'line_no': 1, 'char_start': 0, 'char_end': 71, 'line': 'static int read_quant_matrix_ext(MpegEncContext *s, GetBitContext *gb)\n'}, {'line_no': 6, 'char_start': ...
{'deleted': [{'char_start': 7, 'char_end': 9, 'chars': 'vo'}, {'char_start': 10, 'char_end': 11, 'chars': 'd'}], 'added': [{'char_start': 8, 'char_end': 10, 'chars': 'nt'}, {'char_start': 115, 'char_end': 193, 'chars': '\n if (get_bits_left(gb) < 64*8)\n return AVERROR_INVALIDDATA;'}, {'char_start': 4...
github.com/FFmpeg/FFmpeg/commit/5aba5b89d0b1d73164d3b81764828bb8b20ff32a
libavcodec/mpeg4videodec.c
cwe-125
315
false
true
false
cwe-125
ReadSUNImage
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define RMT_EQUAL_RGB 1 #define RMT_NONE 0 #define RMT_RAW 2 #define RT_STANDARD 1 #define RT_ENCODED 2 #define RT_FORMAT_RGB 3 typedef struct _SUNInfo { unsigned int magic, width, height, depth, ...
static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define RMT_EQUAL_RGB 1 #define RMT_NONE 0 #define RMT_RAW 2 #define RT_STANDARD 1 #define RT_ENCODED 2 #define RT_FORMAT_RGB 3 typedef struct _SUNInfo { unsigned int magic, width, height, depth, ...
{'deleted': [{'line_no': 201, 'char_start': 6237, 'char_end': 6310, 'line': ' ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");\n'}, {'line_no': 217, 'char_start': 7201, 'char_end': 7274, 'line': ' ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");\n'}, {'line_no': 221, 'char_...
{'deleted': [{'char_start': 6284, 'char_end': 6286, 'chars': 'Me'}, {'char_start': 6289, 'char_end': 6295, 'chars': 'yAlloc'}, {'char_start': 6296, 'char_end': 6304, 'chars': 'tionFail'}, {'char_start': 7248, 'char_end': 7250, 'chars': 'Me'}, {'char_start': 7253, 'char_end': 7259, 'chars': 'yAlloc'}, {'char_start': 726...
github.com/ImageMagick/ImageMagick/commit/6b4aff0f117b978502ee5bcd6e753c17aec5a961
coders/sun.c
cwe-125
3,541
false
true
false
cwe-125
ape_decode_frame
static int ape_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; APEContext *s = avctx->priv_data; uint8_t *sample8; int16_t *sample16; int32_t *sample24; int i, ch, ...
static int ape_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; APEContext *s = avctx->priv_data; uint8_t *sample8; int16_t *sample16; int32_t *sample24; int i, ch, ...
{'deleted': [{'line_no': 67, 'char_start': 2347, 'char_end': 2392, 'line': ' if (!nblocks || nblocks > INT_MAX) {\n'}, {'line_no': 93, 'char_start': 3163, 'char_end': 3220, 'line': ' av_fast_malloc(&s->decoded_buffer, &s->decoded_size,\n'}, {'line_no': 94, 'char_start': 3220, 'char_end': 3301, 'line': ' ...
{'deleted': [{'char_start': 3167, 'char_end': 3186, 'chars': 'av_fast_malloc(&s->'}, {'char_start': 3200, 'char_end': 3213, 'chars': ', &s->decoded'}, {'char_start': 3218, 'char_end': 3231, 'chars': ',\n '}, {'char_start': 3232, 'char_end': 3238, 'chars': ' '}], 'added': [{'char_start': 349, 'char_end': ...
github.com/FFmpeg/FFmpeg/commit/ba4beaf6149f7241c8bd85fe853318c2f6837ad0
libavcodec/apedec.c
cwe-125
1,396
false
false
false
cwe-125
parallel_process_irp_create
static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; UINT32 PathLength; Stream_Seek(irp->input, 28); /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */ Stream_Read_UINT32(irp->input, Pat...
static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; WCHAR* ptr; UINT32 PathLength; if (!Stream_SafeSeek(irp->input, 28)) return ERROR_INVALID_DATA; /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), Crea...
{'deleted': [{'line_no': 6, 'char_start': 132, 'char_end': 162, 'line': '\tStream_Seek(irp->input, 28);\n'}, {'line_no': 10, 'char_start': 330, 'char_end': 423, 'line': '\tstatus = ConvertFromUnicode(CP_UTF8, 0, (WCHAR*)Stream_Pointer(irp->input), PathLength / 2,\n'}, {'line_no': 11, 'char_start': 423, 'char_end': 475,...
{'deleted': [{'char_start': 331, 'char_end': 332, 'chars': 's'}, {'char_start': 333, 'char_end': 345, 'chars': 'atus = Conve'}, {'char_start': 346, 'char_end': 367, 'chars': 'tFromUnicode(CP_UTF8,'}, {'char_start': 368, 'char_end': 370, 'chars': '0,'}, {'char_start': 417, 'char_end': 422, 'chars': ' / 2,'}, {'char_star...
github.com/FreeRDP/FreeRDP/commit/795842f4096501fcefc1a7f535ccc8132feb31d7
channels/parallel/client/parallel_main.c
cwe-125
334
false
false
false
cwe-125
mpeg4_decode_studio_block
static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scan...
static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scan...
{'deleted': [], 'added': [{'line_no': 86, 'char_start': 2920, 'char_end': 2946, 'line': ' if (idx > 63)\n'}, {'line_no': 87, 'char_start': 2946, 'char_end': 2990, 'line': ' return AVERROR_INVALIDDATA;\n'}, {'line_no': 92, 'char_start': 3154, 'char_end': 3180, 'line': ' if (idx > 63)...
{'deleted': [{'char_start': 2954, 'char_end': 2954, 'chars': ''}, {'char_start': 3215, 'char_end': 3215, 'chars': ''}], 'added': [{'char_start': 2932, 'char_end': 3002, 'chars': 'if (idx > 63)\n return AVERROR_INVALIDDATA;\n '}, {'char_start': 3154, 'char_end': 3224, 'chars': ' if (...
github.com/FFmpeg/FFmpeg/commit/d227ed5d598340e719eff7156b1aa0a4469e9a6a
libavcodec/mpeg4videodec.c
cwe-125
1,165
false
true
false
cwe-125
Cipher::blowfishECB
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction) { QCA::Initializer init; QByteArray temp = cipherText; //do padding ourselves if (direction) { while ((temp.length() % 8) != 0) temp.append('\0'); } else { temp = b64ToByte(temp); while ((temp....
QByteArray Cipher::blowfishECB(QByteArray cipherText, bool direction) { QCA::Initializer init; QByteArray temp = cipherText; //do padding ourselves if (direction) { while ((temp.length() % 8) != 0) temp.append('\0'); } else { // ECB Blowfish encodes in blocks of 12 chars...
{'deleted': [{'line_no': 25, 'char_start': 689, 'char_end': 708, 'line': ' if (direction)\n'}], 'added': [{'line_no': 14, 'char_start': 358, 'char_end': 397, 'line': ' if ((temp.length() % 12) != 0)\n'}, {'line_no': 15, 'char_start': 397, 'char_end': 428, 'line': ' return cipherText;\n'}, {'line_no...
{'deleted': [], 'added': [{'char_start': 275, 'char_end': 437, 'chars': '// ECB Blowfish encodes in blocks of 12 chars, so anything else is malformed input\n if ((temp.length() % 12) != 0)\n return cipherText;\n\n '}, {'char_start': 869, 'char_end': 966, 'chars': ' {\n // Sanity check\n ...
github.com/quassel/quassel/commit/8b5ecd226f9208af3074b33d3b7cf5e14f55b138
src/core/cipher.cpp
cwe-125
214
false
true
false
cwe-125
DecodePSDPixels
static ssize_t DecodePSDPixels(const size_t number_compact_pixels, const unsigned char *compact_pixels,const ssize_t depth, const size_t number_pixels,unsigned char *pixels) { #define CheckNumberCompactPixels \ if (packets == 0) \ return(i); \ packets-- #define CheckNumberPixels(count) \ if (((ssize_t) i...
static ssize_t DecodePSDPixels(const size_t number_compact_pixels, const unsigned char *compact_pixels,const ssize_t depth, const size_t number_pixels,unsigned char *pixels) { #define CheckNumberCompactPixels \ if (packets == 0) \ return(i); \ packets-- #define CheckNumberPixels(count) \ if (((ssize_t) i...
{'deleted': [{'line_no': 124, 'char_start': 3556, 'char_end': 3588, 'line': ' CheckNumberCompactPixels;\n'}], 'added': [{'line_no': 86, 'char_start': 2325, 'char_end': 2357, 'line': ' CheckNumberCompactPixels;\n'}]}
{'deleted': [{'char_start': 3555, 'char_end': 3587, 'chars': '\n CheckNumberCompactPixels;'}], 'added': [{'char_start': 2331, 'char_end': 2363, 'chars': 'CheckNumberCompactPixels;\n '}]}
github.com/ImageMagick/ImageMagick/commit/30eec879c8b446b0ea9a3bb0da1a441cc8482bc4
coders/psd.c
cwe-125
1,174
false
true
false
cwe-125
ReadSGIImage
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status; MagickSizeType number_pixels; MemoryInfo *pixel_info; register Quantum *q; register ssize_t i, x; register unsigned char *p; SGIInfo iris_...
static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType status; MagickSizeType number_pixels; MemoryInfo *pixel_info; register Quantum *q; register ssize_t i, x; register unsigned char *p; SGIInfo iris_...
{'deleted': [{'line_no': 102, 'char_start': 2912, 'char_end': 2962, 'line': ' image->depth=(size_t) MagickMin((size_t) 8*\n'}, {'line_no': 103, 'char_start': 2962, 'char_end': 3023, 'line': ' iris_info.bytes_per_pixel,MAGICKCORE_QUANTUM_DEPTH);\n'}], 'added': [{'line_no': 102, 'char_start': 2912, 'char_end'...
{'deleted': [{'char_start': 2961, 'char_end': 2970, 'chars': '\n '}], 'added': [{'char_start': 2987, 'char_end': 2996, 'chars': '\n '}, {'char_start': 3176, 'char_end': 3284, 'chars': '\n if (EOFBlob(image) != MagickFalse)\n ThrowReaderException(CorruptImageError,"ImproperImageHeader");'}]}
github.com/ImageMagick/ImageMagick/commit/7afcf9f71043df15508e46f079387bd4689a738d
coders/sgi.c
cwe-125
3,922
false
true
false
cwe-125
tflite::GetOptionalInputTensor
const TfLiteTensor* GetOptionalInputTensor(const TfLiteContext* context, const TfLiteNode* node, int index) { const bool use_tensor = index < node->inputs->size && node->inputs->data[index] != kTfLiteOptionalTensor; if (use_tensor) { return Ge...
const TfLiteTensor* GetOptionalInputTensor(const TfLiteContext* context, const TfLiteNode* node, int index) { return GetInput(context, node, index); }
{'deleted': [{'line_no': 3, 'char_start': 153, 'char_end': 209, 'line': ' const bool use_tensor = index < node->inputs->size &&\n'}, {'line_no': 4, 'char_start': 209, 'char_end': 287, 'line': ' node->inputs->data[index] != kTfLiteOptionalTensor;\n'}, {'line_no': 5, 'char_start': 287, 'char_end...
{'deleted': [{'char_start': 155, 'char_end': 311, 'chars': 'const bool use_tensor = index < node->inputs->size &&\n node->inputs->data[index] != kTfLiteOptionalTensor;\n if (use_tensor) {\n '}, {'char_start': 321, 'char_end': 328, 'chars': 'Mutable'}, {'char_start': 355, 'char_end': 377, 'c...
github.com/tensorflow/tensorflow/commit/00302787b788c5ff04cb6f62aed5a74d936e86c0
tensorflow/lite/kernels/kernel_util.cc
cwe-125
83
false
true
false
cwe-125
saa7164_bus_get
int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf, int peekonly) { struct tmComResBusInfo *bus = &dev->bus; u32 bytes_to_read, write_distance, curr_grp, curr_gwp, new_grp, buf_size, space_rem; struct tmComResInfo msg_tmp; int ret = SAA_ERR_BAD_PARAMETER; saa7164_bus_verify(dev); ...
int saa7164_bus_get(struct saa7164_dev *dev, struct tmComResInfo* msg, void *buf, int peekonly) { struct tmComResBusInfo *bus = &dev->bus; u32 bytes_to_read, write_distance, curr_grp, curr_gwp, new_grp, buf_size, space_rem; struct tmComResInfo msg_tmp; int ret = SAA_ERR_BAD_PARAMETER; saa7164_bus_verify(dev); ...
{'deleted': [{'line_no': 82, 'char_start': 2348, 'char_end': 2387, 'line': '\t\tmemcpy(msg, &msg_tmp, sizeof(*msg));\n'}, {'line_no': 127, 'char_start': 3732, 'char_end': 3767, 'line': '\t\t\t/* msg wraps around the ring */\n'}, {'line_no': 128, 'char_start': 3767, 'char_end': 3831, 'line': '\t\t\tmemcpy_fromio(msg, bu...
{'deleted': [{'char_start': 2348, 'char_end': 2387, 'chars': '\t\tmemcpy(msg, &msg_tmp, sizeof(*msg));\n'}, {'char_start': 3732, 'char_end': 3921, 'chars': '\t\t\t/* msg wraps around the ring */\n\t\t\tmemcpy_fromio(msg, bus->m_pdwGetRing + curr_grp, space_rem);\n\t\t\tmemcpy_fromio((u8 *)msg + space_rem, bus->m_pdwGet...
github.com/stoth68000/media-tree/commit/354dd3924a2e43806774953de536257548b5002c
drivers/media/pci/saa7164/saa7164-bus.c
cwe-125
1,559
false
false
false
cwe-125
opmov
static int opmov(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; st64 offset = 0; int mod = 0; int base = 0; int rex = 0; ut64 immediate = 0; if (op->operands[1].type & OT_CONSTANT) { if (!op->operands[1].is_good_flag) { return -1; } if (op->operands[1].immediate == -1) { return -1; } immediat...
static int opmov(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; st64 offset = 0; int mod = 0; int base = 0; int rex = 0; ut64 immediate = 0; if (op->operands[1].type & OT_CONSTANT) { if (!op->operands[1].is_good_flag) { return -1; } if (op->operands[1].immediate == -1) { return -1; } immediat...
{'deleted': [{'line_no': 352, 'char_start': 9435, 'char_end': 9493, 'line': '\t\t\tdata[l++] = SEG_REG_PREFIXES[op->operands[1].regs[0]];\n'}, {'line_no': 354, 'char_start': 9514, 'char_end': 9561, 'line': '\t\t\tdata[l++] = op->operands[0].reg << 3 | 0x5;\n'}], 'added': [{'line_no': 352, 'char_start': 9435, 'char_end'...
{'deleted': [], 'added': [{'char_start': 9490, 'char_end': 9494, 'chars': ' % 6'}, {'char_start': 9533, 'char_end': 9541, 'chars': '(((ut32)'}, {'char_start': 9560, 'char_end': 9561, 'chars': ')'}, {'char_start': 9566, 'char_end': 9567, 'chars': ')'}]}
github.com/radare/radare2/commit/f17bfd9f1da05f30f23a4dd05e9d2363e1406948
libr/asm/p/asm_x86_nz.c
cwe-125
5,165
false
true
false
cwe-125
ntlm_read_NegotiateMessage
SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buffer) { wStream* s; size_t length; NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) retu...
SECURITY_STATUS ntlm_read_NegotiateMessage(NTLM_CONTEXT* context, PSecBuffer buffer) { wStream* s; size_t length; NTLM_NEGOTIATE_MESSAGE* message; message = &context->NEGOTIATE_MESSAGE; ZeroMemory(message, sizeof(NTLM_NEGOTIATE_MESSAGE)); s = Stream_New((BYTE*)buffer->pvBuffer, buffer->cbBuffer); if (!s) retu...
{'deleted': [], 'added': [{'line_no': 25, 'char_start': 592, 'char_end': 631, 'line': '\tif (Stream_GetRemainingLength(s) < 4)\n'}, {'line_no': 26, 'char_start': 631, 'char_end': 634, 'line': '\t{\n'}, {'line_no': 27, 'char_start': 634, 'char_end': 659, 'line': '\t\tStream_Free(s, FALSE);\n'}, {'line_no': 28, 'char_sta...
{'deleted': [], 'added': [{'char_start': 593, 'char_end': 693, 'chars': 'if (Stream_GetRemainingLength(s) < 4)\n\t{\n\t\tStream_Free(s, FALSE);\n\t\treturn SEC_E_INVALID_TOKEN;\n\t}\n\t'}]}
github.com/FreeRDP/FreeRDP/commit/8fa38359634a9910b91719818ab02f23c320dbae
winpr/libwinpr/sspi/NTLM/ntlm_message.c
cwe-125
717
false
false
false
cwe-125
enc_untrusted_read
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 ...
{'deleted': [{'line_no': 2, 'char_start': 62, 'char_end': 129, 'line': ' return static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall(\n'}], 'added': [{'line_no': 2, 'char_start': 62, 'char_end': 136, 'line': ' ssize_t ret = static_cast<ssize_t>(EnsureInitializedAndDispatchSyscall(\n'}, {'line_no': 4, 'char_start'...
{'deleted': [{'char_start': 67, 'char_end': 70, 'chars': 'urn'}], 'added': [{'char_start': 64, 'char_end': 68, 'chars': 'ssiz'}, {'char_start': 69, 'char_end': 70, 'chars': '_'}, {'char_start': 71, 'char_end': 72, 'chars': ' '}, {'char_start': 73, 'char_end': 77, 'chars': 'et ='}, {'char_start': 189, 'char_end': 364, '...
github.com/google/asylo/commit/b1d120a2c7d7446d2cc58d517e20a1b184b82200
asylo/platform/host_call/trusted/host_calls.cc
cwe-125
52
false
true
false
cwe-125
modbus_reply
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping) { int offset; int slave; int function; uint16_t address; uint8_t rsp[MAX_MESSAGE_LENGTH]; int rsp_length = 0; sft_t sft; if (ctx == NULL) { errno = EINVAL; ...
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping) { int offset; int slave; int function; uint16_t address; uint8_t rsp[MAX_MESSAGE_LENGTH]; int rsp_length = 0; sft_t sft; if (ctx == NULL) { errno = EINVAL; ...
{'deleted': [{'line_no': 140, 'char_start': 6054, 'char_end': 6106, 'line': ' if (nb < 1 || MODBUS_MAX_WRITE_BITS < nb) {\n'}, {'line_no': 171, 'char_start': 7556, 'char_end': 7613, 'line': ' if (nb < 1 || MODBUS_MAX_WRITE_REGISTERS < nb) {\n'}], 'added': [{'line_no': 138, 'char_start': 5989, 'char_end': ...
{'deleted': [], 'added': [{'char_start': 6001, 'char_end': 6040, 'chars': 'nb_bits = req[offset + 5];\n int '}, {'char_start': 6136, 'char_end': 6156, 'chars': ' < nb || nb_bits * 8'}, {'char_start': 7557, 'char_end': 7597, 'chars': 'nb_bytes = req[offset + 5];\n int '}, {'char_start': 7703, 'char_end': 7...
github.com/stephane/libmodbus/commit/5ccdf5ef79d742640355d1132fa9e2abc7fbaefc
src/modbus.c
cwe-125
3,226
false
false
false
cwe-125
ImagingFliDecode
ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8* ptr; int framesize; int c, chunks, advance; int l, lines; int i, j, x = 0, y, ymax; /* If not even the chunk size is present, we'd better leave */ if (bytes < 4) return 0; /* We don't decode ...
ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8* ptr; int framesize; int c, chunks, advance; int l, lines; int i, j, x = 0, y, ymax; /* If not even the chunk size is present, we'd better leave */ if (bytes < 4) return 0; /* We don't decode ...
{'deleted': [{'line_no': 15, 'char_start': 364, 'char_end': 434, 'line': ' input buffer (on the other hand, the Python part of the driver\n'}, {'line_no': 16, 'char_start': 434, 'char_end': 480, 'line': ' makes sure this is always the case) */\n'}], 'added': [{'line_no': 15, 'char_start': 364, 'char_end': 3...
{'deleted': [{'char_start': 384, 'char_end': 477, 'chars': '(on the other hand, the Python part of the driver\n makes sure this is always the case) '}], 'added': [{'char_start': 574, 'char_end': 668, 'chars': '\n if (bytes < 8) {\n state->errcode = IMAGING_CODEC_OVERRUN;\n return -1;\n }'}]}
github.com/python-pillow/Pillow/commit/a09acd0decd8a87ccce939d5ff65dab59e7d365b
src/libImaging/FliDecode.c
cwe-125
1,563
false
true
false
cwe-125
_bson_iter_next_internal
_bson_iter_next_internal (bson_iter_t *iter, /* INOUT */ uint32_t next_keylen, /* IN */ const char **key, /* OUT */ uint32_t *bson_type, /* OUT */ bool *unsupported) /* OUT */ { const uint8_t *data; ...
_bson_iter_next_internal (bson_iter_t *iter, /* INOUT */ uint32_t next_keylen, /* IN */ const char **key, /* OUT */ uint32_t *bson_type, /* OUT */ bool *unsupported) /* OUT */ { const uint8_t *data; ...
{'deleted': [{'line_no': 112, 'char_start': 2519, 'char_end': 2547, 'line': ' if (l >= (len - o)) {\n'}], 'added': [{'line_no': 112, 'char_start': 2519, 'char_end': 2551, 'line': ' if (l >= (len - o - 4)) {\n'}]}
{'deleted': [], 'added': [{'char_start': 2542, 'char_end': 2546, 'chars': ' - 4'}]}
github.com/mongodb/mongo-c-driver/commit/0d9a4d98bfdf4acd2c0138d4aaeb4e2e0934bd84
src/libbson/src/bson/bson-iter.c
cwe-125
2,171
false
true
false
cwe-125
match_at
match_at(regex_t* reg, const UChar* str, const UChar* end, #ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE const UChar* right_range, #endif const UChar* sstart, UChar* sprev, OnigMatchArg* msa) { static UChar FinishCode[] = { OP_FINISH }; int i, n, num_mem, best_len, pop_level; LengthType tlen, tlen...
match_at(regex_t* reg, const UChar* str, const UChar* end, #ifdef USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE const UChar* right_range, #endif const UChar* sstart, UChar* sprev, OnigMatchArg* msa) { static UChar FinishCode[] = { OP_FINISH }; int i, n, num_mem, best_len, pop_level; LengthType tlen, tlen...
{'deleted': [{'line_no': 190, 'char_start': 6067, 'char_end': 6100, 'line': ' if (*p != *s++) goto fail;\n'}, {'line_no': 191, 'char_start': 6100, 'char_end': 6122, 'line': ' DATA_ENSURE(0);\n'}, {'line_no': 192, 'char_start': 6122, 'char_end': 6133, 'line': ' p++;\n'}], 'added': []}
{'deleted': [{'char_start': 5985, 'char_end': 5991, 'chars': '#if 0\n'}, {'char_start': 6056, 'char_end': 6129, 'chars': '++;\n#endif\n if (*p != *s++) goto fail;\n DATA_ENSURE(0);\n p'}], 'added': []}
github.com/kkos/oniguruma/commit/690313a061f7a4fa614ec5cc8368b4f2284e059b
src/regexec.c
cwe-125
11,033
false
false
false
cwe-125
TNEFParse
int TNEFParse(TNEFStruct *TNEF) { WORD key; DWORD type; DWORD size; DWORD signature; BYTE *data; WORD checksum, header_checksum; int i; if (TNEF->IO.ReadProc == NULL) { printf("ERROR: Setup incorrectly: No ReadProc\n"); return YTNEF_INCORRECT_SETUP; } if (TNEF->IO.InitProc != NULL) { D...
int TNEFParse(TNEFStruct *TNEF) { WORD key; DWORD type; DWORD size; DWORD signature; BYTE *data; WORD checksum, header_checksum; int i; if (TNEF->IO.ReadProc == NULL) { printf("ERROR: Setup incorrectly: No ReadProc\n"); return YTNEF_INCORRECT_SETUP; } if (TNEF->IO.InitProc != NULL) { D...
{'deleted': [], 'added': [{'line_no': 56, 'char_start': 1563, 'char_end': 1583, 'line': ' if(size == 0) {\n'}, {'line_no': 57, 'char_start': 1583, 'char_end': 1630, 'line': ' printf("ERROR: Field with size of 0\\n");\n'}, {'line_no': 58, 'char_start': 1630, 'char_end': 1669, 'line': ' return YTNEF_ERROR_RE...
{'deleted': [], 'added': [{'char_start': 1567, 'char_end': 1679, 'chars': 'if(size == 0) {\n printf("ERROR: Field with size of 0\\n");\n return YTNEF_ERROR_READING_DATA;\n }\n '}]}
github.com/Yeraze/ytnef/commit/3cb0f914d6427073f262e1b2b5fd973e3043cdf7
lib/ytnef.c
cwe-125
1,051
false
true
false
cwe-125
ReadWPGImage
static Image *ReadWPGImage(const ImageInfo *image_info, ExceptionInfo *exception) { typedef struct { size_t FileId; MagickOffsetType DataOffset; unsigned int ProductType; unsigned int FileType; unsigned char MajorVersion; unsigned char MinorVersion; unsigned int EncryptKey; unsigne...
static Image *ReadWPGImage(const ImageInfo *image_info, ExceptionInfo *exception) { typedef struct { size_t FileId; MagickOffsetType DataOffset; unsigned int ProductType; unsigned int FileType; unsigned char MajorVersion; unsigned char MinorVersion; unsigned int EncryptKey; unsigne...
{'deleted': [{'line_no': 485, 'char_start': 16143, 'char_end': 16191, 'line': ' ldblk,sizeof(*BImgBuff));\n'}], 'added': [{'line_no': 485, 'char_start': 16143, 'char_end': 16193, 'line': ' ldblk+1,sizeof(*BImgBuff));\n'}]}
{'deleted': [], 'added': [{'char_start': 16170, 'char_end': 16172, 'chars': '+1'}]}
github.com/ImageMagick/ImageMagick/commit/bef1e4f637d8f665bc133a9c6d30df08d983bc3a
coders/wpg.c
cwe-125
4,723
false
false
false
cwe-125
set_fdc
static void set_fdc(int drive) { if (drive >= 0 && drive < N_DRIVE) { fdc = FDC(drive); current_drive = drive; } if (fdc != 1 && fdc != 0) { pr_info("bad fdc value\n"); return; } set_dor(fdc, ~0, 8); #if N_FDC > 1 set_dor(1 - fdc, ~8, 0); #endif if (FDCS->rawcmd == 2) reset_fdc_info(1); if (fd_inb(FD_...
static void set_fdc(int drive) { unsigned int new_fdc = fdc; if (drive >= 0 && drive < N_DRIVE) { new_fdc = FDC(drive); current_drive = drive; } if (new_fdc >= N_FDC) { pr_info("bad fdc value\n"); return; } fdc = new_fdc; set_dor(fdc, ~0, 8); #if N_FDC > 1 set_dor(1 - fdc, ~8, 0); #endif if (FDCS->raw...
{'deleted': [{'line_no': 4, 'char_start': 71, 'char_end': 91, 'line': '\t\tfdc = FDC(drive);\n'}, {'line_no': 7, 'char_start': 119, 'char_end': 148, 'line': '\tif (fdc != 1 && fdc != 0) {\n'}], 'added': [{'line_no': 3, 'char_start': 33, 'char_end': 62, 'line': '\tunsigned int new_fdc = fdc;\n'}, {'line_no': 4, 'char_st...
{'deleted': [{'char_start': 128, 'char_end': 129, 'chars': '!'}, {'char_start': 131, 'char_end': 144, 'chars': '1 && fdc != 0'}], 'added': [{'char_start': 34, 'char_end': 64, 'chars': 'unsigned int new_fdc = fdc;\n\n\t'}, {'char_start': 103, 'char_end': 107, 'chars': 'new_'}, {'char_start': 158, 'char_end': 162, 'chars...
github.com/torvalds/linux/commit/2e90ca68b0d2f5548804f22f0dd61145516171e3
drivers/block/floppy.c
cwe-125
149
false
true
false
cwe-125
DecompressRTF
BYTE *DecompressRTF(variableLength *p, int *size) { BYTE *dst; // destination for uncompressed bytes BYTE *src; unsigned int in; unsigned int out; variableLength comp_Prebuf; ULONG compressedSize, uncompressedSize, magic; comp_Prebuf.size = strlen(RTF_PREBUF); comp_Prebuf.data = calloc(comp_Prebuf.size...
BYTE *DecompressRTF(variableLength *p, int *size) { BYTE *dst; // destination for uncompressed bytes BYTE *src; unsigned int in; unsigned int out; variableLength comp_Prebuf; ULONG compressedSize, uncompressedSize, magic; comp_Prebuf.size = strlen(RTF_PREBUF); comp_Prebuf.data = calloc(comp_Prebuf.size...
{'deleted': [{'line_no': 55, 'char_start': 1641, 'char_end': 1699, 'line': ' while (out < (comp_Prebuf.size + uncompressedSize)) {\n'}], 'added': [{'line_no': 55, 'char_start': 1641, 'char_end': 1719, 'line': ' while ((out < (comp_Prebuf.size + uncompressedSize)) && (in < p->size)) {\n'}]}
{'deleted': [], 'added': [{'char_start': 1652, 'char_end': 1653, 'chars': '('}, {'char_start': 1692, 'char_end': 1711, 'chars': 'ize)) && (in < p->s'}]}
github.com/Yeraze/ytnef/commit/22f8346c8d4f0020a40d9f258fdb3bfc097359cc
lib/ytnef.c
cwe-125
996
false
true
false
cwe-125
voutf
static void voutf(struct GlobalConfig *config, const char *prefix, const char *fmt, va_list ap) { size_t width = (79 - strlen(prefix)); if(!config->mute) { size_t len; char *ptr; char *print_buffer; print_buffer = curlx_mvaprintf(fmt, ap); i...
static void voutf(struct GlobalConfig *config, const char *prefix, const char *fmt, va_list ap) { size_t width = (79 - strlen(prefix)); if(!config->mute) { size_t len; char *ptr; char *print_buffer; print_buffer = curlx_mvaprintf(fmt, ap); i...
{'deleted': [{'line_no': 35, 'char_start': 890, 'char_end': 910, 'line': ' len -= cut;\n'}], 'added': [{'line_no': 35, 'char_start': 890, 'char_end': 914, 'line': ' len -= cut + 1;\n'}]}
{'deleted': [], 'added': [{'char_start': 908, 'char_end': 912, 'chars': ' + 1'}]}
github.com/curl/curl/commit/d530e92f59ae9bb2d47066c3c460b25d2ffeb211
src/tool_msgs.c
cwe-125
267
false
true
false
cwe-125
ImagingPcxDecode
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...
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...
{'deleted': [{'line_no': 6, 'char_start': 116, 'char_end': 179, 'line': ' if (strcmp(im->mode, "1") == 0 && state->xsize > state->bytes * 8) {\n'}, {'line_no': 7, 'char_start': 179, 'char_end': 227, 'line': ' state->errcode = IMAGING_CODEC_OVERRUN;\n'}, {'line_no': 8, 'char_start': 227, 'char_end': 246, 'line...
{'deleted': [], 'added': []}
github.com/python-pillow/Pillow/commit/6a83e4324738bb0452fbe8074a995b1c73f08de7#diff-9478f2787e3ae9668a15123b165c23ac
src/libImaging/PcxDecode.c
cwe-125
462
false
true
false
cwe-125
HPHP::JSON_parser
bool JSON_parser(Variant &z, const char *p, int length, bool const assoc, int depth, int64_t options) { // No GC safepoints during JSON parsing, please. Code is not re-entrant. NoHandleSurpriseScope no_surprise(SafepointFlags); json_parser *json = s_json_parser.get(); /* the parser state */ //...
bool JSON_parser(Variant &z, const char *p, int length, bool const assoc, int depth, int64_t options) { // No GC safepoints during JSON parsing, please. Code is not re-entrant. NoHandleSurpriseScope no_surprise(SafepointFlags); json_parser *json = s_json_parser.get(); /* the parser state */ //...
{'deleted': [], 'added': [{'line_no': 11, 'char_start': 548, 'char_end': 568, 'line': ' if (depth <= 0) {\n'}, {'line_no': 12, 'char_start': 568, 'char_end': 627, 'line': ' json->error_code = json_error_codes::JSON_ERROR_DEPTH;\n'}, {'line_no': 13, 'char_start': 627, 'char_end': 645, 'line': ' return false;\n'},...
{'deleted': [], 'added': [{'char_start': 550, 'char_end': 651, 'chars': 'if (depth <= 0) {\n json->error_code = json_error_codes::JSON_ERROR_DEPTH;\n return false;\n }\n '}]}
github.com/facebook/hhvm/commit/dabd48caf74995e605f1700344f1ff4a5d83441d
hphp/runtime/ext/json/JSON_parser.cpp
cwe-125
3,769
false
false
false
cwe-125
ReadPSDImage
static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType has_merged_image, skip_layers; MagickOffsetType offset; MagickSizeType length; MagickBooleanType status; PSDInfo psd_info; register ssize_t i; ssize_t...
static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image; MagickBooleanType has_merged_image, skip_layers; MagickOffsetType offset; MagickSizeType length; MagickBooleanType status; PSDInfo psd_info; register ssize_t i; ssize_t...
{'deleted': [], 'added': [{'line_no': 162, 'char_start': 5509, 'char_end': 5577, 'line': ' if ((image->depth == 1) && (image->storage_class != PseudoClass))\n'}, {'line_no': 163, 'char_start': 5577, 'char_end': 5645, 'line': ' ThrowReaderException(CorruptImageError, "ImproperImageHeader");\n'}]}
{'deleted': [], 'added': [{'char_start': 5511, 'char_end': 5647, 'chars': 'if ((image->depth == 1) && (image->storage_class != PseudoClass))\n ThrowReaderException(CorruptImageError, "ImproperImageHeader");\n '}]}
github.com/ImageMagick/ImageMagick/commit/198fffab4daf8aea88badd9c629350e5b26ec32f
coders/psd.c
cwe-125
2,365
false
true
false
cwe-125
bitmap_cache_new
rdpBitmapCache* bitmap_cache_new(rdpSettings* settings) { int i; rdpBitmapCache* bitmapCache; bitmapCache = (rdpBitmapCache*)calloc(1, sizeof(rdpBitmapCache)); if (!bitmapCache) return NULL; bitmapCache->settings = settings; bitmapCache->update = ((freerdp*)settings->instance)->update; bitmapCache->context =...
rdpBitmapCache* bitmap_cache_new(rdpSettings* settings) { int i; rdpBitmapCache* bitmapCache; bitmapCache = (rdpBitmapCache*)calloc(1, sizeof(rdpBitmapCache)); if (!bitmapCache) return NULL; bitmapCache->settings = settings; bitmapCache->update = ((freerdp*)settings->instance)->update; bitmapCache->context =...
{'deleted': [{'line_no': 13, 'char_start': 351, 'char_end': 409, 'line': '\tbitmapCache->maxCells = settings->BitmapCacheV2NumCells;\n'}, {'line_no': 14, 'char_start': 409, 'char_end': 503, 'line': '\tbitmapCache->cells = (BITMAP_V2_CELL*)calloc(bitmapCache->maxCells, sizeof(BITMAP_V2_CELL));\n'}], 'added': [{'line_no'...
{'deleted': [{'char_start': 365, 'char_end': 369, 'chars': 'maxC'}, {'char_start': 375, 'char_end': 408, 'chars': ' settings->BitmapCacheV2NumCells;'}, {'char_start': 410, 'char_end': 428, 'chars': 'bitmapCache->cells'}, {'char_start': 429, 'char_end': 430, 'chars': '='}, {'char_start': 455, 'char_end': 456, 'chars': '...
github.com/FreeRDP/FreeRDP/commit/58dc36b3c883fd460199cedb6d30e58eba58298c
libfreerdp/cache/bitmap.c
cwe-125
317
false
true
false
cwe-125
sh_op
static int sh_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_MSB,op_LSB; int ret; if (!data) return 0; memset (op, '\0', sizeof (RAnalOp)); op->addr = addr; op->type = R_ANAL_OP_TYPE_UNK; op->jump = op->fail = -1; op->ptr = op->val = -1; op->size = 2; op_MSB = anal->big_endian?...
static int sh_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_MSB,op_LSB; int ret; if (!data || len < 2) { return 0; } memset (op, '\0', sizeof (RAnalOp)); op->addr = addr; op->type = R_ANAL_OP_TYPE_UNK; op->jump = op->fail = -1; op->ptr = op->val = -1; op->size = 2; op_MSB = a...
{'deleted': [{'line_no': 4, 'char_start': 112, 'char_end': 124, 'line': '\tif (!data)\n'}], 'added': [{'line_no': 4, 'char_start': 112, 'char_end': 137, 'line': '\tif (!data || len < 2) {\n'}, {'line_no': 6, 'char_start': 149, 'char_end': 152, 'line': '\t}\n'}]}
{'deleted': [], 'added': [{'char_start': 122, 'char_end': 133, 'chars': ' || len < 2'}, {'char_start': 134, 'char_end': 136, 'chars': ' {'}, {'char_start': 148, 'char_end': 151, 'chars': '\n\t}'}]}
github.com/radare/radare2/commit/77c47cf873dd55b396da60baa2ca83bbd39e4add
libr/anal/p/anal_sh.c
cwe-125
183
false
true
false
cwe-125
HPHP::SimpleParser::handleBackslash
bool handleBackslash(signed char& out) { char ch = *p++; switch (ch) { case 0: return false; case '"': out = ch; return true; case '\\': out = ch; return true; case '/': out = ch; return true; case 'b': out = '\b'; return true; case 'f': out = '\f'; return true; case ...
bool handleBackslash(signed char& out) { char ch = *p++; switch (ch) { case 0: return false; case '"': out = ch; return true; case '\\': out = ch; return true; case '/': out = ch; return true; case 'b': out = '\b'; return true; case 'f': out = '\f'; return true; case ...
{'deleted': [{'line_no': 19, 'char_start': 646, 'char_end': 722, 'line': " if (UNLIKELY(ch1 != '0' || ch2 != '0' || dch3 < 0 || dch4 < 0)) {\n"}, {'line_no': 20, 'char_start': 722, 'char_end': 748, 'line': ' return false;\n'}, {'line_no': 21, 'char_start': 748, 'char_end': 760, 'line': ' }\...
{'deleted': [{'char_start': 669, 'char_end': 709, 'chars': "ch1 != '0' || ch2 != '0' || dch3 < 0 || "}, {'char_start': 720, 'char_end': 734, 'chars': '{\n '}, {'char_start': 747, 'char_end': 759, 'chars': '\n }'}], 'added': [{'char_start': 533, 'char_end': 583, 'chars': "if (UNLIKELY(ch1 != '0')) re...
github.com/facebook/hhvm/commit/b3679121bb3c7017ff04b4c08402ffff5cf59b13
hphp/runtime/ext/json/JSON_parser.cpp
cwe-125
389
false
true
false
cwe-125
name_parse
name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) { int name_end = -1; int j = *idx; int ptr_count = 0; #define GET32(x) do { if (j + 4 > length) goto err; memcpy(&t32_, packet + j, 4); j += 4; x = ntohl(t32_); } while (0) #define GET16(x) do { if (j + 2 > length) goto err; memcpy(&t_, p...
name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) { int name_end = -1; int j = *idx; int ptr_count = 0; #define GET32(x) do { if (j + 4 > length) goto err; memcpy(&t32_, packet + j, 4); j += 4; x = ntohl(t32_); } while (0) #define GET16(x) do { if (j + 2 > length) goto err; memcpy(&t_, p...
{'deleted': [{'line_no': 20, 'char_start': 830, 'char_end': 860, 'line': '\t\tif (j >= length) return -1;\n'}], 'added': [{'line_no': 40, 'char_start': 1425, 'char_end': 1466, 'line': '\t\tif (j + label_len > length) return -1;\n'}]}
{'deleted': [{'char_start': 832, 'char_end': 862, 'chars': 'if (j >= length) return -1;\n\t\t'}], 'added': [{'char_start': 1412, 'char_end': 1453, 'chars': ') return -1;\n\t\tif (j + label_len > length'}]}
github.com/libevent/libevent/commit/96f64a022014a208105ead6c8a7066018449d86d
evdns.c
cwe-125
578
false
true
false
cwe-125
tensorflow::GraphConstructor::MakeEdge
Status GraphConstructor::MakeEdge(Node* src, int output_index, Node* dst, int input_index) { DataType src_out = src->output_type(output_index); DataType dst_in = dst->input_type(input_index); if (!TypesCompatible(dst_in, src_out)) { return errors::InvalidArgument( "In...
Status GraphConstructor::MakeEdge(Node* src, int output_index, Node* dst, int input_index) { if (output_index >= src->num_outputs()) { return errors::InvalidArgument( "Output ", output_index, " of node ", src->name(), " does not exist. Node only has ", src->num_ou...
{'deleted': [], 'added': [{'line_no': 3, 'char_start': 127, 'char_end': 171, 'line': ' if (output_index >= src->num_outputs()) {\n'}, {'line_no': 4, 'char_start': 171, 'char_end': 207, 'line': ' return errors::InvalidArgument(\n'}, {'line_no': 5, 'char_start': 207, 'char_end': 266, 'line': ' "Output ", outpu...
{'deleted': [], 'added': [{'char_start': 129, 'char_end': 564, 'chars': 'if (output_index >= src->num_outputs()) {\n return errors::InvalidArgument(\n "Output ", output_index, " of node ", src->name(),\n " does not exist. Node only has ", src->num_outputs(), " outputs.");\n }\n if (input_index >= dst...
github.com/tensorflow/tensorflow/commit/0cc38aaa4064fd9e79101994ce9872c6d91f816b
tensorflow/core/common_runtime/graph_constructor.cc
cwe-125
140
false
true
false
cwe-125
enc_untrusted_inet_pton
int enc_untrusted_inet_pton(int af, const char *src, void *dst) { if (!src || !dst) { return 0; } MessageWriter input; input.Push<int>(TokLinuxAfFamily(af)); input.PushByReference(Extent{ src, std::min(strlen(src) + 1, static_cast<size_t>(INET6_ADDRSTRLEN))}); MessageReader output; const auto ...
int enc_untrusted_inet_pton(int af, const char *src, void *dst) { if (!src || !dst) { return 0; } MessageWriter input; input.Push<int>(TokLinuxAfFamily(af)); input.PushByReference(Extent{ src, std::min(strlen(src) + 1, static_cast<size_t>(INET6_ADDRSTRLEN))}); MessageReader output; const auto ...
{'deleted': [], 'added': [{'line_no': 26, 'char_start': 747, 'char_end': 810, 'line': ' if (klinux_addr_buffer.size() != sizeof(klinux_in_addr)) {\n'}, {'line_no': 27, 'char_start': 810, 'char_end': 873, 'line': ' ::asylo::primitives::TrustedPrimitives::BestEffortAbort(\n'}, {'line_no': 28, 'char_start': 873, '...
{'deleted': [], 'added': [{'char_start': 751, 'char_end': 945, 'chars': 'if (klinux_addr_buffer.size() != sizeof(klinux_in_addr)) {\n ::asylo::primitives::TrustedPrimitives::BestEffortAbort(\n "enc_untrusted_inet_pton: unexpected output size");\n }\n '}, {'char_start': 1010, 'char_end': 1205, 'chars...
github.com/google/asylo/commit/8fed5e334131abaf9c5e17307642fbf6ce4a57ec
asylo/platform/host_call/trusted/host_calls.cc
cwe-125
280
false
true
false
cwe-125
gmc_mmx
static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) { const int w = 8; const int ix = ox >> (16 + shift); const int iy = oy >> (16 ...
static void gmc_mmx(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) { const int w = 8; const int ix = ox >> (16 + shift); const int iy = oy >> (16 ...
{'deleted': [{'line_no': 28, 'char_start': 1008, 'char_end': 1060, 'line': ' int need_emu = (unsigned) ix >= width - w ||\n'}, {'line_no': 29, 'char_start': 1060, 'char_end': 1110, 'line': ' (unsigned) iy >= height - h;\n'}], 'added': [{'line_no': 28, 'char_start': 1008, 'char_end': 1073, 'lin...
{'deleted': [], 'added': [{'char_start': 1059, 'char_end': 1072, 'chars': ' width < w ||'}, {'char_start': 1121, 'char_end': 1156, 'chars': ' || height< h\n '}]}
github.com/FFmpeg/FFmpeg/commit/58cf31cee7a456057f337b3102a03206d833d5e8
libavcodec/x86/mpegvideodsp.c
cwe-125
1,806
false
false
false
cwe-125
SMB2_negotiate
SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) { struct smb_rqst rqst; struct smb2_negotiate_req *req; struct smb2_negotiate_rsp *rsp; struct kvec iov[1]; struct kvec rsp_iov; int rc = 0; int resp_buftype; struct TCP_Server_Info *server = ses->server; int blob_offset, blob_length; char *security...
SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) { struct smb_rqst rqst; struct smb2_negotiate_req *req; struct smb2_negotiate_rsp *rsp; struct kvec iov[1]; struct kvec rsp_iov; int rc = 0; int resp_buftype; struct TCP_Server_Info *server = ses->server; int blob_offset, blob_length; char *security...
{'deleted': [{'line_no': 116, 'char_start': 3733, 'char_end': 3799, 'line': '\t\t} else if (rsp->DialectRevision == cpu_to_le16(SMB311_PROT_ID))\n'}], 'added': [{'line_no': 116, 'char_start': 3733, 'char_end': 3771, 'line': '\t\t\tses->server->vals = &smb21_values;\n'}, {'line_no': 117, 'char_start': 3771, 'char_end': ...
{'deleted': [], 'added': [{'char_start': 3735, 'char_end': 3773, 'chars': '\tses->server->vals = &smb21_values;\n\t\t'}, {'char_start': 3836, 'char_end': 3838, 'chars': ' {'}, {'char_start': 3880, 'char_end': 3923, 'chars': '\n\t\t\tses->server->vals = &smb311_values;\n\t\t}'}]}
github.com/torvalds/linux/commit/b57a55e2200ede754e4dc9cce4ba9402544b9365
fs/cifs/smb2pdu.c
cwe-125
2,266
false
false
false
cwe-125
HPHP::exif_scan_JPEG_header
static int exif_scan_JPEG_header(image_info_type *ImageInfo) { int section, sn; int marker = 0, last_marker = M_PSEUDO, comment_correction=1; int ll, lh; unsigned char *Data; size_t fpos, size, got, itemlen; jpeg_sof_info sof_info; for(section=0;;section++) { // get marker byte, swallowing possible ...
static int exif_scan_JPEG_header(image_info_type *ImageInfo) { int section, sn; int marker = 0, last_marker = M_PSEUDO, comment_correction=1; int ll, lh; unsigned char *Data; size_t fpos, size, got, itemlen; jpeg_sof_info sof_info; for(section=0;;section++) { // get marker byte, swallowing possible ...
{'deleted': [], 'added': [{'line_no': 137, 'char_start': 4277, 'char_end': 4310, 'line': ' if ((itemlen - 2) < 6) {\n'}, {'line_no': 138, 'char_start': 4310, 'char_end': 4330, 'line': ' return 0;\n'}, {'line_no': 139, 'char_start': 4330, 'char_end': 4340, 'line': ' }\n'}, {'line_no': 140, 'char_s...
{'deleted': [], 'added': [{'char_start': 4285, 'char_end': 4349, 'chars': 'if ((itemlen - 2) < 6) {\n return 0;\n }\n\n '}]}
github.com/facebook/hhvm/commit/f9680d21beaa9eb39d166e8810e29fbafa51ad15
hphp/runtime/ext/gd/ext_gd.cpp
cwe-125
1,269
false
false
false
cwe-125
ndpi_search_oracle
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int16_t dport = 0, sport = 0; NDPI_LOG_DBG(ndpi_struct, "search ORACLE\n"); if(packet->tcp != NULL) { sport = ntohs(packet->tcp->source), dport = ...
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; u_int16_t dport = 0, sport = 0; NDPI_LOG_DBG(ndpi_struct, "search ORACLE\n"); if(packet->tcp != NULL) { sport = ntohs(packet->tcp->source), dport = ...
{'deleted': [{'line_no': 13, 'char_start': 489, 'char_end': 590, 'line': '\t&& (((packet->payload[0] == 0x07) && (packet->payload[1] == 0xff) && (packet->payload[2] == 0x00))\n'}], 'added': [{'line_no': 13, 'char_start': 489, 'char_end': 625, 'line': '\t&& (((packet->payload_packet_len >= 3 && packet->payload[0] == 0...
{'deleted': [], 'added': [{'char_start': 512, 'char_end': 547, 'chars': '_packet_len >= 3 && packet->payload'}]}
github.com/ntop/nDPI/commit/b69177be2fbe01c2442239a61832c44e40136c05
src/lib/protocols/oracle.c
cwe-125
442
false
true
false
cwe-125
store_versioninfo_gnu_verneed
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) {...
{'deleted': [{'line_no': 85, 'char_start': 2490, 'char_end': 2517, 'line': '\t\tvstart += entry->vn_aux;\n'}], 'added': [{'line_no': 85, 'char_start': 2490, 'char_end': 2520, 'line': '\t\tst32 vnaux = entry->vn_aux;\n'}, {'line_no': 86, 'char_start': 2520, 'char_end': 2539, 'line': '\t\tif (vnaux < 1) {\n'}, {'line_no'...
{'deleted': [{'char_start': 2492, 'char_end': 2493, 'chars': 'v'}, {'char_start': 2496, 'char_end': 2498, 'chars': 'rt'}, {'char_start': 2499, 'char_end': 2500, 'chars': '+'}], 'added': [{'char_start': 2494, 'char_end': 2499, 'chars': '32 vn'}, {'char_start': 2500, 'char_end': 2502, 'chars': 'ux'}, {'char_start': 2515,...
github.com/radare/radare2/commit/c6d0076c924891ad9948a62d89d0bcdaf965f0cd
libr/bin/format/elf/elf.c
cwe-125
1,547
false
false
false
cwe-125
usbhid_parse
static int usbhid_parse(struct hid_device *hid) { struct usb_interface *intf = to_usb_interface(hid->dev.parent); struct usb_host_interface *interface = intf->cur_altsetting; struct usb_device *dev = interface_to_usbdev (intf); struct hid_descriptor *hdesc; u32 quirks = 0; unsigned int rsize = 0; char *rdesc; i...
static int usbhid_parse(struct hid_device *hid) { struct usb_interface *intf = to_usb_interface(hid->dev.parent); struct usb_host_interface *interface = intf->cur_altsetting; struct usb_device *dev = interface_to_usbdev (intf); struct hid_descriptor *hdesc; u32 quirks = 0; unsigned int rsize = 0; char *rdesc; i...
{'deleted': [{'line_no': 36, 'char_start': 1218, 'char_end': 1264, 'line': '\tfor (n = 0; n < hdesc->bNumDescriptors; n++)\n'}], 'added': [{'line_no': 11, 'char_start': 331, 'char_end': 353, 'line': '\tint num_descriptors;\n'}, {'line_no': 12, 'char_start': 353, 'char_end': 409, 'line': '\tsize_t offset = offsetof(stru...
{'deleted': [{'char_start': 1219, 'char_end': 1220, 'chars': 'f'}, {'char_start': 1226, 'char_end': 1227, 'chars': '='}, {'char_start': 1228, 'char_end': 1230, 'chars': '0;'}, {'char_start': 1231, 'char_end': 1232, 'chars': 'n'}, {'char_start': 1233, 'char_end': 1234, 'chars': '<'}, {'char_start': 1243, 'char_end': 124...
github.com/torvalds/linux/commit/f043bfc98c193c284e2cd768fefabe18ac2fed9b
drivers/hid/usbhid/hid-core.c
cwe-125
581
false
true
false
cwe-125
WriteHDRImage
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
{'deleted': [{'line_no': 69, 'char_start': 1901, 'char_end': 1984, 'line': ' count=FormatLocaleString(header,MagickPathExtent,"GAMMA=%g\\n",image->gamma);\n'}, {'line_no': 87, 'char_start': 2886, 'char_end': 2952, 'line': ' pixels=(unsigned char *) AcquireQuantumMemory(image->columns,4*\n'}], 'added': [{'line_no'...
{'deleted': [], 'added': [{'char_start': 1969, 'char_end': 1978, 'chars': '\n '}, {'char_start': 2957, 'char_end': 2961, 'chars': '+128'}, {'char_start': 3095, 'char_end': 3172, 'chars': ');\n (void) ResetMagickMemory(pixels,0,4*(image->columns+128)*sizeof(*pixels)'}]}
github.com/ImageMagick/ImageMagick/commit/14e606db148d6ebcaae20f1e1d6d71903ca4a556
coders/hdr.c
cwe-125
1,522
false
true
false
cwe-125
security_fips_decrypt
BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp) { size_t olen; if (!winpr_Cipher_Update(rdp->fips_decrypt, data, length, data, &olen)) return FALSE; return TRUE; }
BOOL security_fips_decrypt(BYTE* data, size_t length, rdpRdp* rdp) { size_t olen; if (!rdp || !rdp->fips_decrypt) return FALSE; if (!winpr_Cipher_Update(rdp->fips_decrypt, data, length, data, &olen)) return FALSE; return TRUE; }
{'deleted': [], 'added': [{'line_no': 5, 'char_start': 84, 'char_end': 117, 'line': '\tif (!rdp || !rdp->fips_decrypt)\n'}, {'line_no': 6, 'char_start': 117, 'char_end': 133, 'line': '\t\treturn FALSE;\n'}, {'line_no': 7, 'char_start': 133, 'char_end': 134, 'line': '\n'}]}
{'deleted': [], 'added': [{'char_start': 90, 'char_end': 140, 'chars': 'rdp || !rdp->fips_decrypt)\n\t\treturn FALSE;\n\n\tif (!'}]}
github.com/FreeRDP/FreeRDP/commit/d6cd14059b257318f176c0ba3ee0a348826a9ef8
libfreerdp/core/security.c
cwe-125
59
false
true
false
cwe-125
cx24116_send_diseqc_msg
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx24116: %s(", __func__); for (i = 0 ; i < d->msg_len ;) { printk(KERN_INFO "0x%02x", d->ms...
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Validate length */ if (d->msg_len > sizeof(d->msg)) return -EINVAL; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx2411...
{'deleted': [{'line_no': 18, 'char_start': 429, 'char_end': 452, 'line': '\t/* Validate length */\n'}, {'line_no': 19, 'char_start': 452, 'char_end': 512, 'line': '\tif (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS))\n'}, {'line_no': 20, 'char_start': 512, 'char_end': 530, 'line': '\t\treturn -EINVAL;\n'}, {'li...
{'deleted': [{'char_start': 427, 'char_end': 529, 'chars': '\n\n\t/* Validate length */\n\tif (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS))\n\t\treturn -EINVAL;'}], 'added': [{'char_start': 167, 'char_end': 257, 'chars': 'Validate length */\n\tif (d->msg_len > sizeof(d->msg))\n return -EINVAL;\...
github.com/torvalds/linux/commit/1fa2337a315a2448c5434f41e00d56b01a22283c
drivers/media/dvb-frontends/cx24116.c
cwe-125
996
false
true
false
cwe-125
MAPIPrint
void MAPIPrint(MAPIProps *p) { int j, i, index, h, x; DDWORD *ddword_ptr; DDWORD ddword_tmp; dtr thedate; MAPIProperty *mapi; variableLength *mapidata; variableLength vlTemp; int found; for (j = 0; j < p->count; j++) { mapi = &(p->properties[j]); printf(" #%i: Type: [", j); switch (PROP...
void MAPIPrint(MAPIProps *p) { int j, i, index, h, x; DDWORD *ddword_ptr; DDWORD ddword_tmp; dtr thedate; MAPIProperty *mapi; variableLength *mapidata; variableLength vlTemp; int found; for (j = 0; j < p->count; j++) { mapi = &(p->properties[j]); printf(" #%i: Type: [", j); switch (PROP...
{'deleted': [{'line_no': 95, 'char_start': 2731, 'char_end': 2795, 'line': ' printf(" Value: %li\\n", *((long*)mapidata->data));\n'}], 'added': [{'line_no': 95, 'char_start': 2731, 'char_end': 2793, 'line': ' printf(" Value: %i\\n", *((int*)mapidata->data));\n'}]}
{'deleted': [{'char_start': 2761, 'char_end': 2762, 'chars': 'l'}, {'char_start': 2771, 'char_end': 2773, 'chars': 'lo'}, {'char_start': 2774, 'char_end': 2775, 'chars': 'g'}], 'added': [{'char_start': 2770, 'char_end': 2771, 'chars': 'i'}, {'char_start': 2772, 'char_end': 2773, 'chars': 't'}]}
github.com/Yeraze/ytnef/commit/f98f5d4adc1c4bd4033638f6167c1bb95d642f89
lib/ytnef.c
cwe-125
1,306
false
false
false
cwe-125
autodetect_recv_bandwidth_measure_results
static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; if (autodetectRspPdu->headerLength != 0x0E) return FALSE; WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results ...
static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s, AUTODETECT_RSP_PDU* autodetectRspPdu) { BOOL success = TRUE; if (autodetectRspPdu->headerLength != 0x0E) return FALSE; WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results ...
{'deleted': [], 'added': [{'line_no': 10, 'char_start': 327, 'char_end': 366, 'line': '\tif (Stream_GetRemainingLength(s) < 8)\n'}, {'line_no': 11, 'char_start': 366, 'char_end': 379, 'line': '\t\treturn -1;\n'}]}
{'deleted': [], 'added': [{'char_start': 328, 'char_end': 380, 'chars': 'if (Stream_GetRemainingLength(s) < 8)\n\t\treturn -1;\n\t'}]}
github.com/FreeRDP/FreeRDP/commit/f5e73cc7c9cd973b516a618da877c87b80950b65
libfreerdp/core/autodetect.c
cwe-125
264
false
true
false
cwe-125
get_uncompressed_data
get_uncompressed_data(struct archive_read *a, const void **buff, size_t size, size_t minimum) { struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { /* Copy mode. */ /* * Note: '1' here is a performance optimization. ...
get_uncompressed_data(struct archive_read *a, const void **buff, size_t size, size_t minimum) { struct _7zip *zip = (struct _7zip *)a->format->data; ssize_t bytes_avail; if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) { /* Copy mode. */ *buff = __archive_read_ahead(a, minimum, &bytes_avail)...
{'deleted': [{'line_no': 10, 'char_start': 264, 'char_end': 269, 'line': '\t\t/*\n'}, {'line_no': 11, 'char_start': 269, 'char_end': 320, 'line': "\t\t * Note: '1' here is a performance optimization.\n"}, {'line_no': 12, 'char_start': 320, 'char_end': 380, 'line': '\t\t * Recall that the decompression layer returns a c...
{'deleted': [{'char_start': 266, 'char_end': 499, 'chars': "/*\n\t\t * Note: '1' here is a performance optimization.\n\t\t * Recall that the decompression layer returns a count of\n\t\t * available bytes; asking for more than that forces the\n\t\t * decompressor to combine reads by copying data.\n\t\t */\n\t\t"}, {'cha...
github.com/libarchive/libarchive/commit/65a23f5dbee4497064e9bb467f81138a62b0dae1
libarchive/archive_read_support_format_7zip.c
cwe-125
499
false
true
false
cwe-125
adjust_scalar_min_max_vals
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 ...
{'deleted': [{'line_no': 248, 'char_start': 8087, 'char_end': 8122, 'line': '\t\tcoerce_reg_to_size(&src_reg, 4);\n'}], 'added': [{'line_no': 13, 'char_start': 409, 'char_end': 436, 'line': '\tif (insn_bitness == 32) {\n'}, {'line_no': 14, 'char_start': 436, 'char_end': 500, 'line': '\t\t/* Relevant for 32-bit RSH: Inf...
{'deleted': [{'char_start': 8077, 'char_end': 8112, 'chars': '_reg, 4);\n\t\tcoerce_reg_to_size(&src'}], 'added': [{'char_start': 410, 'char_end': 658, 'chars': "if (insn_bitness == 32) {\n\t\t/* Relevant for 32-bit RSH: Information can propagate towards\n\t\t * LSB, so it isn't sufficient to only truncate the output t...
github.com/torvalds/linux/commit/b799207e1e1816b09e7a5920fbb2d5fcf6edd681
kernel/bpf/verifier.c
cwe-125
2,575
false
true
false
cwe-125
readContigTilesIntoBuffer
static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, uint32 imagelength, uint32 imagewidth, uint32 tw, uint32 tl, tsample_t spp, uint16 bps) { int status ...
static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, uint32 imagelength, uint32 imagewidth, uint32 tw, uint32 tl, tsample_t spp, uint16 bps) { int status ...
{'deleted': [{'line_no': 60, 'char_start': 1763, 'char_end': 1803, 'line': ' tilebuf = _TIFFmalloc(tile_buffsize);\n'}], 'added': [{'line_no': 60, 'char_start': 1763, 'char_end': 1829, 'line': ' /* Add 3 padding bytes for extractContigSamplesShifted32bits */\n'}, {'line_no': 61, 'char_start': 1829, 'char_end': 1869, ...
{'deleted': [], 'added': [{'char_start': 1765, 'char_end': 1991, 'chars': '/* Add 3 padding bytes for extractContigSamplesShifted32bits */\n if( tile_buffsize > 0xFFFFFFFFU - 3 )\n {\n TIFFError("readContigTilesIntoBuffer", "Integer overflow when calculating buffer size.");\n exit(-1);\n }\n '}, {'char_st...
github.com/vadz/libtiff/commit/ae9365db1b271b62b35ce018eac8799b1d5e8a53
tools/tiffcrop.c
cwe-125
1,703
false
true
false
cwe-125
dbd_st_prepare
dbd_st_prepare( SV *sth, imp_sth_t *imp_sth, char *statement, SV *attribs) { int i; SV **svp; dTHX; #if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION #if MYSQL_VERSION_ID < CALL_PLACEHOLDER_VERSION char *str_ptr, *str_last_ptr; #if MYSQL_VERSION_ID < LIMIT_PLACEHOLDER_VERSION int limit_flag=0; #endif #en...
dbd_st_prepare( SV *sth, imp_sth_t *imp_sth, char *statement, SV *attribs) { int i; SV **svp; dTHX; #if MYSQL_VERSION_ID >= SERVER_PREPARE_VERSION #if MYSQL_VERSION_ID < CALL_PLACEHOLDER_VERSION char *str_ptr, *str_last_ptr; #if MYSQL_VERSION_ID < LIMIT_PLACEHOLDER_VERSION int limit_flag=0; #endif #en...
{'deleted': [{'line_no': 17, 'char_start': 324, 'char_end': 356, 'line': ' int col_type, prepare_retval;\n'}, {'line_no': 213, 'char_start': 7021, 'char_end': 7083, 'line': ' int has_statement_fields= imp_sth->stmt->fields != 0;\n'}, {'line_no': 227, 'char_start': 7601, 'char_end': 7614, 'line': ' /*\n...
{'deleted': [{'char_start': 330, 'char_end': 340, 'chars': 'col_type, '}, {'char_start': 7029, 'char_end': 7091, 'chars': 'int has_statement_fields= imp_sth->stmt->fields != 0;\n '}, {'char_start': 7611, 'char_end': 7679, 'chars': '/*\n if this statement has a result set, field types will '}, {'char_s...
github.com/perl5-dbi/DBD-mysql/commit/793b72b1a0baa5070adacaac0e12fd995a6fbabe
dbdimp.c
cwe-125
2,524
false
false
false
cwe-125
ExtractPostscript
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception) { char postscript_file[MaxTextExtent]; const MagicInfo *magic_info; FILE *ps_file; ImageInfo *clone_info; Image *image2; unsigned char ...
static Image *ExtractPostscript(Image *image,const ImageInfo *image_info, MagickOffsetType PS_Offset,ssize_t PS_Size,ExceptionInfo *exception) { char postscript_file[MaxTextExtent]; const MagicInfo *magic_info; FILE *ps_file; ImageInfo *clone_info; Image *image2; unsigned char ...
{'deleted': [{'line_no': 52, 'char_start': 1318, 'char_end': 1396, 'line': ' (void) CopyMagickMemory(clone_info->magick,magic_info->name,MaxTextExtent);\n'}], 'added': [{'line_no': 52, 'char_start': 1318, 'char_end': 1387, 'line': ' (void) strncpy(clone_info->magick,magic_info->name,MaxTextExtent);\n'}]}
{'deleted': [{'char_start': 1327, 'char_end': 1329, 'chars': 'Co'}, {'char_start': 1330, 'char_end': 1342, 'chars': 'yMagickMemor'}], 'added': [{'char_start': 1327, 'char_end': 1329, 'chars': 'st'}, {'char_start': 1330, 'char_end': 1333, 'chars': 'ncp'}]}
github.com/ImageMagick/ImageMagick/commit/a251039393f423c7858e63cab6aa98d17b8b7a41
coders/wpg.c
cwe-125
654
false
false
false
cwe-125
update_read_icon_info
static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) { BYTE* newBitMask; if (Stream_GetRemainingLength(s) < 8) return FALSE; Stream_Read_UINT16(s, iconInfo->cacheEntry); /* cacheEntry (2 bytes) */ Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ Stream_Read_UINT8(s, iconInfo->b...
static BOOL update_read_icon_info(wStream* s, ICON_INFO* iconInfo) { BYTE* newBitMask; if (Stream_GetRemainingLength(s) < 8) return FALSE; Stream_Read_UINT16(s, iconInfo->cacheEntry); /* cacheEntry (2 bytes) */ Stream_Read_UINT8(s, iconInfo->cacheId); /* cacheId (1 byte) */ Stream_Read_UINT8(s, iconInfo->b...
{'deleted': [{'line_no': 44, 'char_start': 1148, 'char_end': 1230, 'line': '\tif (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor)\n'}, {'line_no': 45, 'char_start': 1230, 'char_end': 1246, 'line': '\t\treturn FALSE;\n'}, {'line_no': 46, 'char_start': 1246, 'char_end': 1247, 'line': '\n'}], ...
{'deleted': [{'char_start': 1149, 'char_end': 1248, 'chars': 'if (Stream_GetRemainingLength(s) < iconInfo->cbBitsMask + iconInfo->cbBitsColor)\n\t\treturn FALSE;\n\n\t'}, {'char_start': 2368, 'char_end': 2368, 'chars': ''}], 'added': [{'char_start': 1164, 'char_end': 1164, 'chars': ''}, {'char_start': 1369, 'char_end':...
github.com/FreeRDP/FreeRDP/commit/6b2bc41935e53b0034fe5948aeeab4f32e80f30f
libfreerdp/core/window.c
cwe-125
769
false
false
false
cwe-125
avr_op_analyze
static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) { OPCODE_DESC *opcode_desc; ut16 ins = (buf[1] << 8) | buf[0]; int fail; char *t; // initialize op struct memset (op, 0, sizeof (RAnalOp)); op->ptr = UT64_MAX; op->val = UT64_MAX; op->jump = UT64_M...
static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) { OPCODE_DESC *opcode_desc; if (len < 2) { return NULL; } ut16 ins = (buf[1] << 8) | buf[0]; int fail; char *t; // initialize op struct memset (op, 0, sizeof (RAnalOp)); op->ptr = UT64_MAX; op->...
{'deleted': [], 'added': [{'line_no': 3, 'char_start': 142, 'char_end': 158, 'line': '\tif (len < 2) {\n'}, {'line_no': 4, 'char_start': 158, 'char_end': 173, 'line': '\t\treturn NULL;\n'}, {'line_no': 5, 'char_start': 173, 'char_end': 176, 'line': '\t}\n'}]}
{'deleted': [], 'added': [{'char_start': 143, 'char_end': 177, 'chars': 'if (len < 2) {\n\t\treturn NULL;\n\t}\n\t'}]}
github.com/radare/radare2/commit/b35530fa0681b27eba084de5527037ebfb397422
libr/anal/p/anal_avr.c
cwe-125
677
false
true
false
cwe-125
tensorflow::QuantizeAndDequantizeV2Op::Compute
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); const int depth = (axis_ == -1) ? 1 : input.dim_size(axis_); Tensor input_min_tensor; Tensor input_max_tensor; Tensor* output = nullptr; OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &output)); ...
void Compute(OpKernelContext* ctx) override { const Tensor& input = ctx->input(0); OP_REQUIRES( ctx, (axis_ == -1 || axis_ < input.shape().dims()), errors::InvalidArgument("Shape must be at least rank ", axis_ + 1, " but is rank ", input.shape().dims())); co...
{'deleted': [], 'added': [{'line_no': 3, 'char_start': 89, 'char_end': 106, 'line': ' OP_REQUIRES(\n'}, {'line_no': 4, 'char_start': 106, 'char_end': 166, 'line': ' ctx, (axis_ == -1 || axis_ < input.shape().dims()),\n'}, {'line_no': 5, 'char_start': 166, 'char_end': 241, 'line': ' errors::InvalidArgum...
{'deleted': [], 'added': [{'char_start': 93, 'char_end': 318, 'chars': 'OP_REQUIRES(\n ctx, (axis_ == -1 || axis_ < input.shape().dims()),\n errors::InvalidArgument("Shape must be at least rank ", axis_ + 1,\n " but is rank ", input.shape().dims()));\n '}]}
github.com/tensorflow/tensorflow/commit/eccb7ec454e6617738554a255d77f08e60ee0808
tensorflow/core/kernels/quantize_and_dequantize_op.cc
cwe-125
583
false
true
false
cwe-125
matchCurrentInput
matchCurrentInput( const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) return 0; return 1; }
matchCurrentInput( const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; ((k < passIC + 2 + passInstructions[passIC + 1]) && (kk < input->length)); k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) re...
{'deleted': [{'line_no': 5, 'char_start': 124, 'char_end': 198, 'line': '\tfor (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++)\n'}], 'added': [{'line_no': 5, 'char_start': 124, 'char_end': 146, 'line': '\tfor (k = passIC + 2;\n'}, {'line_no': 6, 'char_start': 146, 'char_end': 224, 'line': '\t\t\t((...
{'deleted': [{'char_start': 145, 'char_end': 146, 'chars': ' '}, {'char_start': 192, 'char_end': 193, 'chars': ' '}], 'added': [{'char_start': 145, 'char_end': 151, 'chars': '\n\t\t\t(('}, {'char_start': 196, 'char_end': 206, 'chars': ') && (kk <'}, {'char_start': 207, 'char_end': 227, 'chars': 'input->length));\n\t\t\...
github.com/liblouis/liblouis/commit/5e4089659bb49b3095fa541fa6387b4c40d7396e
liblouis/lou_translateString.c
cwe-125
99
false
true
false
cwe-125
read_Header
read_Header(struct archive_read *a, struct _7z_header_info *h, int check_header_id) { struct _7zip *zip = (struct _7zip *)a->format->data; const unsigned char *p; struct _7z_folder *folders; struct _7z_stream_info *si = &(zip->si); struct _7zip_entry *entries; uint32_t folderIndex, indexInFolder; unsigned i;...
read_Header(struct archive_read *a, struct _7z_header_info *h, int check_header_id) { struct _7zip *zip = (struct _7zip *)a->format->data; const unsigned char *p; struct _7z_folder *folders; struct _7z_stream_info *si = &(zip->si); struct _7zip_entry *entries; uint32_t folderIndex, indexInFolder; unsigned i;...
{'deleted': [], 'added': [{'line_no': 90, 'char_start': 1753, 'char_end': 1789, 'line': '\t\t\tif (h->emptyStreamBools != NULL)\n'}, {'line_no': 91, 'char_start': 1789, 'char_end': 1806, 'line': '\t\t\t\treturn (-1);\n'}, {'line_no': 112, 'char_start': 2340, 'char_end': 2374, 'line': '\t\t\tif (h->emptyFileBools != NUL...
{'deleted': [{'char_start': 1808, 'char_end': 1808, 'chars': ''}, {'char_start': 4268, 'char_end': 4268, 'chars': ''}], 'added': [{'char_start': 1756, 'char_end': 1809, 'chars': 'if (h->emptyStreamBools != NULL)\n\t\t\t\treturn (-1);\n\t\t\t'}, {'char_start': 2340, 'char_end': 2391, 'chars': '\t\t\tif (h->emptyFileBool...
github.com/libarchive/libarchive/commit/7f17c791dcfd8c0416e2cd2485b19410e47ef126
libarchive/archive_read_support_format_7zip.c
cwe-125
2,453
false
false
false
cwe-125
ReadMATImage
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; PixelPacket *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; unsign...
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; PixelPacket *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; unsign...
{'deleted': [], 'added': [{'line_no': 336, 'char_start': 12091, 'char_end': 12142, 'line': ' quantum_info=DestroyQuantumInfo(quantum_info);\n'}]}
{'deleted': [], 'added': [{'char_start': 12091, 'char_end': 12142, 'chars': ' quantum_info=DestroyQuantumInfo(quantum_info);\n'}]}
github.com/ImageMagick/ImageMagick/commit/b173a352397877775c51c9a0e9d59eb6ce24c455
coders/mat.c
cwe-125
4,426
false
false
false
cwe-125
X86_insn_reg_intel
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access) { unsigned int first = 0; unsigned int last = ARR_SIZE(insn_regs_intel) - 1; unsigned int mid = ARR_SIZE(insn_regs_intel) / 2; if (!intel_regs_sorted) { memcpy(insn_regs_intel_sorted, insn_regs_intel, sizeof(insn_regs_intel_sorted)); qsor...
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access) { static bool intel_regs_sorted = false; unsigned int first = 0; unsigned int last = ARR_SIZE(insn_regs_intel) - 1; unsigned int mid; if (!intel_regs_sorted) { memcpy(insn_regs_intel_sorted, insn_regs_intel, sizeof(insn_regs_intel_sorted))...
{'deleted': [{'line_no': 5, 'char_start': 148, 'char_end': 199, 'line': '\tunsigned int mid = ARR_SIZE(insn_regs_intel) / 2;\n'}, {'line_no': 29, 'char_start': 780, 'char_end': 808, 'line': '\t\tmid = (first + last) / 2;\n'}], 'added': [{'line_no': 3, 'char_start': 71, 'char_end': 111, 'line': '\tstatic bool intel_regs...
{'deleted': [{'char_start': 165, 'char_end': 197, 'chars': ' = ARR_SIZE(insn_regs_intel) / 2'}, {'char_start': 779, 'char_end': 807, 'chars': '\n\t\tmid = (first + last) / 2;'}], 'added': [{'char_start': 72, 'char_end': 112, 'chars': 'static bool intel_regs_sorted = false;\n\t'}, {'char_start': 465, 'char_end': 570, 'c...
github.com/aquynh/capstone/commit/87a25bb543c8e4c09b48d4b4a6c7db31ce58df06
arch/X86/X86Mapping.c
cwe-125
266
false
true
false
cwe-125
WriteImageChannels
static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const MagickBooleanType separate,ExceptionInfo *exception) { size_t channels, packet_size; unsigned char *compact_pixels; /* Write uncompressed pixels as separate ...
static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info, const ImageInfo *image_info,Image *image,Image *next_image, const MagickBooleanType separate,ExceptionInfo *exception) { size_t channels, packet_size; unsigned char *compact_pixels; /* Write uncompressed pixels as separate ...
{'deleted': [{'line_no': 20, 'char_start': 494, 'char_end': 566, 'line': ' compact_pixels=(unsigned char *) AcquireQuantumMemory(2*channels*\n'}, {'line_no': 21, 'char_start': 566, 'char_end': 632, 'line': ' next_image->columns,packet_size*sizeof(*compact_pixels));\n'}], 'added': [{'line_no': 20, 'char_star...
{'deleted': [], 'added': [{'char_start': 554, 'char_end': 555, 'chars': '('}, {'char_start': 594, 'char_end': 597, 'chars': ')+1'}]}
github.com/ImageMagick/ImageMagick/commit/6f1879d498bcc5cce12fe0c5decb8dbc0f608e5d
coders/psd.c
cwe-125
1,131
false
true
false
cwe-125
WavpackVerifySingleBlock
int WavpackVerifySingleBlock (unsigned char *buffer, int verify_checksum) { WavpackHeader *wphdr = (WavpackHeader *) buffer; uint32_t checksum_passed = 0, bcount, meta_bc; unsigned char *dp, meta_id, c1, c2; if (strncmp (wphdr->ckID, "wvpk", 4) || wphdr->ckSize + 8 < sizeof (WavpackHeader)) ret...
int WavpackVerifySingleBlock (unsigned char *buffer, int verify_checksum) { WavpackHeader *wphdr = (WavpackHeader *) buffer; uint32_t checksum_passed = 0, bcount, meta_bc; unsigned char *dp, meta_id, c1, c2; if (strncmp (wphdr->ckID, "wvpk", 4) || wphdr->ckSize + 8 < sizeof (WavpackHeader)) ret...
{'deleted': [{'line_no': 60, 'char_start': 1724, 'char_end': 1869, 'line': ' if (*dp++ != (csum & 0xff) || *dp++ != ((csum >> 8) & 0xff) || *dp++ != ((csum >> 16) & 0xff) || *dp++ != ((csum >> 24) & 0xff))\n'}, {'line_no': 66, 'char_start': 1973, 'char_end': 2050, 'line': ' if (*dp++ != (c...
{'deleted': [{'char_start': 1747, 'char_end': 1749, 'chars': '++'}, {'char_start': 1770, 'char_end': 1771, 'chars': '*'}, {'char_start': 1773, 'char_end': 1775, 'chars': '++'}, {'char_start': 1803, 'char_end': 1804, 'chars': '*'}, {'char_start': 1806, 'char_end': 1808, 'chars': '++'}, {'char_start': 1837, 'char_end': 1...
github.com/dbry/WavPack/commit/bba5389dc598a92bdf2b297c3ea34620b6679b5b
src/open_utils.c
cwe-125
707
false
true
false
cwe-125
Get8BIMProperty
static MagickBooleanType Get8BIMProperty(const Image *image,const char *key, ExceptionInfo *exception) { char *attribute, format[MagickPathExtent], name[MagickPathExtent], *resource; const StringInfo *profile; const unsigned char *info; long start, stop; MagickBooleanType...
static MagickBooleanType Get8BIMProperty(const Image *image,const char *key, ExceptionInfo *exception) { char *attribute, format[MagickPathExtent], name[MagickPathExtent], *resource; const StringInfo *profile; const unsigned char *info; long start, stop; MagickBooleanType...
{'deleted': [], 'added': [{'line_no': 90, 'char_start': 2403, 'char_end': 2453, 'line': ' if ((count < 0) || ((size_t) count > length))\n'}, {'line_no': 91, 'char_start': 2453, 'char_end': 2461, 'line': ' {\n'}, {'line_no': 92, 'char_start': 2461, 'char_end': 2480, 'line': ' length=0; \n'}, {'line_no': 9...
{'deleted': [], 'added': [{'char_start': 2412, 'char_end': 2515, 'chars': 'count < 0) || ((size_t) count > length))\n {\n length=0; \n continue;\n }\n if (('}]}
github.com/ImageMagick/ImageMagick/commit/dd84447b63a71fa8c3f47071b09454efc667767b
MagickCore/property.c
cwe-125
1,133
false
true
false
cwe-125
SpliceImage
MagickExport Image *SpliceImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { #define SpliceImageTag "Splice/Image" CacheView *image_view, *splice_view; Image *splice_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo splic...
MagickExport Image *SpliceImage(const Image *image, const RectangleInfo *geometry,ExceptionInfo *exception) { #define SpliceImageTag "Splice/Image" CacheView *image_view, *splice_view; Image *splice_image; MagickBooleanType status; MagickOffsetType progress; RectangleInfo splic...
{'deleted': [{'line_no': 130, 'char_start': 3435, 'char_end': 3511, 'line': ' p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);\n'}, {'line_no': 138, 'char_start': 3734, 'char_end': 3776, 'line': ' for (x=0; x < splice_geometry.x; x++)\n'}, {'line_no': 232, 'char_start': 6932, 'char_end': 70...
{'deleted': [{'char_start': 3752, 'char_end': 3756, 'chars': 'spli'}, {'char_start': 3757, 'char_end': 3761, 'chars': 'e_ge'}, {'char_start': 3763, 'char_end': 3769, 'chars': 'etry.x'}, {'char_start': 7046, 'char_end': 7118, 'chars': ';\n if ((y < 0) || (y >= (ssize_t) splice_image->rows))\n continue'}, {'char_...
github.com/ImageMagick/ImageMagick/commit/7b1cf5784b5bcd85aa9293ecf56769f68c037231
MagickCore/transform.c
cwe-125
2,536
false
false
false
cwe-125
java_switch_op
static int java_switch_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_byte = data[0]; ut64 offset = addr - java_get_method_start (); ut8 pos = (offset+1)%4 ? 1 + 4 - (offset+1)%4 : 1; if (op_byte == 0xaa) { // handle a table switch condition if (pos + 8 > len) { return op->size; ...
static int java_switch_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { ut8 op_byte = data[0]; ut64 offset = addr - java_get_method_start (); ut8 pos = (offset+1)%4 ? 1 + 4 - (offset+1)%4 : 1; if (op_byte == 0xaa) { // handle a table switch condition if (pos + 8 + 8 > len) { return op->si...
{'deleted': [{'line_no': 8, 'char_start': 277, 'char_end': 300, 'line': '\t\tif (pos + 8 > len) {\n'}, {'line_no': 11, 'char_start': 324, 'char_end': 370, 'line': '\t\tint min_val = (ut32)(UINT (data, pos + 4)),\n'}, {'line_no': 12, 'char_start': 370, 'char_end': 413, 'line': '\t\t\tmax_val = (ut32)(UINT (data, pos + 8...
{'deleted': [{'char_start': 368, 'char_end': 369, 'chars': ','}, {'char_start': 372, 'char_end': 373, 'chars': '\t'}], 'added': [{'char_start': 291, 'char_end': 295, 'chars': '+ 8 '}, {'char_start': 330, 'char_end': 336, 'chars': 'const '}, {'char_start': 378, 'char_end': 379, 'chars': ';'}, {'char_start': 382, 'char_e...
github.com/radare/radare2/commit/224e6bc13fa353dd3b7f7a2334588f1c4229e58d
libr/anal/p/anal_java.c
cwe-125
489
false
false
false
cwe-125
_6502_op
static int _6502_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { char addrbuf[64]; const int buffsize = sizeof (addrbuf) - 1; memset (op, '\0', sizeof (RAnalOp)); op->size = snes_op_get_size (1, 1, &snes_op[data[0]]); //snes-arch is similiar to nes/6502 op->addr = addr; op->type = R_ANAL_OP_T...
static int _6502_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { char addrbuf[64]; const int buffsize = sizeof (addrbuf) - 1; memset (op, '\0', sizeof (RAnalOp)); op->size = snes_op_get_size (1, 1, &snes_op[data[0]]); //snes-arch is similiar to nes/6502 op->addr = addr; op->type = R_ANAL_OP_T...
{'deleted': [{'line_no': 397, 'char_start': 10823, 'char_end': 10845, 'line': '\t\tif (data[1] <= 127)\n'}, {'line_no': 398, 'char_start': 10845, 'char_end': 10886, 'line': '\t\t\top->jump = addr + data[1] + op->size;\n'}, {'line_no': 399, 'char_start': 10886, 'char_end': 10939, 'line': '\t\telse\top->jump = addr - (25...
{'deleted': [], 'added': [{'char_start': 10829, 'char_end': 10847, 'chars': 'len > 1) {\n\t\t\tif ('}, {'char_start': 10862, 'char_end': 10864, 'chars': ' {'}, {'char_start': 10865, 'char_end': 10866, 'chars': '\t'}, {'char_start': 10909, 'char_end': 10912, 'chars': '\t} '}, {'char_start': 10916, 'char_end': 10922, 'ch...
github.com/radare/radare2/commit/bbb4af56003c1afdad67af0c4339267ca38b1017
libr/anal/p/anal_6502.c
cwe-125
7,183
false
true
false
cwe-125
gf_m2ts_process_pmt
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) { u32 info_length, pos, desc_len, evt_type, nb_es,i; u32 nb_sections; u32 data_size; u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,...
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) { u32 info_length, pos, desc_len, evt_type, nb_es,i; u32 nb_sections; u32 data_size; u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,...
{'deleted': [{'line_no': 413, 'char_start': 14239, 'char_end': 14243, 'line': '\t\t}\n'}, {'line_no': 415, 'char_start': 14244, 'char_end': 14300, 'line': '\t\tif (es->stream_type == GF_M2TS_VIDEO_HEVC) nb_hevc++;\n'}, {'line_no': 416, 'char_start': 14300, 'char_end': 14375, 'line': '\t\telse if (es->stream_type == GF_...
{'deleted': [{'char_start': 14239, 'char_end': 14240, 'chars': '\t'}, {'char_start': 14241, 'char_end': 14244, 'chars': '}\n\n'}], 'added': [{'char_start': 14240, 'char_end': 14241, 'chars': '\t'}, {'char_start': 14297, 'char_end': 14298, 'chars': '\t'}, {'char_start': 14373, 'char_end': 14374, 'chars': '\t'}, {'char_s...
github.com/gpac/gpac/commit/2320eb73afba753b39b7147be91f7be7afc0eeb7
src/media_tools/mpegts.c
cwe-125
5,704
false
true
false
cwe-125
load_tile
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfdat...
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfdat...
{'deleted': [{'line_no': 24, 'char_start': 339, 'char_end': 418, 'line': ' xcfdata=(XCFPixelInfo *) AcquireQuantumMemory(data_length,sizeof(*xcfdata));\n'}], 'added': [{'line_no': 24, 'char_start': 339, 'char_end': 410, 'line': ' xcfdata=(XCFPixelInfo *) AcquireQuantumMemory(MagickMax(data_length,\n'}, {'line_no': 25...
{'deleted': [], 'added': [{'char_start': 387, 'char_end': 397, 'chars': 'MagickMax('}, {'char_start': 408, 'char_end': 451, 'chars': ',\n tile_image->columns*tile_image->rows)'}]}
github.com/ImageMagick/ImageMagick/commit/a2e1064f288a353bc5fef7f79ccb7683759e775c
coders/xcf.c
cwe-125
589
false
true
false
cwe-125
sctp_sf_ootb
sctp_disposition_t sctp_sf_ootb(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sk_buff *skb = chunk->skb; sctp_chunkhdr_t *ch; sctp_errhdr_t *err; __u8...
sctp_disposition_t sctp_sf_ootb(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *chunk = arg; struct sk_buff *skb = chunk->skb; sctp_chunkhdr_t *ch; sctp_errhdr_t *err; __u8...
{'deleted': [{'line_no': 56, 'char_start': 1500, 'char_end': 1548, 'line': '\t\t/* Report violation if chunk len overflows */\n'}, {'line_no': 57, 'char_start': 1548, 'char_end': 1604, 'line': '\t\tch_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));\n'}, {'line_no': 58, 'char_start': 1604, 'char_end': 1642, 'line': '...
{'deleted': [{'char_start': 1498, 'char_end': 1723, 'chars': '\n\n\t\t/* Report violation if chunk len overflows */\n\t\tch_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));\n\t\tif (ch_end > skb_tail_pointer(skb))\n\t\t\treturn sctp_sf_violation_chunklen(net, ep, asoc, type, arg,\n\t\t\t\t\t\t commands);'}], 'added'...
github.com/torvalds/linux/commit/bf911e985d6bbaa328c20c3e05f4eb03de11fdd6
net/sctp/sm_statefuns.c
cwe-125
670
false
true
false
cwe-125
concat_hash_string
static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet, char *buf, u_int8_t client_hash) { u_int16_t offset = 22, buf_out_len = 0; if(offset+sizeof(u_int32_t) >= packet->payload_packet_len) goto invalid_payload; u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]); offset += 4;...
static u_int16_t concat_hash_string(struct ndpi_packet_struct *packet, char *buf, u_int8_t client_hash) { u_int16_t offset = 22, buf_out_len = 0; if(offset+sizeof(u_int32_t) >= packet->payload_packet_len) goto invalid_payload; u_int32_t len = ntohl(*(u_int32_t*)&packet->payload[offset]); offset += 4;...
{'deleted': [], 'added': [{'line_no': 18, 'char_start': 615, 'char_end': 676, 'line': ' if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n'}, {'line_no': 19, 'char_start': 676, 'char_end': 702, 'line': ' goto invalid_payload;\n'}, {'line_no': 24, 'char_start': 824, 'char_end': 885, 'line': ' if(offset+si...
{'deleted': [], 'added': [{'char_start': 617, 'char_end': 704, 'chars': 'if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n goto invalid_payload;\n '}, {'char_start': 823, 'char_end': 910, 'chars': '\n if(offset+sizeof(u_int32_t) >= packet->payload_packet_len)\n goto invalid_payload;'}, {'char_start':...
github.com/ntop/nDPI/commit/3bbb0cd3296023f6f922c71d21a1c374d2b0a435
src/lib/protocols/ssh.c
cwe-125
1,049
false
false
false
cwe-125
wrap_lines_smart
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
{'deleted': [{'line_no': 100, 'char_start': 3756, 'char_end': 3819, 'line': ' if (DIFF(l1_new, l2_new) < DIFF(l1, l2)) {\n'}], 'added': [{'line_no': 100, 'char_start': 3756, 'char_end': 3844, 'line': ' if (DIFF(l1_new, l2_new) < DIFF(l1, l2) && w > text_info->glyphs) {\n'}, {'line_...
{'deleted': [], 'added': [{'char_start': 3815, 'char_end': 3840, 'chars': ' && w > text_info->glyphs'}, {'char_start': 3843, 'char_end': 3935, 'chars': '\n if (w->linebreak)\n text_info->n_lines--;'}]}
github.com/libass/libass/commit/b72b283b936a600c730e00875d7d067bded3fc26
libass/ass_render.c
cwe-125
1,486
false
true
false
cwe-125
string_scan_range
static int string_scan_range(RList *list, const ut8 *buf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (!buf...
static int string_scan_range(RList *list, const ut8 *buf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (!buf...
{'deleted': [{'line_no': 123, 'char_start': 2779, 'char_end': 2786, 'line': '\t\t\t\t\t{\n'}, {'line_no': 124, 'char_start': 2786, 'char_end': 2829, 'line': '\t\t\t\t\t\tconst ut8 *p = buf + str_start - 2;\n'}, {'line_no': 131, 'char_start': 2964, 'char_end': 2971, 'line': '\t\t\t\t\t{\n'}, {'line_no': 132, 'char_star...
{'deleted': [{'char_start': 2810, 'char_end': 2811, 'chars': ' '}, {'char_start': 2995, 'char_end': 2996, 'chars': ' '}], 'added': [{'char_start': 2784, 'char_end': 2803, 'chars': 'if (str_start > 1) '}, {'char_start': 2987, 'char_end': 3006, 'chars': 'if (str_start > 3) '}]}
github.com/radare/radare2/commit/d31c4d3cbdbe01ea3ded16a584de94149ecd31d9
libr/bin/bin.c
cwe-125
1,243
false
false
false
cwe-125
getToken
static x86newTokenType getToken(const char *str, size_t *begin, size_t *end) { // Skip whitespace while (begin && isspace ((ut8)str[*begin])) { ++(*begin); } if (!str[*begin]) { // null byte *end = *begin; return TT_EOF; } else if (isalpha ((ut8)str[*begin])) { // word token *end = *begin...
static x86newTokenType getToken(const char *str, size_t *begin, size_t *end) { if (*begin > strlen (str)) { return TT_EOF; } // Skip whitespace while (begin && str[*begin] && isspace ((ut8)str[*begin])) { ++(*begin); } if (!str[*begin]) { // null byte *end = *begin; return TT_EOF; } if (...
{'deleted': [{'line_no': 3, 'char_start': 99, 'char_end': 146, 'line': '\twhile (begin && isspace ((ut8)str[*begin])) {\n'}, {'line_no': 10, 'char_start': 247, 'char_end': 305, 'line': '\t} else if (isalpha ((ut8)str[*begin])) { // word token\n'}, {'line_no': 12, 'char_start': 322, 'char_end': 366, 'line': '\t\twhile...
{'deleted': [{'char_start': 249, 'char_end': 255, 'chars': ' else '}, {'char_start': 403, 'char_end': 409, 'chars': ' else '}], 'added': [{'char_start': 80, 'char_end': 130, 'chars': 'if (*begin > strlen (str)) {\n\t\treturn TT_EOF;\n\t}\n\t'}, {'char_start': 162, 'char_end': 177, 'chars': ' && str[*begin]'}, {'char_st...
github.com/radare/radare2/commit/66191f780863ea8c66ace4040d0d04a8842e8432
libr/asm/p/asm_x86_nz.c
cwe-125
236
false
true
false
cwe-125
string_scan_range
static int string_scan_range(RList *list, RBinFile *bf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (from >...
static int string_scan_range(RList *list, RBinFile *bf, int min, const ut64 from, const ut64 to, int type) { ut8 tmp[R_STRING_SCAN_BUFFER_SIZE]; ut64 str_start, needle = from; int count = 0, i, rc, runes; int str_type = R_STRING_TYPE_DETECT; if (type == -1) { type = R_STRING_TYPE_DETECT; } if (from >...
{'deleted': [{'line_no': 15, 'char_start': 418, 'char_end': 453, 'line': '\tut8 *buf = calloc (to - from, 1);\n'}, {'line_no': 19, 'char_start': 490, 'char_end': 538, 'line': '\tr_buf_read_at (bf->buf, from, buf, to - from);\n'}, {'line_no': 29, 'char_start': 768, 'char_end': 796, 'line': '\t\t\tif ((to - needle) > 5) ...
{'deleted': [{'char_start': 438, 'char_end': 447, 'chars': 'to - from'}, {'char_start': 526, 'char_end': 535, 'chars': 'to - from'}], 'added': [{'char_start': 419, 'char_end': 441, 'chars': 'int len = to - from;\n\t'}, {'char_start': 460, 'char_end': 463, 'chars': 'len'}, {'char_start': 542, 'char_end': 545, 'chars': '...
github.com/radare/radare2/commit/3fcf41ed96ffa25b38029449520c8d0a198745f3
libr/bin/file.c
cwe-125
1,357
false
true
false
cwe-125
uas_switch_interface
static int uas_switch_interface(struct usb_device *udev, struct usb_interface *intf) { int alt; alt = uas_find_uas_alt_setting(intf); if (alt < 0) return alt; return usb_set_interface(udev, intf->altsetting[0].desc.bInterfaceNumber, alt); }
static int uas_switch_interface(struct usb_device *udev, struct usb_interface *intf) { struct usb_host_interface *alt; alt = uas_find_uas_alt_setting(intf); if (!alt) return -ENODEV; return usb_set_interface(udev, alt->desc.bInterfaceNumber, alt->desc.bAlternateSetting); }
{'deleted': [{'line_no': 4, 'char_start': 91, 'char_end': 101, 'line': '\tint alt;\n'}, {'line_no': 7, 'char_start': 141, 'char_end': 155, 'line': '\tif (alt < 0)\n'}, {'line_no': 8, 'char_start': 155, 'char_end': 169, 'line': '\t\treturn alt;\n'}, {'line_no': 10, 'char_start': 170, 'char_end': 202, 'line': '\treturn u...
{'deleted': [{'char_start': 149, 'char_end': 153, 'chars': ' < 0'}, {'char_start': 164, 'char_end': 167, 'chars': 'alt'}, {'char_start': 201, 'char_end': 211, 'chars': '\n\t\t\tintf->'}, {'char_start': 214, 'char_end': 225, 'chars': 'setting[0].'}, {'char_start': 247, 'char_end': 248, 'chars': ' '}], 'added': [{'char_s...
github.com/torvalds/linux/commit/786de92b3cb26012d3d0f00ee37adf14527f35c4
drivers/usb/storage/uas.c
cwe-125
72
false
true
false
cwe-125
jpc_pi_nextrpcl
static int jpc_pi_nextrpcl(register jpc_pi_t *pi) { int rlvlno; jpc_pirlvl_t *pirlvl; jpc_pchg_t *pchg; int prchind; int prcvind; int *prclyrno; int compno; jpc_picomp_t *picomp; int xstep; int ystep; uint_fast32_t r; uint_fast32_t rpx; uint_fast32_t rpy; uint_fast32_t trx0; uint_fast32_t try0; pchg = ...
static int jpc_pi_nextrpcl(register jpc_pi_t *pi) { int rlvlno; jpc_pirlvl_t *pirlvl; jpc_pchg_t *pchg; int prchind; int prcvind; int *prclyrno; int compno; jpc_picomp_t *picomp; int xstep; int ystep; uint_fast32_t r; uint_fast32_t rpx; uint_fast32_t rpy; uint_fast32_t trx0; uint_fast32_t try0; pchg = ...
{'deleted': [{'line_no': 30, 'char_start': 656, 'char_end': 710, 'line': '\t\t\t\tif (pirlvl->prcwidthexpn + pi->picomp->numrlvls >\n'}, {'line_no': 32, 'char_start': 746, 'char_end': 799, 'line': '\t\t\t\t pirlvl->prcheightexpn + pi->picomp->numrlvls >\n'}], 'added': [{'line_no': 30, 'char_start': 656, 'char_end': 70...
{'deleted': [{'char_start': 689, 'char_end': 693, 'chars': '->pi'}, {'char_start': 776, 'char_end': 780, 'chars': 'pi->'}], 'added': []}
github.com/mdadams/jasper/commit/f25486c3d4aa472fec79150f2c41ed4333395d3d
src/libjasper/jpc/jpc_t2cod.c
cwe-125
1,363
false
false
false
cwe-125
SyncExifProfile
MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile) { #define MaxDirectoryStack 16 #define EXIF_DELIMITER "\n" #define EXIF_NUM_FORMATS 12 #define TAG_EXIF_OFFSET 0x8769 #define TAG_INTEROP_OFFSET 0xa005 typedef struct _DirectoryInfo { unsigned char *directory; size_t entr...
MagickBooleanType SyncExifProfile(Image *image,StringInfo *profile) { #define MaxDirectoryStack 16 #define EXIF_DELIMITER "\n" #define EXIF_NUM_FORMATS 12 #define TAG_EXIF_OFFSET 0x8769 #define TAG_INTEROP_OFFSET 0xa005 typedef struct _DirectoryInfo { unsigned char *directory; size_t entr...
{'deleted': [{'line_no': 125, 'char_start': 2750, 'char_end': 2792, 'line': ' if ((format-1) >= EXIF_NUM_FORMATS)\n'}], 'added': [{'line_no': 125, 'char_start': 2750, 'char_end': 2810, 'line': ' if ((format < 0) || ((format-1) >= EXIF_NUM_FORMATS))\n'}]}
{'deleted': [], 'added': [{'char_start': 2767, 'char_end': 2784, 'chars': ' < 0) || ((format'}, {'char_start': 2807, 'char_end': 2808, 'chars': ')'}]}
github.com/ImageMagick/ImageMagick/commit/a7bb158b7bedd1449a34432feb3a67c8f1873bfa
MagickCore/profile.c
cwe-125
1,540
false
true
false
cwe-125
usb_get_bos_descriptor
int usb_get_bos_descriptor(struct usb_device *dev) { struct device *ddev = &dev->dev; struct usb_bos_descriptor *bos; struct usb_dev_cap_header *cap; unsigned char *buffer; int length, total_len, num, i; int ret; bos = kzalloc(sizeof(struct usb_bos_descriptor), GFP_KERNEL); if (!bos) return -ENOMEM; /* Get...
int usb_get_bos_descriptor(struct usb_device *dev) { struct device *ddev = &dev->dev; struct usb_bos_descriptor *bos; struct usb_dev_cap_header *cap; unsigned char *buffer; int length, total_len, num, i; int ret; bos = kzalloc(sizeof(struct usb_bos_descriptor), GFP_KERNEL); if (!bos) return -ENOMEM; /* Get...
{'deleted': [{'line_no': 55, 'char_start': 1313, 'char_end': 1338, 'line': '\t\tlength = cap->bLength;\n'}, {'line_no': 57, 'char_start': 1339, 'char_end': 1365, 'line': '\t\tif (total_len < length)\n'}], 'added': [{'line_no': 56, 'char_start': 1314, 'char_end': 1376, 'line': '\t\tif (total_len < sizeof(*cap) || total_...
{'deleted': [{'char_start': 1318, 'char_end': 1321, 'chars': 'gth'}, {'char_start': 1322, 'char_end': 1323, 'chars': '='}, {'char_start': 1327, 'char_end': 1343, 'chars': '->bLength;\n\n\t\tif'}, {'char_start': 1344, 'char_end': 1345, 'chars': '('}, {'char_start': 1357, 'char_end': 1358, 'chars': 'l'}], 'added': [{'cha...
github.com/torvalds/linux/commit/1c0edc3633b56000e18d82fc241e3995ca18a69e
drivers/usb/core/config.c
cwe-125
667
false
true
false
cwe-125
WriteTIFFImage
static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, Image *image) { const char *mode, *option; CompressionType compression; EndianType endian_type; MagickBooleanType debug, status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType q...
static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, Image *image) { const char *mode, *option; CompressionType compression; EndianType endian_type; MagickBooleanType debug, status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType q...
{'deleted': [{'line_no': 893, 'char_start': 30340, 'char_end': 30392, 'line': ' if (image->exception.severity > ErrorException)\n'}, {'line_no': 894, 'char_start': 30392, 'char_end': 30405, 'line': ' break;\n'}, {'line_no': 899, 'char_start': 30549, 'char_end': 30586, 'line': ' (void) TIFFWriteDirectory(tiff...
{'deleted': [{'char_start': 30340, 'char_end': 30405, 'chars': ' if (image->exception.severity > ErrorException)\n break;\n'}, {'char_start': 30553, 'char_end': 30556, 'chars': '(vo'}, {'char_start': 30557, 'char_end': 30559, 'chars': 'd)'}, {'char_start': 30863, 'char_end': 30880, 'chars': 'image->exception.'}...
github.com/ImageMagick/ImageMagick6/commit/3c53413eb544cc567309b4c86485eae43e956112
coders/tiff.c
cwe-125
7,681
false
false
false
cwe-125
mxf_parse_structural_metadata
static int mxf_parse_structural_metadata(MXFContext *mxf) { MXFPackage *material_package = NULL; int i, j, k, ret; av_log(mxf->fc, AV_LOG_TRACE, "metadata sets count %d\n", mxf->metadata_sets_count); /* TODO: handle multiple material packages (OP3x) */ for (i = 0; i < mxf->packages_count; i++) { ...
static int mxf_parse_structural_metadata(MXFContext *mxf) { MXFPackage *material_package = NULL; int i, j, k, ret; av_log(mxf->fc, AV_LOG_TRACE, "metadata sets count %d\n", mxf->metadata_sets_count); /* TODO: handle multiple material packages (OP3x) */ for (i = 0; i < mxf->packages_count; i++) { ...
{'deleted': [{'line_no': 104, 'char_start': 5013, 'char_end': 5117, 'line': ' av_log(mxf, AV_LOG_TRACE, "could not resolve essence container data strong ref\\n");\n'}], 'added': [{'line_no': 104, 'char_start': 5013, 'char_end': 5121, 'line': ' av_log(mxf->fc, AV_LOG_TRACE, "could n...
{'deleted': [], 'added': [{'char_start': 5043, 'char_end': 5047, 'chars': '->fc'}]}
github.com/FFmpeg/FFmpeg/commit/bab0716c7f4793ec42e05a5aa7e80d82a0dd4e75
libavformat/mxfdec.c
cwe-125
4,817
false
false
false
cwe-125
GetPSDRowSize
static inline size_t GetPSDRowSize(Image *image) { if (image->depth == 1) return((image->columns+7)/8); else return(image->columns*GetPSDPacketSize(image)); }
static inline size_t GetPSDRowSize(Image *image) { if (image->depth == 1) return(((image->columns+7)/8)*GetPSDPacketSize(image)); else return(image->columns*GetPSDPacketSize(image)); }
{'deleted': [{'line_no': 4, 'char_start': 76, 'char_end': 110, 'line': ' return((image->columns+7)/8);\n'}], 'added': [{'line_no': 4, 'char_start': 76, 'char_end': 136, 'line': ' return(((image->columns+7)/8)*GetPSDPacketSize(image));\n'}]}
{'deleted': [], 'added': [{'char_start': 88, 'char_end': 89, 'chars': '('}, {'char_start': 108, 'char_end': 133, 'chars': ')*GetPSDPacketSize(image)'}]}
github.com/ImageMagick/ImageMagick/commit/5f16640725b1225e6337c62526e6577f0f88edb8
coders/psd.c
cwe-125
52
false
true
false
cwe-125
parse8BIM
static ssize_t parse8BIM(Image *ifile, Image *ofile) { char brkused, quoted, *line, *token, *newstr, *name; int state, next; unsigned char dataset; unsigned int recnum; int inputlen = MaxTextExtent; MagickOffsetType savedpos, currentpos; ssize_t ...
static ssize_t parse8BIM(Image *ifile, Image *ofile) { char brkused, quoted, *line, *token, *newstr, *name; int state, next; unsigned char dataset; unsigned int recnum; int inputlen = MaxTextExtent; MagickOffsetType savedpos, currentpos; ssize_t ...
{'deleted': [{'line_no': 173, 'char_start': 4538, 'char_end': 4572, 'line': ' while (len--)\n'}, {'line_no': 204, 'char_start': 5742, 'char_end': 5776, 'line': ' while (len--)\n'}], 'added': [{'line_no': 173, 'char_start': 4538, 'char_end': 4576, 'line': ' while ...
{'deleted': [], 'added': [{'char_start': 4570, 'char_end': 4574, 'chars': ' > 0'}, {'char_start': 5778, 'char_end': 5782, 'chars': ' > 0'}]}
github.com/ImageMagick/ImageMagick/commit/97c9f438a9b3454d085895f4d1f66389fd22a0fb
coders/meta.c
cwe-125
1,608
false
true
false
cwe-125
glyph_cache_put
BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph) { rdpGlyph* prevGlyph; if (id > 9) { WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id); return FALSE; } if (index > glyphCache->glyphCache[id].number) { WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " in...
BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph) { rdpGlyph* prevGlyph; if (id > 9) { WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id); return FALSE; } if (index >= glyphCache->glyphCache[id].number) { WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " i...
{'deleted': [{'line_no': 11, 'char_start': 211, 'char_end': 259, 'line': '\tif (index > glyphCache->glyphCache[id].number)\n'}], 'added': [{'line_no': 11, 'char_start': 211, 'char_end': 260, 'line': '\tif (index >= glyphCache->glyphCache[id].number)\n'}]}
{'deleted': [], 'added': [{'char_start': 223, 'char_end': 224, 'chars': '='}]}
github.com/FreeRDP/FreeRDP/commit/c0fd449ec0870b050d350d6d844b1ea6dad4bc7d
libfreerdp/cache/glyph.c
cwe-125
213
false
false
false
cwe-125
store_versioninfo_gnu_verdef
static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { const char *section_name = ""; const char *link_section_name = ""; char *end = NULL; Elf_(Shdr) *link_shdr = NULL; ut8 dfs[sizeof (Elf_(Verdef))] = {0}; Sdb *sdb; int cnt, i; if (shdr->sh_link > bin->ehdr.e_shnum) { return false...
static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) { const char *section_name = ""; const char *link_section_name = ""; char *end = NULL; Elf_(Shdr) *link_shdr = NULL; ut8 dfs[sizeof (Elf_(Verdef))] = {0}; Sdb *sdb; int cnt, i; if (shdr->sh_link > bin->ehdr.e_shnum) { return false...
{'deleted': [{'line_no': 56, 'char_start': 1827, 'char_end': 1855, 'line': '\t\tvstart += verdef->vd_aux;\n'}], 'added': [{'line_no': 56, 'char_start': 1827, 'char_end': 1857, 'line': '\t\tint vdaux = verdef->vd_aux;\n'}, {'line_no': 57, 'char_start': 1857, 'char_end': 1876, 'line': '\t\tif (vdaux < 1) {\n'}, {'line_no...
{'deleted': [{'char_start': 1829, 'char_end': 1831, 'chars': 'vs'}, {'char_start': 1833, 'char_end': 1835, 'chars': 'rt'}, {'char_start': 1836, 'char_end': 1837, 'chars': '+'}], 'added': [{'char_start': 1829, 'char_end': 1833, 'chars': 'int '}, {'char_start': 1834, 'char_end': 1835, 'chars': 'd'}, {'char_start': 1836, ...
github.com/radare/radare2/commit/44ded3ff35b8264f54b5a900cab32ec489d9e5b9
libr/bin/format/elf/elf.c
cwe-125
1,404
false
false
false
cwe-125
next_line
next_line(struct archive_read *a, const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl) { ssize_t len; int quit; quit = 0; if (*avail == 0) { *nl = 0; len = 0; } else len = get_line_size(*b, *avail, nl); /* * Read bytes more while it does not reach the end of line. */ while (*nl == 0 && l...
next_line(struct archive_read *a, const char **b, ssize_t *avail, ssize_t *ravail, ssize_t *nl) { ssize_t len; int quit; quit = 0; if (*avail == 0) { *nl = 0; len = 0; } else len = get_line_size(*b, *avail, nl); /* * Read bytes more while it does not reach the end of line. */ while (*nl == 0 && l...
{'deleted': [{'line_no': 38, 'char_start': 933, 'char_end': 972, 'line': '\t\tlen = get_line_size(*b, *avail, nl);\n'}], 'added': [{'line_no': 38, 'char_start': 933, 'char_end': 984, 'line': '\t\tlen = get_line_size(*b + len, *avail - len, nl);\n'}]}
{'deleted': [], 'added': [{'char_start': 957, 'char_end': 963, 'chars': ' + len'}, {'char_start': 971, 'char_end': 977, 'chars': ' - len'}]}
github.com/libarchive/libarchive/commit/eec077f52bfa2d3f7103b4b74d52572ba8a15aca
libarchive/archive_read_support_format_mtree.c
cwe-125
358
false
true
false
cwe-125
lha_read_file_header_1
lha_read_file_header_1(struct archive_read *a, struct lha *lha) { const unsigned char *p; size_t extdsize; int i, err, err2; int namelen, padding; unsigned char headersum, sum_calculated; err = ARCHIVE_OK; if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL) return (truncated_error(a)); lha->hea...
lha_read_file_header_1(struct archive_read *a, struct lha *lha) { const unsigned char *p; size_t extdsize; int i, err, err2; int namelen, padding; unsigned char headersum, sum_calculated; err = ARCHIVE_OK; if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL) return (truncated_error(a)); lha->hea...
{'deleted': [], 'added': [{'line_no': 53, 'char_start': 1755, 'char_end': 1779, 'line': '\tif (lha->compsize < 0)\n'}, {'line_no': 54, 'char_start': 1779, 'char_end': 1830, 'line': '\t\tgoto invalid;\t/* Invalid compressed file size */\n'}, {'line_no': 55, 'char_start': 1830, 'char_end': 1831, 'line': '\n'}]}
{'deleted': [], 'added': [{'char_start': 1760, 'char_end': 1836, 'chars': 'lha->compsize < 0)\n\t\tgoto invalid;\t/* Invalid compressed file size */\n\n\tif ('}]}
github.com/libarchive/libarchive/commit/98dcbbf0bf4854bf987557e55e55fff7abbf3ea9
libarchive/archive_read_support_format_lha.c
cwe-125
635
false
false
false
cwe-125
ttm_put_pages
static void ttm_put_pages(struct page **pages, unsigned npages, int flags, enum ttm_caching_state cstate) { struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate); #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate); #endif unsigned long irq_flags; unsigne...
static void ttm_put_pages(struct page **pages, unsigned npages, int flags, enum ttm_caching_state cstate) { struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate); #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate); #endif unsigned long irq_flags; unsigne...
{'deleted': [{'line_no': 29, 'char_start': 736, 'char_end': 766, 'line': '\t\t\t\t\tif (p++ != pages[i + j])\n'}, {'line_no': 64, 'char_start': 1344, 'char_end': 1373, 'line': '\t\t\t\tif (p++ != pages[i + j])\n'}], 'added': [{'line_no': 29, 'char_start': 736, 'char_end': 766, 'line': '\t\t\t\t\tif (++p != pages[i + j]...
{'deleted': [{'char_start': 745, 'char_end': 746, 'chars': 'p'}, {'char_start': 1352, 'char_end': 1353, 'chars': 'p'}], 'added': [{'char_start': 747, 'char_end': 748, 'chars': 'p'}, {'char_start': 1354, 'char_end': 1355, 'chars': 'p'}]}
github.com/torvalds/linux/commit/453393369dc9806d2455151e329c599684762428
drivers/gpu/drm/ttm/ttm_page_alloc.c
cwe-125
854
false
true
false
cwe-125
CSoundFile::GetLength
std::vector<GetLengthType> CSoundFile::GetLength(enmGetLengthResetMode adjustMode, GetLengthTarget target) { std::vector<GetLengthType> results; GetLengthType retval; retval.startOrder = target.startOrder; retval.startRow = target.startRow; // Are we trying to reach a certain pattern position? const bool hasSear...
std::vector<GetLengthType> CSoundFile::GetLength(enmGetLengthResetMode adjustMode, GetLengthTarget target) { std::vector<GetLengthType> results; GetLengthType retval; retval.startOrder = target.startOrder; retval.startRow = target.startRow; // Are we trying to reach a certain pattern position? const bool hasSear...
{'deleted': [{'line_no': 978, 'char_start': 31995, 'char_end': 32059, 'line': '\t\t\t\tfor(CHANNELINDEX nChn = 0; nChn < GetNumChannels(); nChn++)\n'}], 'added': [{'line_no': 978, 'char_start': 31995, 'char_end': 32021, 'line': '\t\t\t\tpChn = playState.Chn;\n'}, {'line_no': 979, 'char_start': 32021, 'char_end': 32093,...
{'deleted': [], 'added': [{'char_start': 31999, 'char_end': 32025, 'chars': 'pChn = playState.Chn;\n\t\t\t\t'}, {'char_start': 32078, 'char_end': 32086, 'chars': 'Chn++, p'}]}
github.com/OpenMPT/openmpt/commit/492022c7297ede682161d9c0ec2de15526424e76
soundlib/Snd_fx.cpp
cwe-125
11,000
false
false
false
cwe-125
ReadPSDChannelPixels
static MagickBooleanType ReadPSDChannelPixels(Image *image, const size_t channels,const size_t row,const ssize_t type, const unsigned char *pixels,ExceptionInfo *exception) { Quantum pixel; register const unsigned char *p; register Quantum *q; register ssize_t x; size_t packet_size...
static MagickBooleanType ReadPSDChannelPixels(Image *image, const size_t channels,const size_t row,const ssize_t type, const unsigned char *pixels,ExceptionInfo *exception) { Quantum pixel; register const unsigned char *p; register Quantum *q; register ssize_t x; size_t packet_size...
{'deleted': [{'line_no': 72, 'char_start': 1913, 'char_end': 1960, 'line': ' GetPixelIndex(image,q),q);\n'}], 'added': [{'line_no': 72, 'char_start': 1913, 'char_end': 1986, 'line': ' ConstrainColormapIndex(image,GetPixelIndex(image,q),\n'}, {'line_no': 73, 'char_start': 1986, 'cha...
{'deleted': [], 'added': [{'char_start': 1933, 'char_end': 1962, 'chars': 'ConstrainColormapIndex(image,'}, {'char_start': 1983, 'char_end': 2017, 'chars': '),\n exception'}]}
github.com/ImageMagick/ImageMagick/commit/e14fd0a2801f73bdc123baf4fbab97dec55919eb
coders/psd.c
cwe-125
764
false
true
false
cwe-125
ReadOneMNGImage
static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { char page_geometry[MaxTextExtent]; Image *image; MagickBooleanType logging; volatile int first_mng_object, object_id, term_chunk_found, skip_to_iend; volatile ssize_t ...
static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { char page_geometry[MaxTextExtent]; Image *image; MagickBooleanType logging; volatile int first_mng_object, object_id, term_chunk_found, skip_to_iend; volatile ssize_t ...
{'deleted': [], 'added': [{'line_no': 885, 'char_start': 27353, 'char_end': 27408, 'line': ' if ((i < 0) || (i >= MNG_MAX_OBJECTS))\n'}, {'line_no': 886, 'char_start': 27408, 'char_end': 27436, 'line': ' continue;\n'}]}
{'deleted': [], 'added': [{'char_start': 27373, 'char_end': 27456, 'chars': '(i < 0) || (i >= MNG_MAX_OBJECTS))\n continue;\n if ('}]}
github.com/ImageMagick/ImageMagick/commit/78d4c5db50fbab0b4beb69c46c6167f2c6513dec
coders/png.c
cwe-125
17,324
false
false
false
cwe-125
decode_studio_vop_header
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; if (get_bits_left(gb) <= 32) return 0; s->partitioned_frame = 0; s->decode_mb = mpeg4_decode_studio_mb; decode_smpte_tc(ctx, gb); skip_bits(gb, 10); /* temporal_reference */ ...
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb) { MpegEncContext *s = &ctx->m; if (get_bits_left(gb) <= 32) return 0; s->partitioned_frame = 0; s->interlaced_dct = 0; s->decode_mb = mpeg4_decode_studio_mb; decode_smpte_tc(ctx, gb); skip_bits(gb, 10); ...
{'deleted': [], 'added': [{'line_no': 9, 'char_start': 195, 'char_end': 222, 'line': ' s->interlaced_dct = 0;\n'}]}
{'deleted': [], 'added': [{'char_start': 202, 'char_end': 229, 'chars': 'interlaced_dct = 0;\n s->'}]}
github.com/FFmpeg/FFmpeg/commit/1f686d023b95219db933394a7704ad9aa5f01cbb
libavcodec/mpeg4videodec.c
cwe-125
624
false
true
false
cwe-125
handle_eac3
static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) { AC3HeaderInfo *hdr = NULL; struct eac3_info *info; int num_blocks, ret; if (!track->eac3_priv && !(track->eac3_priv = av_mallocz(sizeof(*info)))) return AVERROR(ENOMEM); info = track->eac3_priv; if (avpriv_ac3...
static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) { AC3HeaderInfo *hdr = NULL; struct eac3_info *info; int num_blocks, ret; if (!track->eac3_priv && !(track->eac3_priv = av_mallocz(sizeof(*info)))) return AVERROR(ENOMEM); info = track->eac3_priv; if (avpriv_ac3...
{'deleted': [{'line_no': 42, 'char_start': 1457, 'char_end': 1543, 'line': ' avpriv_request_sample(track->par, "Multiple independent substreams");\n'}], 'added': [{'line_no': 42, 'char_start': 1457, 'char_end': 1540, 'line': ' avpriv_request_sample(mov->fc, "Multiple independent substreams...
{'deleted': [{'char_start': 1495, 'char_end': 1500, 'chars': 'track'}, {'char_start': 1502, 'char_end': 1505, 'chars': 'par'}], 'added': [{'char_start': 1495, 'char_end': 1498, 'chars': 'mov'}, {'char_start': 1500, 'char_end': 1502, 'chars': 'fc'}]}
github.com/FFmpeg/FFmpeg/commit/95556e27e2c1d56d9e18f5db34d6f756f3011148
libavformat/movenc.c
cwe-125
1,295
false
false
false
cwe-125
parse_hid_report_descriptor
static void parse_hid_report_descriptor(struct gtco *device, char * report, int length) { struct device *ddev = &device->intf->dev; int x, i = 0; /* Tag primitive vars */ __u8 prefix; __u8 size; __u8 tag; __u8 type; __u8 data = 0; __u16 data16 = 0; __u32 data32 = 0; /* For parsing logi...
static void parse_hid_report_descriptor(struct gtco *device, char * report, int length) { struct device *ddev = &device->intf->dev; int x, i = 0; /* Tag primitive vars */ __u8 prefix; __u8 size; __u8 tag; __u8 type; __u8 data = 0; __u16 data16 = 0; __u32 data32 = 0; /* For parsing logi...
{'deleted': [{'line_no': 35, 'char_start': 704, 'char_end': 726, 'line': '\t\tprefix = report[i];\n'}, {'line_no': 36, 'char_start': 726, 'char_end': 727, 'line': '\n'}, {'line_no': 37, 'char_start': 727, 'char_end': 752, 'line': '\t\t/* Skip over prefix */\n'}, {'line_no': 38, 'char_start': 752, 'char_end': 759, 'line...
{'deleted': [{'char_start': 723, 'char_end': 755, 'chars': '];\n\n\t\t/* Skip over prefix */\n\t\ti'}, {'char_start': 987, 'char_end': 988, 'chars': '3'}, {'char_start': 989, 'char_end': 1002, 'chars': '\n\t\t\tsize = 4;'}], 'added': [{'char_start': 723, 'char_end': 725, 'chars': '++'}, {'char_start': 807, 'char_end': ...
github.com/torvalds/linux/commit/a50829479f58416a013a4ccca791336af3c584c7
drivers/input/tablet/gtco.c
cwe-125
2,397
false
true
false
cwe-125
update_read_bitmap_data
static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData) { WINPR_UNUSED(update); if (Stream_GetRemainingLength(s) < 18) return FALSE; Stream_Read_UINT16(s, bitmapData->destLeft); Stream_Read_UINT16(s, bitmapData->destTop); Stream_Read_UINT16(s, bitmapData->destRight); Stream_...
static BOOL update_read_bitmap_data(rdpUpdate* update, wStream* s, BITMAP_DATA* bitmapData) { WINPR_UNUSED(update); if (Stream_GetRemainingLength(s) < 18) return FALSE; Stream_Read_UINT16(s, bitmapData->destLeft); Stream_Read_UINT16(s, bitmapData->destTop); Stream_Read_UINT16(s, bitmapData->destRight); Stream_...
{'deleted': [], 'added': [{'line_no': 21, 'char_start': 699, 'char_end': 740, 'line': '\t\t\tif (Stream_GetRemainingLength(s) < 8)\n'}, {'line_no': 22, 'char_start': 740, 'char_end': 758, 'line': '\t\t\t\treturn FALSE;\n'}, {'line_no': 23, 'char_start': 758, 'char_end': 759, 'line': '\n'}]}
{'deleted': [], 'added': [{'char_start': 702, 'char_end': 762, 'chars': 'if (Stream_GetRemainingLength(s) < 8)\n\t\t\t\treturn FALSE;\n\n\t\t\t'}]}
github.com/FreeRDP/FreeRDP/commit/f8890a645c221823ac133dbf991f8a65ae50d637
libfreerdp/core/update.c
cwe-125
459
false
true
false
cwe-125
asylo::primitives::TrustedPrimitives::UntrustedCall
PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector, MessageWriter *input, MessageReader *output) { int ret; UntrustedCacheMalloc *untrusted_cache = UntrustedCacheMalloc::Instance(); SgxPar...
PrimitiveStatus TrustedPrimitives::UntrustedCall(uint64_t untrusted_selector, MessageWriter *input, MessageReader *output) { int ret; UntrustedCacheMalloc *untrusted_cache = UntrustedCacheMalloc::Instance(); SgxPar...
{'deleted': [], 'added': [{'line_no': 29, 'char_start': 1137, 'char_end': 1200, 'line': ' if (!TrustedPrimitives::IsOutsideEnclave(sgx_params->output,\n'}, {'line_no': 30, 'char_start': 1200, 'char_end': 1271, 'line': ' sgx_params->output_size)) {\n'}, {'line_no': 31, 'char_st...
{'deleted': [], 'added': [{'char_start': 1143, 'char_end': 1395, 'chars': '!TrustedPrimitives::IsOutsideEnclave(sgx_params->output,\n sgx_params->output_size)) {\n TrustedPrimitives::BestEffortAbort(\n "UntrustedCall: sgx_param output should be in untrusted memory");\...
github.com/google/asylo/commit/83036fd841d33baa7e039f842d131aa7881fdcc2
asylo/platform/primitives/sgx/trusted_sgx.cc
cwe-125
354
false
true
false
cwe-125
_gdContributionsCalc
static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { double width_d; double scale_f_d = 1.0; const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res; if (scale_d ...
static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { double width_d; double scale_f_d = 1.0; const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res; if (scale_d ...
{'deleted': [{'line_no': 28, 'char_start': 847, 'char_end': 882, 'line': '\t\tres->ContribRow[u].Left = iLeft;\n'}, {'line_no': 29, 'char_start': 882, 'char_end': 919, 'line': '\t\tres->ContribRow[u].Right = iRight;\n'}, {'line_no': 30, 'char_start': 919, 'char_end': 920, 'line': '\n'}], 'added': [{'line_no': 37, 'char...
{'deleted': [{'char_start': 849, 'char_end': 922, 'chars': 'res->ContribRow[u].Left = iLeft;\n\t\tres->ContribRow[u].Right = iRight;\n\n\t\t'}], 'added': [{'char_start': 1050, 'char_end': 1123, 'chars': '\n\n\t\tres->ContribRow[u].Left = iLeft;\n\t\tres->ContribRow[u].Right = iRight;'}]}
github.com/libgd/libgd/commit/4f65a3e4eedaffa1efcf9ee1eb08f0b504fbc31a
src/gd_interpolation.c
cwe-125
501
false
false
false
cwe-125
snd_usb_create_streams
static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) { struct usb_device *dev = chip->dev; struct usb_host_interface *host_iface; struct usb_interface_descriptor *altsd; void *control_header; int i, protocol; /* find audiocontrol interface */ host_iface = &usb_ifnum_to_if(dev, ctrlif)->alts...
static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) { struct usb_device *dev = chip->dev; struct usb_host_interface *host_iface; struct usb_interface_descriptor *altsd; void *control_header; int i, protocol; int rest_bytes; /* find audiocontrol interface */ host_iface = &usb_ifnum_to_if(d...
{'deleted': [], 'added': [{'line_no': 8, 'char_start': 235, 'char_end': 252, 'line': '\tint rest_bytes;\n'}, {'line_no': 23, 'char_start': 637, 'char_end': 704, 'line': '\trest_bytes = (void *)(host_iface->extra + host_iface->extralen) -\n'}, {'line_no': 24, 'char_start': 704, 'char_end': 722, 'line': '\t\tcontrol_head...
{'deleted': [], 'added': [{'char_start': 235, 'char_end': 252, 'chars': '\tint rest_bytes;\n'}, {'char_start': 638, 'char_end': 872, 'chars': 'rest_bytes = (void *)(host_iface->extra + host_iface->extralen) -\n\t\tcontrol_header;\n\n\t/* just to be sure -- this shouldn\'t hit at all */\n\tif (rest_bytes <= 0) {\n\t\tde...
github.com/torvalds/linux/commit/bfc81a8bc18e3c4ba0cbaa7666ff76be2f998991
sound/usb/card.c
cwe-125
617
false
true
false
cwe-125
dnxhd_decode_header
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...
{'deleted': [{'line_no': 126, 'char_start': 4820, 'char_end': 4855, 'line': ' if (ctx->mb_height > 68 ||\n'}, {'line_no': 127, 'char_start': 4855, 'char_end': 4940, 'line': ' (ctx->mb_height << frame->interlaced_frame) > (ctx->height + 15) >> 4) {\n'}], 'added': [{'line_no': 126, 'char_start': 4820, '...
{'deleted': [{'char_start': 4851, 'char_end': 4936, 'chars': ' ||\n (ctx->mb_height << frame->interlaced_frame) > (ctx->height + 15) >> 4'}, {'char_start': 5098, 'char_end': 5098, 'chars': ''}], 'added': [{'char_start': 4855, 'char_end': 4855, 'chars': ''}, {'char_start': 5045, 'char_end': 5269, 'chars': ';\...
github.com/FFmpeg/FFmpeg/commit/296debd213bd6dce7647cedd34eb64e5b94cdc92
libavcodec/dnxhddec.c
cwe-125
1,954
false
false
false
cwe-125
core_anal_bytes
static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int fmt) { int stacksize = r_config_get_i (core->config, "esil.stack.depth"); bool iotrap = r_config_get_i (core->config, "esil.iotrap"); bool romem = r_config_get_i (core->config, "esil.romem"); bool stats = r_config_get_i (core->config, "...
static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int fmt) { int stacksize = r_config_get_i (core->config, "esil.stack.depth"); bool iotrap = r_config_get_i (core->config, "esil.iotrap"); bool romem = r_config_get_i (core->config, "esil.romem"); bool stats = r_config_get_i (core->config, "...
{'deleted': [{'line_no': 243, 'char_start': 7313, 'char_end': 7345, 'line': '\t\t\tfor (j = 0; j < size; j++) {\n'}, {'line_no': 244, 'char_start': 7345, 'char_end': 7387, 'line': '\t\t\t\tr_cons_printf ("%02x", buf[j + idx]);\n'}, {'line_no': 247, 'char_start': 7414, 'char_end': 7441, 'line': '\t\t\tif (op.val != UT64...
{'deleted': [{'char_start': 7333, 'char_end': 7334, 'chars': 'i'}, {'char_start': 7335, 'char_end': 7336, 'chars': 'e'}, {'char_start': 7372, 'char_end': 7384, 'chars': 'buf[j + idx]'}], 'added': [{'char_start': 7316, 'char_end': 7379, 'chars': 'int minsz = R_MIN (len, size);\n\t\t\tminsz = R_MAX (minsz, 0);\n\t\t\t'},...
github.com/radare/radare2/commit/a1bc65c3db593530775823d6d7506a457ed95267
libr/core/cmd_anal.c
cwe-125
3,495
false
false
false
cwe-125
fiber_switch
fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mrb_bool resume, mrb_bool vmexec) { struct mrb_context *c = fiber_check(mrb, self); struct mrb_context *old_c = mrb->c; mrb_value value; fiber_check_cfunc(mrb, c); if (resume && c->status == MRB_FIBER_TRANSFERRED) { mrb_raise(m...
fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mrb_bool resume, mrb_bool vmexec) { struct mrb_context *c = fiber_check(mrb, self); struct mrb_context *old_c = mrb->c; enum mrb_fiber_state status; mrb_value value; fiber_check_cfunc(mrb, c); status = c->status; if (resume && ...
{'deleted': [{'line_no': 8, 'char_start': 251, 'char_end': 305, 'line': ' if (resume && c->status == MRB_FIBER_TRANSFERRED) {\n'}, {'line_no': 11, 'char_start': 374, 'char_end': 448, 'line': ' if (c->status == MRB_FIBER_RUNNING || c->status == MRB_FIBER_RESUMED) {\n'}, {'line_no': 14, 'char_start': 510, 'char_end': 5...
{'deleted': [{'char_start': 267, 'char_end': 270, 'chars': 'c->'}, {'char_start': 380, 'char_end': 383, 'chars': 'c->'}, {'char_start': 414, 'char_end': 417, 'chars': 'c->'}, {'char_start': 516, 'char_end': 519, 'chars': 'c->'}, {'char_start': 617, 'char_end': 622, 'chars': 'mrb->'}, {'char_start': 757, 'char_end': 760...
github.com/mruby/mruby/commit/778500563a9f7ceba996937dc886bd8cde29b42b
mrbgems/mruby-fiber/src/fiber.c
cwe-125
471
false
true
false
cwe-125
HPHP::exif_process_APP12
static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length) { size_t l1, l2=0; if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2); if (...
static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t length) { size_t l1, l2=0; if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2); if (...
{'deleted': [{'line_no': 8, 'char_start': 339, 'char_end': 393, 'line': ' l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);\n'}], 'added': [{'line_no': 8, 'char_start': 339, 'char_end': 393, 'line': ' l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);\n'}]}
{'deleted': [{'char_start': 388, 'char_end': 389, 'chars': '+'}], 'added': [{'char_start': 388, 'char_end': 389, 'chars': '-'}]}
github.com/facebook/hhvm/commit/f1cd34e63c2a0d9702be3d41462db7bfd0ae7da3
hphp/runtime/ext/gd/ext_gd.cpp
cwe-125
171
false
false
false
cwe-125
license_read_new_or_upgrade_license_packet
BOOL license_read_new_or_upgrade_license_packet(rdpLicense* license, wStream* s) { UINT32 os_major; UINT32 os_minor; UINT32 cbScope, cbCompanyName, cbProductId, cbLicenseInfo; wStream* licenseStream = NULL; BOOL ret = FALSE; BYTE computedMac[16]; LICENSE_BLOB* calBlob; DEBUG_LICENSE("Receiving Server New/Upgra...
BOOL license_read_new_or_upgrade_license_packet(rdpLicense* license, wStream* s) { UINT32 os_major; UINT32 os_minor; UINT32 cbScope, cbCompanyName, cbProductId, cbLicenseInfo; wStream* licenseStream = NULL; BOOL ret = FALSE; BYTE computedMac[16]; LICENSE_BLOB* calBlob; DEBUG_LICENSE("Receiving Server New/Upgra...
{'deleted': [], 'added': [{'line_no': 41, 'char_start': 1054, 'char_end': 1105, 'line': '\tif (Stream_GetRemainingLength(licenseStream) < 8)\n'}, {'line_no': 42, 'char_start': 1105, 'char_end': 1129, 'line': '\t\tgoto out_free_stream;\n'}, {'line_no': 43, 'char_start': 1129, 'char_end': 1130, 'line': '\n'}, {'line_no':...
{'deleted': [{'char_start': 1100, 'char_end': 1100, 'chars': ''}, {'char_start': 2139, 'char_end': 2139, 'chars': ''}], 'added': [{'char_start': 1055, 'char_end': 1131, 'chars': 'if (Stream_GetRemainingLength(licenseStream) < 8)\n\t\tgoto out_free_stream;\n\n\t'}, {'char_start': 1552, 'char_end': 1627, 'chars': '\tif (...
github.com/FreeRDP/FreeRDP/commit/6ade7b4cbfd71c54b3d724e8f2d6ac76a58e879a
libfreerdp/core/license.c
cwe-125
698
false
true
false
cwe-125
HPHP::SimpleParser::TryParse
static bool TryParse(const char* inp, int length, TypedValue* buf, Variant& out, JSONContainerType container_type, bool is_tsimplejson) { SimpleParser parser(inp, length, buf, container_type, is_tsimplejson); bool ok = parser.parseValue(); parser.skipSpace(); ...
static bool TryParse(const char* inp, int length, TypedValue* buf, Variant& out, JSONContainerType container_type, bool is_tsimplejson) { SimpleParser parser(inp, length, buf, container_type, is_tsimplejson); bool ok = parser.parseValue(); if (!ok || (...
{'deleted': [{'line_no': 6, 'char_start': 296, 'char_end': 320, 'line': ' parser.skipSpace();\n'}, {'line_no': 7, 'char_start': 320, 'char_end': 363, 'line': ' if (!ok || parser.p != inp + length) {\n'}], 'added': [{'line_no': 6, 'char_start': 296, 'char_end': 311, 'line': ' if (!ok ||\n'}, {'line_no': 7, 'cha...
{'deleted': [{'char_start': 318, 'char_end': 334, 'chars': ';\n if (!ok ||'}], 'added': [{'char_start': 300, 'char_end': 320, 'chars': 'if (!ok ||\n ('}, {'char_start': 338, 'char_end': 339, 'chars': ','}, {'char_start': 364, 'char_end': 365, 'chars': ')'}]}
github.com/facebook/hhvm/commit/bd586671a3c22eb2f07e55f11b3ce64e1f7961e7
hphp/runtime/ext/json/JSON_parser.cpp
cwe-125
128
false
true
false
cwe-125
ip_cmsg_recv_checksum
static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb, int tlen, int offset) { __wsum csum = skb->csum; if (skb->ip_summed != CHECKSUM_COMPLETE) return; if (offset != 0) csum = csum_sub(csum, csum_partial(skb_transport_header(skb) + tlen, offset, 0)); put_cmsg(msg, SOL...
static void ip_cmsg_recv_checksum(struct msghdr *msg, struct sk_buff *skb, int tlen, int offset) { __wsum csum = skb->csum; if (skb->ip_summed != CHECKSUM_COMPLETE) return; if (offset != 0) { int tend_off = skb_transport_offset(skb) + tlen; csum = csum_sub(csum, skb_checksum(skb, tend_off, offset, 0));...
{'deleted': [{'line_no': 9, 'char_start': 185, 'char_end': 203, 'line': '\tif (offset != 0)\n'}, {'line_no': 10, 'char_start': 203, 'char_end': 227, 'line': '\t\tcsum = csum_sub(csum,\n'}, {'line_no': 11, 'char_start': 227, 'char_end': 278, 'line': '\t\t\t\tcsum_partial(skb_transport_header(skb) + tlen,\n'}, {'line_no'...
{'deleted': [{'char_start': 205, 'char_end': 209, 'chars': 'csum'}, {'char_start': 212, 'char_end': 244, 'chars': 'csum_sub(csum,\n\t\t\t\tcsum_partial('}, {'char_start': 258, 'char_end': 259, 'chars': 'h'}, {'char_start': 260, 'char_end': 264, 'chars': 'ader'}, {'char_start': 276, 'char_end': 277, 'chars': ','}, {'cha...
github.com/torvalds/linux/commit/ca4ef4574f1ee5252e2cd365f8f5d5bafd048f32
net/ipv4/ip_sockglue.c
cwe-125
114
false
true
false