text
stringlengths
79
3.72M
<vulnerable_code>#define mark_as_not_fast_regexp() \ ((RE_AST*) yyget_extra(yyscanner))->flags &= ~RE_FLAGS_FAST_REGEXP #define ERROR_IF(x, error) \ if (x) \ { \ } \ #line 111 "hex_grammar.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus union YYSTYPE { #...
<vulnerable_code> break; case ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS: /* fall through */ case ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS_OLD: ND_PRINT((ndo, "%sBandwidth Constraints Model ID: %s (%u)", ident, tok2str(diffserv_te_bc_values, "unkn...
<vulnerable_code>{ struct bfhead *b, *bn; b = BFH(((char *) buf) - sizeof(struct bhead)); #ifdef BufStats numrel++; /* Increment number of brel() calls */ #endif assert(buf != NULL); #ifdef BECtl if (b->bh.bsize == 0) { /* Directly-acquired buffer? */<commit_title>[PATCH 01/22] travi...
<vulnerable_code> errx(-1, "\"%s\" is a block device and is not a valid Tcpreplay device", device); break; break; case S_IFDIR: errx(-1, "\"%s\" is a directory and is not a valid Tcpreplay device", ...
<vulnerable_code> /* look for format of 1234/tcp */ if ((regexec(&preg, service_line, nmatch, pmatch, 0)) == 0) { /* matches */ uint16_t portc; if (nmatch < 2) { err(-1, "WTF? I matched the line, but I don't know where!"); } /* strip out ...
<vulnerable_code> /* This is to get rid of the warning */ args = NULL; if(args == NULL) header = NULL; if(header == NULL) args = NULL; /* Extract and examine recieved packet headers */ etherhdr = (ether_hdr*)(packet);<commit_title>[PATCH 01/22] travis-ci: add autogen package<commit_description...
<vulnerable_code> /* * We should read the pcap file, and cache the results */ pktdata = (u_char *)pcap_next(pcap, pkthdr); if (pktdata != NULL) { if (*prev_packet == NULL) { /* /* * Read pcap file as normal...
<vulnerable_code> } /*Before sending any packet, setup the schedule with the proper parameters*/ while((packet = pcap_next(local_handle,&header))) { pkt_counter++; /*increment number of packets seen*/ memcpy(&sched[i].pkthdr, &header, sizeof(struct pcap_pkthdr)); } /*Modify each pa...
<vulnerable_code> assert(pcap); while ((pktdata = pcap_next(pcap, &pkthdr)) != NULL) { packetnum++; dbgx(1, "Packet " COUNTER_SPEC, packetnum);<commit_title>[PATCH 01/22] travis-ci: add autogen package<commit_description><fixed_code> assert(pcap); while ((pktdata = safe_pcap_...
<vulnerable_code> * Keep sending while we have packets or until * we've sent enough packets */ while ((pktconst = pcap_next(pin, pkthdr_ptr)) != NULL) { packetnum++; dbgx(2, "packet " COUNTER_SPEC " caplen %d", packetnum, pkthdr.caplen); <commit_title>[PATCH 01/22] travis-ci: add autog...
<vulnerable_code> return TCPEDIT_ERROR; } /* Make space for our new L2 header */ if (newl2len != ctx->l2len) memmove(packet + newl2len, packet + ctx->l2len, pktlen - ctx->l2len); /* update the total packet length */ pktlen += newl2len - ctx->l2len;<commit_title>[PATCH 01/22] travis-...
<vulnerable_code>/** * get next packet in pcap file */ #define MAX_PCAP_PACKET_LEN (262144) /* this matches Wireshark maximum size */ u_char *_our_safe_pcap_next(pcap_t *pcap, struct pcap_pkthdr *pkthdr, const char *funcname, const int line, const char *file) { u_char *pktdata = (u_char *)pcap_next(pcap,...
<vulnerable_code> if (pktlen < ctx->l2len) { tcpedit_seterr(ctx->tcpedit, "Unable to process packet #" COUNTER_SPEC " since its new length less then %d Layer 2 bytes.", ctx->tcpedit->runtime.packetnum, ctx->l2len); return TCPEDIT_ERROR; } /* Make space for ou...
<vulnerable_code> if (octets[count] > 255) goto error; snprintf(tempoctet, sizeof(octets[count]), "%d", octets[count]); strcat(networkip, tempoctet); /* we don't want a '.' at the end of the last octet */ if (count < 3)<commit_title>[PATCH 01/2...
<vulnerable_code> int fd = -1; nmreq_t nmr; #endif #if defined HAVE_LIBPCAP_NETMAP || defined HAVE_NETMAP u_int32_t netmap_version = -1; #endif #ifndef HAVE_WIN32 strncpy(nmr.nr_name, pcap_if_ptr->name, sizeof(nmr.nr_name)); nmr.nr_version = netmap_version; if (ioctl(fd, ...
<vulnerable_code> assert(ctx); free(ctx->pktq); free(ctx); ctx = NULL; pkt_close(); } <commit_title>[PATCH 01/22] travis-ci: add autogen package<commit_description><fixed_code> assert(ctx); free(ctx->pktq); free(ctx); pkt_close(); }
<vulnerable_code>ip6_opt_open(int argc, char *argv[]) { struct ip6_opt_data *opt; int i, j; if (argc < 4) return (NULL); return (NULL); if (strcasecmp(argv[1], "route") == 0) { opt->type = OPT6_TYPE_ROUTE; if ((opt->u.route.segments = atoi(argv[2])) < 1 || opt->u.route.segments > MAX_ADDRS) { warn...
<vulnerable_code> if ((data = calloc(1, sizeof(*data))) == NULL) return (NULL); if (sscanf(argv[1], "%x", &data->ip6_tc) != 1 || data->ip6_tc < 0 || data->ip6_tc > 255) return (ip6_qos_close(data)); if (sscanf(argv[2], "%x", &data->ip6_fl) != 1 || data->ip6_fl < 0 || data->ip6_fl > 0x100000) return (ip6...
<vulnerable_code>u_char * ieee80211_get_src(const void *header) { ieee80211_hdr_t *addr3; ieee80211_addr4_hdr_t *addr4; uint16_t *frame_control, fc; assert(header); fc = ntohs(*frame_control); if (ieee80211_USE_4(fc)) { addr4 = (ieee80211_addr4_hdr_t *)header; return addr4->add...
<vulnerable_code>{ tcpedit_portmap_t *portmap = NULL, *portmap_head = NULL, *portmap_last = NULL; char *from_s, *to_s, *from_begin, *from_end, *badchar; long from_l, to_l, from_b, from_e, i; char *token = NULL, *token2 = NULL; assert(ports); if (strchr(from_s, '-')) { from_begin = strto...
<vulnerable_code>tcpprep_set_regex(tcpprep_t *ctx, char *value) { int regex_error; char ebuf[EBUF_SIZE]; assert(ctx); if ((regex_error = regcomp(&ctx->options->preg, value, REG_EXTENDED|REG_NOSUB))) { regerror(regex_error, &ctx->options->preg, ebuf, EBUF_SIZE); tcpp...
<vulnerable_code>{ int i, optct = 0; int rcode; char buf[1024]; fflush(NULL); } if (ctx->stats.bytes_sent > 0) { packet_stats(&ctx->stats); if (ctx->options->flow_stats) flow_stats(ctx);<commit_title>[PATCH 01/22] travis-ci: add autogen package<commit_description><...
<vulnerable_code>tcpr_dir_t check_ip_tree(const int mode, const unsigned long ip) { tcpr_tree_t *node = NULL, *finder = NULL; finder = new_tree(); finder->family = AF_INET; int tree_comp(tcpr_tree_t *t1, tcpr_tree_t *t2) { int ret; if (t1->family > t2->family) { dbgx(2, "family %d > %d", t1...
<vulnerable_code> return TCPEDIT_ERROR; } /* Make space for our new L2 header */ if (newl2len != ctx->l2len) memmove(packet + newl2len, packet + ctx->l2len, pktlen - ctx->l2len); /* update the total packet length */ pktlen += newl2len - ctx->l2len;<commit_title>[PATCH 01/22] travis-...
<vulnerable_code> /* look for include or exclude CIDR match */ if (livedata->options->xX.cidr != NULL) { if (!process_xX_by_cidr_ipv4(livedata->options->xX.mode, livedata->options->xX.cidr, ip_hdr)) { dbg(2, "Skipping IPv4 packet due to CIDR match"); return (1...
<vulnerable_code> const u_char *pktdata, const int datalink, const int expiry) { uint16_t ether_type = 0; vlan_hdr_t *vlan_hdr; ipv4_hdr_t *ip_hdr = NULL; ipv6_hdr_t *ip6_hdr = NULL; tcp_hdr_t *tcp_hdr; if ((pktdata[3] & 0x80) == 0x80) { l2_len = ntohs(*((uint16_t*)&pktdat...
<vulnerable_code> plugin = tcpedit->dlt_ctx->encoder; l2len = plugin->plugin_l2len(ctx, packet, caplen); l2proto = ntohs(ctx->proto); if (caplen < l2len) goto done; /* switch (l2proto) { case (ETHERTYPE_IP): { l4data = get_layer4_v4((ipv4_hdr_t*)l3data, caplen); i...
<vulnerable_code> assert(ctx); assert(packet); /* FIXME: Is there anything else we need to do?? */ l2len = dlt_hdlc_l2len(ctx, packet, pktlen); if (pktlen < l2len) return NULL; return tcpedit_dlt_l3data_copy(ctx, packet, pktlen, l2len); assert(packet); assert(l3data); ...
<vulnerable_code> assert(packet); l2len = dlt_ieee80211_l2len(ctx, packet, pktlen); if (pktlen < l2len) return TCPEDIT_ERROR; dbgx(3, "Decoding 802.11 packet " COUNTER_SPEC, ctx->tcpedit->runtime.packetnum); assert(packet); l2len = dlt_ieee80211_l2len(ctx, packet, pktlen); if (pkt...
<vulnerable_code> assert(packet); l2len = dlt_linuxsll_l2len(ctx, packet, pktlen); if (pktlen < l2len) return NULL; return tcpedit_dlt_l3data_copy(ctx, packet, pktlen, l2len); assert(l3data); l2len = dlt_linuxsll_l2len(ctx, packet, pktlen); if (pktlen < l2len) return NULL...
<vulnerable_code> /* FIXME: Is there anything else we need to do?? */ l2len = dlt_pppserial_l2len(ctx, packet, pktlen); if (pktlen < l2len) return NULL; return tcpedit_dlt_l3data_copy(ctx, packet, pktlen, l2len); /* FIXME: Is there anything else we need to do?? */ l2len = dlt_ppps...
<vulnerable_code> assert(packet); if (pktlen < 4) return 0; memcpy(&radiolen, &packet[2], 2); /* little endian to host */ int dlt_radiotap_80211_l2len(tcpeditdlt_t *ctx, const u_char *packet, const int pktlen) { int radiolen; u_char *data; radiolen = dlt_radiotap_l2len(ctx, pac...
<vulnerable_code> /* FIXME: Is there anything else we need to do?? */ l2len = dlt_user_l2len(ctx, packet, pktlen); if (l2len < 0 || pktlen < l2len) return NULL; return tcpedit_dlt_l3data_copy(ctx, packet, pktlen, l2len); /* FIXME: Is there anything else we need to do?? */ l2len = d...
<vulnerable_code>{ tcpedit_portmap_t *portmap = NULL, *portmap_head = NULL, *portmap_last = NULL; char *from_s, *to_s, *from_begin, *from_end, *badchar; long from_l, to_l, i; char *token = NULL, *token2 = NULL; assert(ports); /* process a range, setting from_begin & from_end */ if (strchr(...
<vulnerable_code> warnx("Unable to get MAC address: %s", sendpacket_geterr(sp)); err(-1, "Please consult the man page for using the -M option."); } sendpacket_close(sp); memcpy(options.intf1_mac, eth_buff, ETHER_ADDR_LEN); } if (memcmp(options.intf2_mac, "\00\00\0...
<vulnerable_code>void fix_ipv4_length(struct pcap_pkthdr *pkthdr, ipv4_hdr_t *ip_hdr) { if (!ip_hdr->ip_len) ip_hdr->ip_len = pkthdr->len; } void fix_ipv6_length(struct pcap_pkthdr *pkthdr, ipv6_hdr_t *ip6_hdr) { if (!ip6_hdr->ip_len) ip6_hdr->ip_len = pkthdr->len; } static void ipv4_l34_csum_...
<vulnerable_code> return -1; } init_timestamp(&ctx->stats.last_time); init_timestamp(&ctx->stats.last_print); init_timestamp(&ctx->stats.end_time); if (gettimeofday(&ctx->stats.start_time, NULL) < 0) { tcpreplay_seterr(ctx, "gettimeofday() failed: %s", strerror(errno)); ret...
<vulnerable_code>/* $OpenBSD: ca.c,v 1.64 2020/07/15 14:45:15 tobhe Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> if (localkey == NULL) goto sslerr; if (peerkey && !EVP_PKEY_cmp(peerkey, localkey)) { log_debug("%s: public key does not match %s", __func__, file); goto done; }<commit_t...
<vulnerable_code> sock->service_name, sock->service_name_len, &service_name_tlv_length); size += service_name_tlv_length; } miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&miux, 0, &miux_tlv_length); size += miux_tlv_length; rw_tlv = nfc_llcp_build_tlv(LLCP_TLV_...
<vulnerable_code> static int nfc_llcp_build_gb(struct nfc_llcp_local *local) { u8 *gb_cur, *version_tlv, version, version_length; u8 *lto_tlv, lto_length; u8 *wks_tlv, wks_length; u8 *miux_tlv, miux_length; __be16 wks = cpu_to_be16(local->local_wks); u8 gb_len = 0; int ret = 0; version = LLCP_VERSION_11; versi...
<vulnerable_code> /* Get remaining data in buffer as a string */ remaining = tvb_captured_length_remaining(tvb, offset); if (remaining <= 0) { if (data) *data = g_strdup(""); end_offset = tvb_reported_length_remaining(tvb, offset) + 1; } while (offset < end_offset) offset = dissect_spoolss_uint16uni( ...
<vulnerable_code> if (bitmapUpdate->number > bitmapUpdate->count) { UINT16 count; BITMAP_DATA* newdata; count = bitmapUpdate->number * 2; newdata = (BITMAP_DATA*) realloc(bitmapUpdate->rectangles, sizeof(BITMAP_DATA) * count); if (!newdata) goto fail;<commit_title>[PAT...
<vulnerable_code> //needs adjustement if (bytes_from_store) { size += bytes_from_store + hdr_offset; } if ((e == GF_EOS) && !ctx->input_is_au_end) {<commit_title>[PATCH] reframe_mpgvid: add size check (fixes #2651)<commit_description><fixed_code> //needs adjustement if (bytes_from_store) { size += byt...
<vulnerable_code> # Thoroughly verify it. self._update_metadata('root', DEFAULT_ROOT_UPPERLENGTH, version=next_version) # When we run into HTTP 403 /404 error from ALL mirrors, break out of # loop, because the next root metadata file is most likely missing. except tuf.except...
<vulnerable_code> client->si.format.blueMax = rfbClientSwap16IfLE(client->si.format.blueMax); client->si.nameLength = rfbClientSwap32IfLE(client->si.nameLength); /* To guard against integer wrap-around, si.nameLength is cast to 64 bit */ client->desktopName = malloc((uint64_t)client->si.nameLength + 1); if (!...
<vulnerable_code> (void) ResetMagickMemory(colormap_index,(-1),MaxColormapSize* sizeof(*colormap_index)); if (AcquireImageColormap(image,MaxColormapSize) == MagickFalse) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); image->colors=0; ...
<vulnerable_code> ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_ajax_save_mediadesc" ); ame_sack.setVar( "postid", postid ); ame_sack.setVar( "new_mediadesc", ame_mediadesc ); ame_sack.onError = function() { alert('Ajax error on saving media description'); }; var new...
<vulnerable_code> buffer_len = *ret_buffer_len; buffer_offset = 0; if (se->data.server.userdb == NULL) { c_complain( LOG_NOTICE, &complain_no_users, "network plugin: Received signed network packet but can't verify it " "because no user DB has been configured. Will accept it."); ret...
<vulnerable_code> if (Fp == NULL) return HTTP_INTERNAL_SERVER_ERROR; } else { Fp = fopen(filename, "wb"); if (Fp == NULL) return HTTP_UNAUTHORIZED; } parser->position = POS_ENTITY; do {<commit_title>[PATCH] Don't allow unhandled POSTs to write to the filesystem by<commit_description><fixed_code> if (Fp...
<vulnerable_code> done(); }); afterEach(async function (done) { const client = await Parse.CoreManager.getLiveQueryController().getDefaultLiveQueryClient(); client.close();<commit_title>[PATCH] Merge pull request from GHSA-7pr3-p5fm-8r9x<commit_description>* fix: LQ deletes session token * add 4.10.4 ...
<vulnerable_code> } }); describe('issue #4897', () => { it_only_db('mongo')('should be able to login with a legacy user (no ACL)', async () => { // This issue is a side effect of the locked users and legacy users which don't have ACL's<commit_title>[PATCH] Merge pull request from GHSA-7pr3-p5fm-8r9x<c...
<vulnerable_code> deletedParseObject = res.object.toJSON(); deletedParseObject.className = className; } client.pushDelete(requestId, deletedParseObject); }) .catch(error => { originalParseObject = res.original.toJSON();...
<vulnerable_code> struct table *t; int i, col, row; int indent, maxwidth; for (i = 0; i < tbl->ntable; i++) { t = tbl->tables[i].ptr;<commit_title>[PATCH] Prevent infinite recursion with nested table and textarea<commit_description>Bug-Debian: https://github.com/tats/w3m/issues/20<fixed_code> struc...
<vulnerable_code> /** * Registers a {@link ObjectMapper} bean instance. * * @return the object mapper for endpoint. */ @Bean<commit_title>[PATCH] fix sonar issues<commit_description><fixed_code> /** * Registers a {@link ObjectMapper} bean instance. * * @param context *...
<vulnerable_code> // allocate a buffer to read the data UInt8* sBuffer = buffer; if (!useFixed) { sBuffer = new UInt8[len]; } // read the data<commit_title>[PATCH 1/2] #6716 Added try catch around memory allocation<commi...
<vulnerable_code> catch (XIO&) { result = false; } va_end(args); return result; } catch (std::bad_alloc & exception) { // Added try catch due to GHSA-chfm-333q-gfpp LOG((CLOG_ERR "ALLOC: Unable to allocate memory %d bytes", len))...
<vulnerable_code> helper.allowList({ custom(tag, name, value) { if (tag === "span" && name === "style") { return /^(font-size:(xx-small|x-small|small|medium|large|x-large|xx-large|[0-9]{1,3}%)|background-color:#?[a-zA-Z0-9]+|color:#?[a-zA-Z0-9]+|font-family:[\s\S]+)$/.exec( value );...
<vulnerable_code> import posthog from apscheduler.schedulers.background import BackgroundScheduler from flask import Flask, request, send_from_directory from flask_migrate import Migrate from flask_socketio import SocketIO from sqlalchemy_utils import create_database, database_exists @app.route("/", defaults={"path...
<vulnerable_code>import re from typing import List, Optional, Tuple from flask import jsonify from _orchest.internals import config as _config from app.models import Project base_no_ext = base_no_ext[: -(len(group_match) + 3)] while True: new_path = os.path.join( os.path.abspath(os.pa...
<vulnerable_code> import requests import sqlalchemy from flask import current_app, jsonify, request, send_file from flask_restful import Api, Resource from nbconvert import HTMLExporter from sqlalchemy.orm.exc import NoResultFound if step_file_path.startswith("/"): file_path = resolv...
<vulnerable_code> } // Execute the command char *exec_cmd1[4] = { NULL, NULL, NULL, NULL }; const char *arg1[4] = { command_ex, args, user, NULL }; memcpy(exec_cmd1, arg1, sizeof(exec_cmd1)); wfd_t *wfd = wpopenv(command_ex, exec_cmd1, W_BIND_STDERR); if (!wfd) {<commit_title>[PATCH] Repla...
<vulnerable_code> memset(arg1, '\0', COMMANDSIZE_4096); if (action == ADD_COMMAND) { strcpy(arg1, "--add-rich-rule="); } else { strcpy(arg1, "--remove-rich-rule="); } memset(fw_cmd, '\0', COMMANDSIZE_4096); int count = 0; bool flag = true;...
<vulnerable_code> int count = 0; bool flag = true; while (flag) { char *exec_cmd1[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; const char *arg1[8] = { iptables, arg, "INPUT", "-s", srcip, "-j", "DROP", NULL }; memcpy(exec_cmd1, arg1, sizeof(exec_cm...
<vulnerable_code> wpclose(wfd); } char *exec_cmd4[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL }; const char *arg4[7] = { IPFW, "-q", "table", TABLE_ID, (action == ADD_COMMAND) ? "add" : "delete", srcip, NULL }; memcpy(exec_cmd4, arg4, sizeof(exec_cmd4)); // Exec...
<vulnerable_code>#include "active_responses.h" #define RULE_NAME "WAZUH ACTIVE RESPONSE BLOCKED IP" int main (int argc, char **argv) { (void)argc; int action = OS_INVALID; cJSON *input_json = NULL; } } char * sec_srcip = os_shell_escape(srcip); if (action == ADD_COMMAND) { c...
<vulnerable_code>#include "active_responses.h" #define ROUTE "route" int main (int argc, char **argv) { (void)argc; if (!strcmp("Linux", uname_buffer.sysname)) { if (action == ADD_COMMAND) { char *exec_cmd1[5] = { NULL, NULL, NULL, NULL, NULL }; const char *arg1[5] = { ROUTE,...
<vulnerable_code> int main (int argc, char **argv) { (void)argc; char wget_data[OS_MAXSTR]; char *site_url = NULL; char *output_str = NULL; int action = OS_INVALID; // Try with curl bool success_command = false; char *exec_cmd1[9] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL...
<vulnerable_code> i++; } escaped_string[length + 1] = '\0'; return escaped_string; } <commit_title>[PATCH] Replace system with wpopenv and remove unnecessary code from<commit_description><fixed_code> i++; } return escaped_string; }
<vulnerable_code> will_return(__wrap_OS_GetOneContentforElement, node); getActiveResponseInJSON(data->lf, data->ar, extra_args, msg); cJSON * root = cJSON_Parse(msg); cJSON * deviceData = cJSON_GetObjectItem(root,"parameters");<commit_title>[PATCH] Replace system with wpopenv and remove unnecessary co...
<vulnerable_code> } } /* Test for wstr_replace */ void test_wstr_replace_valid(void **state) { const char * search = "$file"; const char * replace = "/var"; const char EXPECTED_OUTPUT[] = "echo /var"; char * subject = NULL; char * ret = NULL; os_strdup("echo $file", subject); ret = wst...
<vulnerable_code> "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?"); } TEST("Test exceptions") { // ending with '%' character test_urldecode("Hello%20World%21%40%", "Hello World!@%");<commit_title>[PATCH] update comments<commit_description><fixed_code> "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?"); } TEST("Test improper e...
<vulnerable_code> const { tx } = await this.forwarder.execute(req); await expectEvent.inTransaction(tx, ERC2771ContextMock, 'Sender', { sender: this.sender }); }); it('returns the original sender when calldata length is less than 20 bytes (address length)', async function () { ...
<vulnerable_code> exit: mutex_unlock(&dev->lock); return ret <= 0 ? ret : -EIO; } static void cp2112_gpio_set(struct gpio_chip *chip, unsigned offset, int value)<commit_title>[PATCH] HID: cp2112: fix gpio-callback error handling<commit_description>In case of a zero-length report, the gpio direction_input callback wo...
<vulnerable_code><commit_title>[PATCH 2/2] Credit to OSS-Fuzz:<commit_description><fixed_code> # -*- coding: utf-8 -*- from system_tests import CaseMeta, path class BrotliUncompressOutOfBoundsWrite(metaclass=CaseMeta): """ Regression test for the bug described in: https://github.com/Exiv2/exiv2/security/a...
<vulnerable_code> "issue_ghsa_583f_w9pm_99r2_poc.jp2", "issue_ghsa_7569_phvm_vwc2_poc.jp2", "issue_ghsa_mxw9_qx4c_6m8v_poc.jp2", "pocIssue283.jpg", "poc_1522.jp2", "xmpsdk.xmp",<commit_title>[PATCH 2/2] Credit to OSS-Fuzz:<commit_description><fixed_code> "issue_ghs...
<vulnerable_code> uncompressedLen *= 2; // DoS protection - can't be bigger than 128k if (uncompressedLen > 131072) { if (++dos > 1) break; uncompressedLen = 131072; }<commit_title>[PATCH 2/2] Credit to OSS-Fuzz:<commit_description><fixed_code> uncompressedLen *= 2...
<vulnerable_code> salsa20_ivsetup(ctx, walk.iv); if (likely(walk.nbytes == nbytes)) { salsa20_encrypt_bytes(ctx, walk.src.virt.addr, walk.dst.virt.addr, nbytes); return blkcipher_walk_done(desc, &walk, 0); } while (walk.nbytes >= 64) { salsa20_encrypt_bytes(ctx, walk.src.virt.addr, walk...
<vulnerable_code>import signal __VERSION__ = '1.2.4' class ConnectionError(Exception):<commit_title>[PATCH] Version fixed, changelog text updated.<commit_description><fixed_code> import signal __VERSION__ = '1.2.5' class ConnectionError(Exception):
<vulnerable_code> var happened_today = moment(f.neu && f.neu.timestamp).format("MMM Do YY") === moment().format("MMM Do YY"); var user_not_ignored = (f.old && ignore.indexOf(f.old.user) === -1) || (f.neu && ignore.indexOf(f.neu.user) === -1); var way_long_enough = (f.old && f.old.line...
<vulnerable_code> } else { final int shiftAmountInt = shiftAmount.toInt(); if (shiftAmountInt >= 256) { frame.pushStackItem(negativeNumber ? ALL_BITS : UInt256.ZERO); } else { // first perform standard shift right.<commit_title>[PATCH] Shift Optimization<commit_description>Reduce s...
<vulnerable_code> final int shiftAmountInt = shiftAmount.toInt(); final Bytes value = leftPad(frame.popStackItem()); if (shiftAmountInt >= 256) { frame.pushStackItem(UInt256.ZERO); } else { frame.pushStackItem(value.shiftLeft(shiftAmountInt));<commit_title>[PATCH] Shift Optimizat...
<vulnerable_code> final int shiftAmountInt = shiftAmount.toInt(); final Bytes value = leftPad(frame.popStackItem()); if (shiftAmountInt >= 256) { frame.pushStackItem(UInt256.ZERO); } else { frame.pushStackItem(value.shiftRight(shiftAmountInt));<commit_title>[PATCH] Shift Optimiza...
<vulnerable_code> } //SQL INJECTION SHALL NOT PASS!!! var username = conn.escape(username); var password = conn.escape(password); var conn = mysql.createConnection({ host : "ec2-52-1-159-248.compute-1.amazonaws.com",<commit_title>[PATCH] Using mysql escape<commit_description><fixed_code> } //SQL ...
<vulnerable_code>from datetime import datetime from os import remove, path from Crypto import Random from Crypto.Hash import SHA256 from Crypto.Cipher import AES from kppy.groups import v1Group from kppy.entries import v1Entry<commit_title>[PATCH] Changed PyCrypto to PyCryptodome<commit_description>This commit remove...
<vulnerable_code> "\t- Every entry has a title for better identification\n" "\t- Expiration dates for entries\n"), packages = ['kppy'], install_requires = ['PyCrypto'], data_files = [('share/doc/kppy', ['README', 'COPYING'])], license = "GPL v3 or later...
<vulnerable_code> printf("Sending SIGTERM to %u\n", pid); kill(pid, SIGTERM); // wait for not more than about 10 seconds int monsec = 10; char *monfile; if (asprintf(&monfile, "/proc/%d/cmdline", pid) == -1) errExit("asprintf"); int killdone = 0; usleep(200000); // give sandbox a little head start while (m...
<vulnerable_code>tr.Processes.Default.StartBefore(server) tr.Processes.Default.StartBefore(Test.Processes.ts) tr.Processes.Default.StartBefore(Test.Processes.ts, ready=When.PortOpen(ts.Variables.ssl_port)) tr.Processes.Default.Command = 'curl -s -D - -v --ipv4 --http1.1 -H " foo: bar" -H "Host: www.example.com" http:/...
<vulnerable_code> uint16_t saltLen = 0; VerifyOrExit((strlen(aPassPhrase) >= OT_COMMISSIONING_PASSPHRASE_MIN_SIZE) && (strlen(aPassPhrase) <= OT_COMMISSIONING_PASSPHRASE_MAX_SIZE), error = OT_ERROR_INVALID_ARGS); memset(salt, 0, sizeof(salt));<commit_title>[PATCH] [...
<vulnerable_code> .append($('<button></button>').attr({'class': 'btn btn-primary space-button font-button'}).text('Editar').click(Option.initUpdate)) .append($('<button></button>').attr({'class': 'btn btn-primary space-button font-button'}).text('Excluir')....
<vulnerable_code><commit_title>[PATCH] diretor<commit_description><fixed_code> /*! @license DOMPurify 2.3.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.10/LICENSE */ !function(e,t){"object"==typeof exports&&"undefined...
<vulnerable_code> set1.retainAll( new HashSet<>( c2 ) ); return set1; } /** * Returns all elements which are contained by {@code collection1} but not * contained by {@code collection2} as an immutable list.<commit_title>[PATCH] Formattting<commit_description><fixed_code> se...
<vulnerable_code> const utils = { generateUUID: function () { /* eslint-disable no-bitwise */ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { const r = Math.random() * 16 | 0; const v = c === 'x' ? r : ((r & 0x3) | 0x8); return v.toString(16); }); /* eslint-enabl...
<vulnerable_code>'use strict'; module.exports = require('../public/src/utils');<commit_title>[PATCH] fix: get rid of math.random in generateUUID<commit_description><fixed_code> 'use strict'; const crypto = require('crypto'); module.exports = require('../public/src/utils'); module.exports.generateUUID = function () ...
<vulnerable_code> length*=image->colorspace == CMYKColorspace ? 4UL : 3UL; pixel_info=AcquireVirtualMemory(length,sizeof(*pixels)); if (pixel_info == (MemoryInfo *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); pixels=(unsigned char...
<vulnerable_code> /* Create hard links for others and avoid redundant metadata setting */ if (*firstlink != fp) { rc = fsmLink((*firstlink)->fpath, fp->fpath); fp->setmeta = 0; } fd = *firstlinkfile; } rc = fsmUnpack(fi, fd, psm, nodigest); /* Last file of hardlink set, ensure metadata gets set *...
<vulnerable_code> .isProductionMode(); String template = getErrorHtml(productionMode); if (template.contains("{{routes}}")) { template = template.replace("{{routes}}", getRoutes(event)); }<commit_title>[PATCH] chore: add a comment which explains the order<commit_descr...
<vulnerable_code> with self.app.test_request_context('/'): captcha.generate() answer = captcha.get_answer() assert not captcha.validate(value="wrong") captcha.generate() answer = captcha.get_answer() assert captcha.validate(value=answer)<com...
<vulnerable_code>import json from shutil import copyfile from uuid import uuid4 # Improve this to check if scholarly is available in a global way, like other pythonic libraries have_scholar = True try: from scholarly import scholarly except ImportError: have_scholar = False pass from babel import Locale ...
<vulnerable_code>from uuid import uuid4 from babel.dates import format_date from flask import Blueprint, request, url_for from flask_babel import get_locale from flask_login import current_user from . import logger return series_index return 0 @jinjia.app_template_filter('uuidfilter') def uuidfilte...
<vulnerable_code> user_session = User_Sessions(flask_session.get('_user_id', ""), flask_session.get('_id', "")) session.add(user_session) session.commit() log.info("Login and store session : " + flask_session.get('_id', "")) else: ...