instruction
stringclasses
1 value
input
stringlengths
90
9.3k
output
stringlengths
16
15.4k
__index_level_0__
int64
165k
175k
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: PreresolveJob::PreresolveJob(PreconnectRequest preconnect_request, PreresolveInfo* info) : url(std::move(preconnect_request.origin)), num_sockets(preconnect_request.num_sockets), allow_credentials(preconnect_request.allow_credentials), network_isolation_key(...
PreresolveJob::PreresolveJob(PreconnectRequest preconnect_request, PreresolveInfo* info) : url(preconnect_request.origin.GetURL()), num_sockets(preconnect_request.num_sockets), allow_credentials(preconnect_request.allow_credentials), network_isolation_key( ...
172,376
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static Image *ReadOTBImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define GetBit(a,i) (((a) >> (i)) & 1L) Image *image; int byte; MagickBooleanType status; register IndexPacket *indexes; register ssize_t x; register PixelPacket *q; ssize_t y; un...
static Image *ReadOTBImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define GetBit(a,i) (((a) >> (i)) & 1L) Image *image; int byte; MagickBooleanType status; register IndexPacket *indexes; register ssize_t x; register PixelPacket *q; ssize_t y; unsigned...
168,587
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void ikev2_parent_inI1outR1_continue(struct pluto_crypto_req_cont *pcrc, struct pluto_crypto_req *r, err_t ugh) { struct ke_continuation *ke = (struct ke_continuation *)pcrc; struct msg_digest *md = ke->md; struct state *const st = md->st; stf_status e; DBG(DBG_CONTROLMORE, DBG...
static void ikev2_parent_inI1outR1_continue(struct pluto_crypto_req_cont *pcrc, struct pluto_crypto_req *r, err_t ugh) { struct ke_continuation *ke = (struct ke_continuation *)pcrc; struct msg_digest *md = ke->md; struct state *const st = md->st; stf_status e; DBG(DBG_CONTROLMORE, DBG_log("...
166,470
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static IMFSample* CreateSampleFromInputBuffer( const media::BitstreamBuffer& bitstream_buffer, base::ProcessHandle renderer_process, DWORD stream_size, DWORD alignment) { HANDLE shared_memory_handle = NULL; RETURN_ON_FAILURE(::DuplicateHandle(renderer_process, ...
static IMFSample* CreateSampleFromInputBuffer( const media::BitstreamBuffer& bitstream_buffer, DWORD stream_size, DWORD alignment) { base::SharedMemory shm(bitstream_buffer.handle(), true); RETURN_ON_FAILURE(shm.Map(bitstream_buffer.size()), "Failed in base::SharedMemory::Map",...
170,939
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: ImageBitmapFactories::ImageBitmapLoader::ImageBitmapLoader( ImageBitmapFactories& factory, base::Optional<IntRect> crop_rect, ScriptState* script_state, const ImageBitmapOptions* options) : loader_( FileReaderLoader::Create(FileReaderLoader::kReadAsArrayBuffer, this)), f...
ImageBitmapFactories::ImageBitmapLoader::ImageBitmapLoader( ImageBitmapFactories& factory, base::Optional<IntRect> crop_rect, ScriptState* script_state, const ImageBitmapOptions* options) : ContextLifecycleObserver(ExecutionContext::From(script_state)), loader_( FileReaderLoade...
173,067
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void MostVisitedSitesBridge::SetMostVisitedURLsObserver( JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& j_observer, jint num_sites) { java_observer_.reset(new JavaObserver(env, j_observer)); most_visited_->SetMostVisitedURLsObserver(java_observer_.get(), num_sit...
void MostVisitedSitesBridge::SetMostVisitedURLsObserver( void MostVisitedSitesBridge::SetObserver( JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& j_observer, jint num_sites) { java_observer_.reset(new JavaObserver(env, j_observer)); most_visited_->SetMostVisitedURLsOb...
172,036
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: vbf_stp_error(struct worker *wrk, struct busyobj *bo) { ssize_t l, ll, o; double now; uint8_t *ptr; struct vsb *synth_body; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo->fetch_objcore, OBJCORE_MAGIC); AN(bo->fetch_objcore->flags & OC_F_BUSY); assert(bo...
vbf_stp_error(struct worker *wrk, struct busyobj *bo) { ssize_t l, ll, o; double now; uint8_t *ptr; struct vsb *synth_body; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo->fetch_objcore, OBJCORE_MAGIC); AN(bo->fetch_objcore->flags & OC_F_BUSY); assert(bo->dire...
168,193
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void GraphicsContext::clipOut(const Path&) { notImplemented(); } Commit Message: Reviewed by Kevin Ollivier. [wx] Fix strokeArc and fillRoundedRect drawing, and add clipPath support. https://bugs.webkit.org/show_bug.cgi?id=60847 git-svn-id: svn://svn.chromium.org/blink/trunk@86502 bbb929c8-8...
void GraphicsContext::clipOut(const Path&) { if (paintingDisabled()) return; notImplemented(); }
170,423
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void WT_InterpolateNoLoop (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame) { EAS_PCM *pOutputBuffer; EAS_I32 phaseInc; EAS_I32 phaseFrac; EAS_I32 acc0; const EAS_SAMPLE *pSamples; EAS_I32 samp1; EAS_I32 samp2; EAS_I32 numSamples; /* initialize some local variables */ numSam...
void WT_InterpolateNoLoop (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame) { EAS_PCM *pOutputBuffer; EAS_I32 phaseInc; EAS_I32 phaseFrac; EAS_I32 acc0; const EAS_SAMPLE *pSamples; EAS_I32 samp1; EAS_I32 samp2; EAS_I32 numSamples; /* initialize some local variables */ numSamples =...
174,603
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: Track::Track( Segment* pSegment, long long element_start, long long element_size) : m_pSegment(pSegment), m_element_start(element_start), m_element_size(element_size), content_encoding_entries_(NULL), content_encoding_entries_end_(NULL) { } Commit Message: libwebm: Pull from upst...
Track::Track( Track::Track(Segment* pSegment, long long element_start, long long element_size) : m_pSegment(pSegment), m_element_start(element_start), m_element_size(element_size), content_encoding_entries_(NULL), content_encoding_entries_end_(NULL) {} Track::~Track() { Info& info = const...
174,445
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: bool PermissionsData::CanRunOnPage(const Extension* extension, const GURL& document_url, const GURL& top_frame_url, int tab_id, int process_id, ...
bool PermissionsData::CanRunOnPage(const Extension* extension, const GURL& document_url, const GURL& top_frame_url, int tab_id, int process_id, c...
171,655
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendingScript, PendingScript::Type pendingScriptType) { bool errorOccurred = false; double loadFinishTime = pendingScript.resource() && pendingScript.resource()->url().protocolIsInHTTPFamily() ? pendingScript.resource()->loadFinish...
void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript& pendingScript, PendingScript::Type pendingScriptType) { bool errorOccurred = false; double loadFinishTime = pendingScript.resource() && pendingScript.resource()->url().protocolIsInHTTPFamily() ? pendingScript.resource()->loadFinishTime()...
171,946
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode) : unit_test_mode_(unit_test_mode) { v8::V8::SetCounterFunction(base::StatsTable::FindLocation); WebKit::initialize(this); WebKit::setLayoutTestMode(true); WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( WebKit::We...
TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode) : unit_test_mode_(unit_test_mode) { v8::V8::SetCounterFunction(base::StatsTable::FindLocation); WebKit::initialize(this); WebKit::setLayoutTestMode(true); WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( WebKit::WebStrin...
171,035
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int force_reconnect) { HTTPContext *s = h->priv_data; URLContext *old_hd = s->hd; int64_t old_off = s->off; uint8_t old_buf[BUFFER_SIZE]; int old_buf_size, ret; AVDictionary *options = NULL; if (whence == ...
static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int force_reconnect) { HTTPContext *s = h->priv_data; URLContext *old_hd = s->hd; uint64_t old_off = s->off; uint8_t old_buf[BUFFER_SIZE]; int old_buf_size, ret; AVDictionary *options = NULL; if (whence == AVSEE...
168,502
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: ClassicScript* ClassicPendingScript::GetSource(const KURL& document_url, bool& error_occurred) const { CheckState(); DCHECK(IsReady()); error_occurred = ErrorOccurred(); if (!is_external_) { ScriptSourceCode source_code( GetElement()->TextFromChi...
ClassicScript* ClassicPendingScript::GetSource(const KURL& document_url, bool& error_occurred) const { CheckState(); DCHECK(IsReady()); error_occurred = ErrorOccurred(); if (!is_external_) { ScriptSourceCode source_code( GetElement()->TextFromChildren(...
172,890
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: kdc_process_s4u2proxy_req(kdc_realm_t *kdc_active_realm, krb5_kdc_req *request, const krb5_enc_tkt_part *t2enc, const krb5_db_entry *server, krb5_const_principal server_princ, krb5_con...
kdc_process_s4u2proxy_req(kdc_realm_t *kdc_active_realm, krb5_kdc_req *request, const krb5_enc_tkt_part *t2enc, const krb5_db_entry *server, krb5_const_principal server_princ, krb5_const_pri...
168,042
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) { test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType); #if defined(OS_WIN) if (command_line->HasSwitch(switches::kAshBrowserTests)) { co...
void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) { test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); command_line->AppendSwitchASCII(switches::kTestType, kBrowserTestType); #if defined(OS_WIN) if (command_line->HasSwitch(switches::kAshBrowserTests)) { command_...
171,152
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void NormalPageArena::promptlyFreeObject(HeapObjectHeader* header) { ASSERT(!getThreadState()->sweepForbidden()); ASSERT(header->checkHeader()); Address address = reinterpret_cast<Address>(header); Address payload = header->payload(); size_t size = header->size(); size_t payloadSize = header->pay...
void NormalPageArena::promptlyFreeObject(HeapObjectHeader* header) { ASSERT(!getThreadState()->sweepForbidden()); header->checkHeader(); Address address = reinterpret_cast<Address>(header); Address payload = header->payload(); size_t size = header->size(); size_t payloadSize = header->payloadSize(); ...
172,714
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen) { struct sock *sk = sock->sk; struct sco_options opts; struct sco_conninfo cinfo; int len, err = 0; BT_DBG("sk %p", sk); if (get_user(len, optlen)) return -EFAULT; lock_sock(sk); switch (opt...
static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen) { struct sock *sk = sock->sk; struct sco_options opts; struct sco_conninfo cinfo; int len, err = 0; BT_DBG("sk %p", sk); if (get_user(len, optlen)) return -EFAULT; lock_sock(sk); switch (optname) ...
165,898
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: WebString WebPageSerializer::generateMarkOfTheWebDeclaration(const WebURL& url) { return String::format("\n<!-- saved from url=(%04d)%s -->\n", static_cast<int>(url.spec().length()), url.spec().data()); } Commit Message: Escape "--" in the page URL at pa...
WebString WebPageSerializer::generateMarkOfTheWebDeclaration(const WebURL& url) { StringBuilder builder; builder.append("\n<!-- "); builder.append(PageSerializer::markOfTheWebDeclaration(url)); builder.append(" -->\n"); return builder.toString(); }
171,787
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: chpass_principal3_2_svc(chpass3_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name, service_name; OM_uint32 minor_stat; kadm5_server_handle_t ...
chpass_principal3_2_svc(chpass3_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER; gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER; OM_uint32 ...
167,504
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: MockRenderProcess::MockRenderProcess() : transport_dib_next_sequence_number_(0) { } Commit Message: Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-svn-id: svn://svn.chro...
MockRenderProcess::MockRenderProcess() : transport_dib_next_sequence_number_(0), enabled_bindings_(0) { }
171,020
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) { OJPEGState* sp=(OJPEGState*)tif->tif_data; (void)s; if (sp->libjpeg_jpeg_query_style==0) { if (OJPEGDecodeRaw(tif,buf,cc)==0) return(0); } else { if (OJPEGDecodeScanlines(tif,buf,cc)==0) return(0); } return(1); } Commit Message...
OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) { static const char module[]="OJPEGDecode"; OJPEGState* sp=(OJPEGState*)tif->tif_data; (void)s; if( !sp->decoder_ok ) { TIFFErrorExt(tif->tif_clientdata,module,"Cannot decode: decoder not correctly initialized"); ...
168,468
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void mp_encode_lua_table_as_map(lua_State *L, mp_buf *buf, int level) { size_t len = 0; /* First step: count keys into table. No other way to do it with the * Lua API, we need to iterate a first time. Note that an alternative * would be to do a single run, and then hack the buffer to insert t...
void mp_encode_lua_table_as_map(lua_State *L, mp_buf *buf, int level) { size_t len = 0; /* First step: count keys into table. No other way to do it with the * Lua API, we need to iterate a first time. Note that an alternative * would be to do a single run, and then hack the buffer to insert the ...
169,240
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void BluetoothDeviceChromeOS::OnPairError( const ConnectErrorCallback& error_callback, const std::string& error_name, const std::string& error_message) { if (--num_connecting_calls_ == 0) adapter_->NotifyDeviceChanged(this); DCHECK(num_connecting_calls_ >= 0); LOG(WARNING) << object_path_.v...
void BluetoothDeviceChromeOS::OnPairError( const ConnectErrorCallback& error_callback, const std::string& error_name, const std::string& error_message) { if (--num_connecting_calls_ == 0) adapter_->NotifyDeviceChanged(this); DCHECK(num_connecting_calls_ >= 0); LOG(WARNING) << object_path_.value()...
171,228
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev, uint32_t max_frags, bool has_virt_hdr) { struct NetTxPkt *p = g_malloc0(sizeof *p); p->pci_dev = pci_dev; p->vec = g_malloc((sizeof *p->vec) * (max_frags + NET_TX_PKT_PL_START_FRAG)); p->raw = g_malloc((sizeof *p->r...
void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev, uint32_t max_frags, bool has_virt_hdr) { struct NetTxPkt *p = g_malloc0(sizeof *p); p->pci_dev = pci_dev; p->vec = g_new(struct iovec, max_frags + NET_TX_PKT_PL_START_FRAG); p->raw = g_new(struct iovec, max_frags); p->max_...
164,947
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int get_refcount(BlockDriverState *bs, int64_t cluster_index) { BDRVQcowState *s = bs->opaque; int refcount_table_index, block_index; int64_t refcount_block_offset; int ret; uint16_t *refcount_block; uint16_t refcount; refcount_table_index = cluster_index >> (s->cluster_b...
static int get_refcount(BlockDriverState *bs, int64_t cluster_index) { BDRVQcowState *s = bs->opaque; uint64_t refcount_table_index, block_index; int64_t refcount_block_offset; int ret; uint16_t *refcount_block; uint16_t refcount; refcount_table_index = cluster_index >> (s->cluster_bi...
165,405
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){ int nBytes = sizeof(char *)*(2+pTable->nModuleArg); char **azModuleArg; azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes); if( azModuleArg==0 ){ sqlite3DbFree(db, zArg); }else{ int i = pTable->nModuleArg++; ...
static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){ static void addModuleArgument(Parse *pParse, Table *pTable, char *zArg){ sqlite3_int64 nBytes = sizeof(char *)*(2+pTable->nModuleArg); char **azModuleArg; sqlite3 *db = pParse->db; if( pTable->nModuleArg+3>=db->aLimit[SQLITE_LIMIT_COLUMN] )...
173,014
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void PresentationConnectionProxy::DidChangeState( content::PresentationConnectionState state) { if (state == content::PRESENTATION_CONNECTION_STATE_CONNECTED) { source_connection_->didChangeState( blink::WebPresentationConnectionState::Connected); } else if (state == content::PRESENTATION_C...
void PresentationConnectionProxy::DidChangeState( content::PresentationConnectionState state) { if (state == content::PRESENTATION_CONNECTION_STATE_CONNECTED) { source_connection_->didChangeState( blink::WebPresentationConnectionState::Connected); } else if (state == content::PRESENTATION_CONNECT...
172,044
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst) { struct xdr_buf *sndbuf = &rqst->rq_snd_buf; struct svc_rdma_op_ctxt *ctxt; struct svc_rdma_req_map *vec; struct ib_send_wr send_wr; int ret; vec = svc_rdma_get_req_map(rdma); ret = svc_rdma_map_xdr(rdma, sndbu...
static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst) { struct svc_rdma_op_ctxt *ctxt; int ret; ctxt = svc_rdma_get_context(rdma); /* rpcrdma_bc_send_request builds the transport header and * the backchannel RPC message in the same buffer. Thus only * one SGE is needed...
168,157
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void Document::open(Document* entered_document, ExceptionState& exception_state) { if (ImportLoader()) { exception_state.ThrowDOMException( kInvalidStateError, "Imported document doesn't support open()."); return; } if (!IsHTMLDocument()) { exception_state.ThrowDOMEx...
void Document::open(Document* entered_document, ExceptionState& exception_state) { if (ImportLoader()) { exception_state.ThrowDOMException( kInvalidStateError, "Imported document doesn't support open()."); return; } if (!IsHTMLDocument()) { exception_state.ThrowDOMExceptio...
172,691
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: int write_output(void) { int fd; struct filter_op *fop; struct filter_header fh; size_t ninst, i; u_char *data; /* conver the tree to an array of filter_op */ ninst = compile_tree(&fop); if (fop == NULL) return -E_NOTHANDLED; /* create the file */ fd = open(EF_GBL_OPTIO...
int write_output(void) { int fd; struct filter_op *fop; struct filter_header fh; size_t ninst, i; u_char *data; /* conver the tree to an array of filter_op */ ninst = compile_tree(&fop); if (fop == NULL) return -E_NOTHANDLED; if (ninst == 0) return -E_INVALID; /* create...
168,338
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: BlockEntry::Kind SimpleBlock::GetKind() const { return kBlockSimple; } Commit Message: libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b5510269852ae The d...
BlockEntry::Kind SimpleBlock::GetKind() const
174,332
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: std::set<std::string> GetDistinctHosts(const URLPatternSet& host_patterns, bool include_rcd, bool exclude_file_scheme) { typedef base::StringPairs HostVector; HostVector hosts_best_rcd; for (const URLPattern& pattern : host_patter...
std::set<std::string> GetDistinctHosts(const URLPatternSet& host_patterns, bool include_rcd, bool exclude_file_scheme) { typedef base::StringPairs HostVector; HostVector hosts_best_rcd; for (const URLPattern& pattern : host_patterns) { ...
172,961
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: ProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; register int rc; TRACE; if (stuff->screen >= pseudoramiXNumScreens) return BadMatch; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); ...
ProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; register int rc; TRACE; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); if (stuff->screen >= pseudoramiXNumScreens) return BadMatch; rc...
165,437
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: int yr_object_copy( YR_OBJECT* object, YR_OBJECT** object_copy) { YR_OBJECT* copy; YR_OBJECT* o; YR_STRUCTURE_MEMBER* structure_member; YR_OBJECT_FUNCTION* func; YR_OBJECT_FUNCTION* func_copy; int i; *object_copy = NULL; FAIL_ON_ERROR(yr_object_create( object->type, object-...
int yr_object_copy( YR_OBJECT* object, YR_OBJECT** object_copy) { YR_OBJECT* copy; YR_OBJECT* o; YR_STRUCTURE_MEMBER* structure_member; YR_OBJECT_FUNCTION* func; YR_OBJECT_FUNCTION* func_copy; int i; *object_copy = NULL; FAIL_ON_ERROR(yr_object_create( object->type, object->ident...
168,187
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: CMD_FUNC(m_authenticate) { aClient *agent_p = NULL; /* Failing to use CAP REQ for sasl is a protocol violation. */ if (!SASL_SERVER || !MyConnect(sptr) || BadPtr(parv[1]) || !CHECKPROTO(sptr, PROTO_SASL)) return 0; if (sptr->local->sasl_complete) { sendto_one(sptr, err_str(ERR_SASLALREADY), me.name, Ba...
CMD_FUNC(m_authenticate) { aClient *agent_p = NULL; /* Failing to use CAP REQ for sasl is a protocol violation. */ if (!SASL_SERVER || !MyConnect(sptr) || BadPtr(parv[1]) || !CHECKPROTO(sptr, PROTO_SASL)) return 0; if (sptr->local->sasl_complete) { sendto_one(sptr, err_str(ERR_SASLALREADY), me.name, BadPtr(s...
168,814
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int skt_write(int fd, const void *p, size_t len) { int sent; struct pollfd pfd; FNLOG(); pfd.fd = fd; pfd.events = POLLOUT; /* poll for 500 ms */ /* send time out */ if (poll(&pfd, 1, 500) == 0) return 0; ts_log("skt_write", len, NULL); if ((sent = se...
static int skt_write(int fd, const void *p, size_t len) { int sent; struct pollfd pfd; FNLOG(); pfd.fd = fd; pfd.events = POLLOUT; /* poll for 500 ms */ /* send time out */ if (TEMP_FAILURE_RETRY(poll(&pfd, 1, 500)) == 0) return 0; ts_log("skt_write", len, NULL); ...
173,429
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int rename_in_ns(int pid, char *oldname, char **newnamep) { int fd = -1, ofd = -1, ret, ifindex = -1; bool grab_newname = false; ofd = lxc_preserve_ns(getpid(), "net"); if (ofd < 0) { fprintf(stderr, "Failed opening network namespace path for '%d'.", getpid()); return -1; } fd = lxc_pr...
static int rename_in_ns(int pid, char *oldname, char **newnamep) { uid_t ruid, suid, euid; int fret = -1; int fd = -1, ifindex = -1, ofd = -1, ret; bool grab_newname = false; ofd = lxc_preserve_ns(getpid(), "net"); if (ofd < 0) { usernic_error("Failed opening network namespace path for '%d'.", getpid());...
168,369
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static inline int mk_vhost_fdt_close(struct session_request *sr) { int id; unsigned int hash; struct vhost_fdt_hash_table *ht = NULL; struct vhost_fdt_hash_chain *hc; if (config->fdt == MK_FALSE) { return close(sr->fd_file); } id = sr->vhost_fdt_id; hash = sr->vhost_fdt...
static inline int mk_vhost_fdt_close(struct session_request *sr) { int id; unsigned int hash; struct vhost_fdt_hash_table *ht = NULL; struct vhost_fdt_hash_chain *hc; if (config->fdt == MK_FALSE) { return close(sr->fd_file); } id = sr->vhost_fdt_id; hash = sr->vhost_fdt_hash;...
166,278
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: MediaMetadataRetriever::MediaMetadataRetriever() { ALOGV("constructor"); const sp<IMediaPlayerService>& service(getService()); if (service == 0) { ALOGE("failed to obtain MediaMetadataRetrieverService"); return; } sp<IMediaMetadataRetriever> retriever(service->createMetadata...
MediaMetadataRetriever::MediaMetadataRetriever() { ALOGV("constructor"); const sp<IMediaPlayerService> service(getService()); if (service == 0) { ALOGE("failed to obtain MediaMetadataRetrieverService"); return; } sp<IMediaMetadataRetriever> retriever(service->createMetadataRetriev...
173,911
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void HostCache::RecordSet(SetOutcome outcome, base::TimeTicks now, const Entry* old_entry, const Entry& new_entry) { CACHE_HISTOGRAM_ENUM("Set", outcome, MAX_SET_OUTCOME); switch (outcome) { case SET_INSERT: case SET_U...
void HostCache::RecordSet(SetOutcome outcome, base::TimeTicks now, const Entry* old_entry, const Entry& new_entry, AddressListDeltaType delta) { CACHE_HISTOGRAM_ENUM("Set", outcome, MAX_SET_OUTCOME); switch ...
172,008
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: bool TabsCaptureVisibleTabFunction::RunImpl() { PrefService* service = profile()->GetPrefs(); if (service->GetBoolean(prefs::kDisableScreenshots)) { error_ = keys::kScreenshotsDisabled; return false; } WebContents* web_contents = NULL; if (!GetTabToCapture(&web_contents)) return false; i...
bool TabsCaptureVisibleTabFunction::RunImpl() { PrefService* service = profile()->GetPrefs(); if (service->GetBoolean(prefs::kDisableScreenshots)) { error_ = keys::kScreenshotsDisabled; return false; } WebContents* web_contents = NULL; if (!GetTabToCapture(&web_contents)) return false; image_f...
171,268
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: chrm_modification_init(chrm_modification *me, png_modifier *pm, PNG_CONST color_encoding *encoding) { CIE_color white = white_point(encoding); /* Original end points: */ me->encoding = encoding; /* Chromaticities (in fixed point): */ me->wx = fix(chromaticity_x(white)); me->wy = fix(chromat...
chrm_modification_init(chrm_modification *me, png_modifier *pm, const color_encoding *encoding) { CIE_color white = white_point(encoding); /* Original end points: */ me->encoding = encoding; /* Chromaticities (in fixed point): */ me->wx = fix(chromaticity_x(white)); me->wy = fix(chromaticity_y(wh...
173,606
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all) { char *str, *hint_charset = NULL; int str_len, hint_charset_len = 0; size_t new_len; long flags = ENT_COMPAT; char *replaced; zend_bool double_encode = 1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!b", &str, &str_len, &f...
static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all) { char *str, *hint_charset = NULL; int str_len, hint_charset_len = 0; size_t new_len; long flags = ENT_COMPAT; char *replaced; zend_bool double_encode = 1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!b", &str, &str_len, &flags, ...
167,175
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void NavigationControllerImpl::RendererDidNavigateToExistingPage( RenderFrameHostImpl* rfh, const FrameHostMsg_DidCommitProvisionalLoad_Params& params, bool is_in_page, bool was_restored, NavigationHandleImpl* handle) { DCHECK(!rfh->GetParent()); NavigationEntryImpl* entry; if (params....
void NavigationControllerImpl::RendererDidNavigateToExistingPage( RenderFrameHostImpl* rfh, const FrameHostMsg_DidCommitProvisionalLoad_Params& params, bool is_in_page, bool was_restored, NavigationHandleImpl* handle) { DCHECK(!rfh->GetParent()); NavigationEntryImpl* entry; if (params.intend...
172,410
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void MediaElementAudioSourceNode::OnCurrentSrcChanged(const KURL& current_src) { GetMediaElementAudioSourceHandler().OnCurrentSrcChanged(current_src); } Commit Message: Redirect should not circumvent same-origin restrictions Check whether we have access to the audio data when the format is set. At this point ...
void MediaElementAudioSourceNode::OnCurrentSrcChanged(const KURL& current_src) {
173,146
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void WebsiteSettings::OnUIClosing() { if (show_info_bar_) WebsiteSettingsInfoBarDelegate::Create(infobar_service_); SSLCertificateDecisionsDidRevoke user_decision = did_revoke_user_ssl_decisions_ ? USER_CERT_DECISIONS_REVOKED : USER_CERT_DECISIONS_NOT_REVOKE...
void WebsiteSettings::OnUIClosing() { if (show_info_bar_ && web_contents_) { InfoBarService* infobar_service = InfoBarService::FromWebContents(web_contents_); if (infobar_service) WebsiteSettingsInfoBarDelegate::Create(infobar_service); } SSLCertificateDecisionsDidRevoke user_decision = ...
171,780
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void InspectorClientImpl::clearBrowserCookies() { if (WebDevToolsAgentImpl* agent = devToolsAgent()) agent->clearBrowserCookies(); } Commit Message: [4/4] Process clearBrowserCahce/cookies commands in browser. BUG=366585 Review URL: https://codereview.chromium.org/251183005 git-svn-id: svn://svn.c...
void InspectorClientImpl::clearBrowserCookies()
171,347
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: ScriptPromise BluetoothRemoteGATTService::getCharacteristicsImpl( ScriptState* scriptState, mojom::blink::WebBluetoothGATTQueryQuantity quantity, const String& characteristicsUUID) { if (!device()->gatt()->connected()) { return ScriptPromise::rejectWithDOMException( scriptState, ...
ScriptPromise BluetoothRemoteGATTService::getCharacteristicsImpl( ScriptState* scriptState, mojom::blink::WebBluetoothGATTQueryQuantity quantity, const String& characteristicsUUID) { if (!device()->gatt()->connected()) { return ScriptPromise::rejectWithDOMException( scriptState, DOMExc...
172,023
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: transform_name(int t) /* The name, if 't' has multiple bits set the name of the lowest set bit is * returned. */ { unsigned int i; t &= -t; /* first set bit */ for (i=0; i<TTABLE_SIZE; ++i) { if ((transform_info[i].transform & t) != 0) return transform_info[i].name; } ...
transform_name(int t) /* The name, if 't' has multiple bits set the name of the lowest set bit is * returned. */ { unsigned int i; t &= -t; /* first set bit */ for (i=0; i<TTABLE_SIZE; ++i) if (transform_info[i].name != NULL) { if ((transform_info[i].transform & t) != 0) retur...
173,590
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg) { const unsigned char *p; int plen; if (alg == NULL) return NULL; if (OBJ_obj2nid(alg->algorithm) != NID_mgf1) return NULL; if (alg->parameter->type != V_ASN1_SEQUENCE) return NULL; p = alg->parameter->value...
static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg) { const unsigned char *p; int plen; if (alg == NULL || alg->parameter == NULL) return NULL; if (OBJ_obj2nid(alg->algorithm) != NID_mgf1) return NULL; if (alg->parameter->type != V_ASN1_SEQUENCE) return NULL; p = a...
164,720
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void usage_exit() { fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile> " "<keyframe-interval> [<error-resilient>]\nSee comments in " "simple_encoder.c for more information.\n", exec_name); exit(EXIT_FAILURE); } Commit Message: Merge Conflict Fix CL...
void usage_exit() { void usage_exit(void) { fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile> " "<keyframe-interval> [<error-resilient>]\nSee comments in " "simple_encoder.c for more information.\n", exec_name); exit(EXIT_FAILURE); }
174,490
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: bool PrintWebViewHelper::CheckForCancel() { bool cancel = false; Send(new PrintHostMsg_CheckForCancel( routing_id(), print_pages_params_->params.preview_ui_addr, print_pages_params_->params.preview_request_id, &cancel)); if (cancel) notify_browser_of_print_failure_ = false; ...
bool PrintWebViewHelper::CheckForCancel() { const PrintMsg_Print_Params& print_params = print_pages_params_->params; bool cancel = false; Send(new PrintHostMsg_CheckForCancel(routing_id(), print_params.preview_ui_id, print_params.prev...
170,856
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int iwch_l2t_send(struct t3cdev *tdev, struct sk_buff *skb, struct l2t_entry *l2e) { int error = 0; struct cxio_rdev *rdev; rdev = (struct cxio_rdev *)tdev->ulp; if (cxio_fatal_error(rdev)) { kfree_skb(skb); return -EIO; } error = l2t_send(tdev, skb, l2e); if (error < 0) kfree_skb(skb); r...
static int iwch_l2t_send(struct t3cdev *tdev, struct sk_buff *skb, struct l2t_entry *l2e) { int error = 0; struct cxio_rdev *rdev; rdev = (struct cxio_rdev *)tdev->ulp; if (cxio_fatal_error(rdev)) { kfree_skb(skb); return -EIO; } error = l2t_send(tdev, skb, l2e); if (error < 0) kfree_skb(skb); return ...
167,496
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void SyncTest::TriggerSetSyncTabs() { ASSERT_TRUE(ServerSupportsErrorTriggering()); std::string path = "chromiumsync/synctabs"; ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Sync Tabs", UTF16ToASCII(browser()->GetSelectedWebContents()->GetTitle())); } Commit M...
void SyncTest::TriggerSetSyncTabs() {
170,790
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void EventBindings::AttachFilteredEvent( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK_EQ(2, args.Length()); CHECK(args[0]->IsString()); CHECK(args[1]->IsObject()); std::string event_name = *v8::String::Utf8Value(args[0]); if (!context()->HasAccessOrThrowError(event_name)) return; ...
void EventBindings::AttachFilteredEvent( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK_EQ(2, args.Length()); CHECK(args[0]->IsString()); CHECK(args[1]->IsObject()); std::string event_name = *v8::String::Utf8Value(args[0]); if (!context()->HasAccessOrThrowError(event_name)) return; std::...
172,060
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { int lastBorder; /* Seek left */ int leftLimit, rightLimit; int i; int restoreAlphaBleding; if (border < 0) { /* Refuse to fill to a non-solid border */ return; } leftLimit = (-1); restoreAlphaBle...
BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { int lastBorder; /* Seek left */ int leftLimit, rightLimit; int i; int restoreAlphaBleding; if (border < 0 || color < 0) { /* Refuse to fill to a non-solid border */ return; } if (!im->trueColor) { if ((co...
170,111
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void RenderFrameObserverNatives::OnDocumentElementCreated( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK(args.Length() == 2); CHECK(args[0]->IsInt32()); CHECK(args[1]->IsFunction()); int frame_id = args[0]->Int32Value(); content::RenderFrame* frame = content::RenderFrame::FromRouting...
void RenderFrameObserverNatives::OnDocumentElementCreated( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK(args.Length() == 2); CHECK(args[0]->IsInt32()); CHECK(args[1]->IsFunction()); int frame_id = args[0]->Int32Value(); content::RenderFrame* frame = content::RenderFrame::FromRoutingID(fra...
172,146
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: image_transform_png_set_tRNS_to_alpha_set(PNG_CONST image_transform *this, transform_display *that, png_structp pp, png_infop pi) { png_set_tRNS_to_alpha(pp); this->next->set(this->next, that, pp, pi); } Commit Message: DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f...
image_transform_png_set_tRNS_to_alpha_set(PNG_CONST image_transform *this, image_transform_png_set_tRNS_to_alpha_set(const image_transform *this, transform_display *that, png_structp pp, png_infop pi) { png_set_tRNS_to_alpha(pp); /* If there was a tRNS chunk that would get expanded and add an alpha * c...
173,656
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: status_t OMXNodeInstance::allocateBufferWithBackup( OMX_U32 portIndex, const sp<IMemory> &params, OMX::buffer_id *buffer, OMX_U32 allottedSize) { Mutex::Autolock autoLock(mLock); if (allottedSize > params->size()) { return BAD_VALUE; } BufferMeta *buffer_meta = new BufferMet...
status_t OMXNodeInstance::allocateBufferWithBackup( OMX_U32 portIndex, const sp<IMemory> &params, OMX::buffer_id *buffer, OMX_U32 allottedSize) { Mutex::Autolock autoLock(mLock); if (allottedSize > params->size()) { return BAD_VALUE; } BufferMeta *buffer_meta = new BufferMeta(para...
173,525
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: UserSelectionScreen::UpdateAndReturnUserListForWebUI() { std::unique_ptr<base::ListValue> users_list = std::make_unique<base::ListValue>(); const AccountId owner = GetOwnerAccountId(); const bool is_signin_to_add = IsSigninToAdd(); users_to_send_ = PrepareUserListForSending(users_, owner, is_signi...
UserSelectionScreen::UpdateAndReturnUserListForWebUI() { std::unique_ptr<base::ListValue> users_list = std::make_unique<base::ListValue>(); const AccountId owner = GetOwnerAccountId(); const bool is_signin_to_add = IsSigninToAdd(); users_to_send_ = PrepareUserListForSending(users_, owner, is_signin_to_a...
172,205
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void i2c_deblock_gpio_cfg(void) { /* set I2C bus 1 deblocking GPIOs input, but 0 value for open drain */ qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SCL1); qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SDA1); qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, 0); qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_S...
static void i2c_deblock_gpio_cfg(void)
169,631
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static const char *skip( const char *in ) { while ( in && *in && (unsigned char) *in <= 32 ) in++; return in; } Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a malformed JSON string was passed on the control channel. This issue, present in the cJSON library, was already f...
static const char *skip( const char *in )
167,312
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: untrusted_launcher_response_callback (GtkDialog *dialog, int response_id, ActivateParametersDesktop *parameters) { GdkScreen *screen; char *uri; GFile *file; switch (response_id) ...
untrusted_launcher_response_callback (GtkDialog *dialog, int response_id, ActivateParametersDesktop *parameters) { GdkScreen *screen; char *uri; GFile *file; switch (response_id) { ...
167,753
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int ps_files_valid_key(const char *key) { size_t len; const char *p; char c; int ret = 1; for (p = key; (c = *p); p++) { /* valid characters are a..z,A..Z,0..9 */ if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <...
static int ps_files_valid_key(const char *key)
164,871
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: handle_mlppp(netdissect_options *ndo, const u_char *p, int length) { if (!ndo->ndo_eflag) ND_PRINT((ndo, "MLPPP, ")); ND_PRINT((ndo, "seq 0x%03x, Flags [%s], length %u", (EXTRACT_16BITS(p))&0x0fff, /* only support 12-Bit sequence space for now */ bittok2st...
handle_mlppp(netdissect_options *ndo, const u_char *p, int length) { if (!ndo->ndo_eflag) ND_PRINT((ndo, "MLPPP, ")); if (length < 2) { ND_PRINT((ndo, "[|mlppp]")); return; } if (!ND_TTEST_16BITS(p)) { ND_PRINT((ndo, "[|mlppp]")); return; } ...
167,844
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: long jpc_bitstream_getbits(jpc_bitstream_t *bitstream, int n) { long v; int u; /* We can reliably get at most 31 bits since ISO/IEC 9899 only guarantees that a long can represent values up to 2^31-1. */ assert(n >= 0 && n < 32); /* Get the number of bits requested from the specified bit stream. */ ...
long jpc_bitstream_getbits(jpc_bitstream_t *bitstream, int n) { long v; int u; /* We can reliably get at most 31 bits since ISO/IEC 9899 only guarantees that a long can represent values up to 2^31-1. */ //assert(n >= 0 && n < 32); if (n < 0 || n >= 32) { return -1; } /* Get the number of bits request...
168,732
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: int main(int argc, char *argv[]) { p_fm_config_conx_hdlt hdl; int instance = 0; fm_mgr_config_errno_t res; char *rem_addr = NULL; char *community = "public"; char Opts[256]; int arg; char *command; int i; /* Get options at the command line (overi...
int main(int argc, char *argv[]) { p_fm_config_conx_hdlt hdl = NULL; int instance = 0; fm_mgr_config_errno_t res; char *rem_addr = NULL; char *community = "public"; char Opts[256]; int arg; char *command; int i; /* Get options at the command line (over...
170,127
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: PanelSettingsMenuModel::PanelSettingsMenuModel(Panel* panel) : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), panel_(panel) { const Extension* extension = panel_->GetExtension(); DCHECK(extension); AddItem(COMMAND_NAME, UTF8ToUTF16(extension->name())); AddSeparator(); AddItem(COM...
PanelSettingsMenuModel::PanelSettingsMenuModel(Panel* panel) : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), panel_(panel) { const Extension* extension = panel_->GetExtension(); DCHECK(extension); AddItem(COMMAND_NAME, UTF8ToUTF16(extension->name())); AddSeparator(); AddItem(COMMAND_C...
170,983
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: LayoutUnit LayoutBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTop, LayoutBox& child, bool atBeforeSideOfBlock) { LayoutBlockFlow* childBlockFlow = child.isLayoutBlockFlow() ? toLayoutBlockFlow(&child) : 0; LayoutUnit newLogicalTop = applyBeforeBreak(child, logicalTop); LayoutUnit logic...
LayoutUnit LayoutBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTop, LayoutBox& child, bool atBeforeSideOfBlock) { LayoutBlockFlow* childBlockFlow = child.isLayoutBlockFlow() ? toLayoutBlockFlow(&child) : 0; LayoutUnit newLogicalTop = applyBeforeBreak(child, logicalTop); LayoutUnit logicalTopB...
171,693
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: ModuleExport size_t RegisterMPCImage(void) { MagickInfo *entry; entry=SetMagickInfo("CACHE"); entry->description=ConstantString("Magick Persistent Cache image format"); entry->module=ConstantString("MPC"); entry->stealth=MagickTrue; (void) RegisterMagickInfo(entry); entry=SetMagickInfo("M...
ModuleExport size_t RegisterMPCImage(void) { MagickInfo *entry; entry=SetMagickInfo("CACHE"); entry->description=ConstantString("Magick Persistent Cache image format"); entry->module=ConstantString("MPC"); entry->seekable_stream=MagickTrue; entry->stealth=MagickTrue; (void) RegisterMagickInfo(en...
168,035
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: client_x11_display_valid(const char *display) { size_t i, dlen; dlen = strlen(display); for (i = 0; i < dlen; i++) { if (!isalnum((u_char)display[i]) && } } Commit Message: CWE ID: CWE-254
client_x11_display_valid(const char *display) { size_t i, dlen; if (display == NULL) return 0; dlen = strlen(display); for (i = 0; i < dlen; i++) { if (!isalnum((u_char)display[i]) && } }
165,351
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void __exit ipgre_fini(void) { rtnl_link_unregister(&ipgre_tap_ops); rtnl_link_unregister(&ipgre_link_ops); unregister_pernet_device(&ipgre_net_ops); if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) printk(KERN_INFO "ipgre close: can't remove protocol\n"); } Commit Message: gre: fix n...
static void __exit ipgre_fini(void) { rtnl_link_unregister(&ipgre_tap_ops); rtnl_link_unregister(&ipgre_link_ops); if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) printk(KERN_INFO "ipgre close: can't remove protocol\n"); unregister_pernet_device(&ipgre_net_ops); }
165,883
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void _moddeinit(module_unload_intent_t intent) { service_named_unbind_command("chanserv", &cs_flags); } Commit Message: chanserv/flags: make Anope FLAGS compatibility an option Previously, ChanServ FLAGS behavior could be modified by registering or dropping the keyword nicks "LIST", "CLEAR", and "MODIFY". ...
void _moddeinit(module_unload_intent_t intent) { service_named_unbind_command("chanserv", &cs_flags); hook_del_nick_can_register(check_registration_keywords); hook_del_user_can_register(check_registration_keywords); del_conf_item("ANOPE_FLAGS_COMPAT", &chansvs.me->conf_table); }
167,585
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: int read_escaped_char( yyscan_t yyscanner, uint8_t* escaped_char) { char text[4] = {0, 0, 0, 0}; text[0] = '\\'; text[1] = RE_YY_INPUT(yyscanner); if (text[1] == EOF) return 0; if (text[1] == 'x') { text[2] = RE_YY_INPUT(yyscanner); if (text[2] == EOF) return 0;...
int read_escaped_char( yyscan_t yyscanner, uint8_t* escaped_char) { char text[4] = {0, 0, 0, 0}; text[0] = '\\'; text[1] = RE_YY_INPUT(yyscanner); if (text[1] == EOF || text[1] == 0) return 0; if (text[1] == 'x') { text[2] = RE_YY_INPUT(yyscanner); if (!isxdigit(text[2])) ...
168,486
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void FormAssociatedElement::formRemovedFromTree(const Node* formRoot) { ASSERT(m_form); if (toHTMLElement(this)->highestAncestor() != formRoot) setForm(0); } Commit Message: Fix a crash when a form control is in a past naems map of a demoted form element. Note that we wanted to add the prote...
void FormAssociatedElement::formRemovedFromTree(const Node* formRoot) { ASSERT(m_form); if (toHTMLElement(this)->highestAncestor() == formRoot) return; RefPtr<HTMLElement> protector(toHTMLElement(this)); setForm(0); }
171,718
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data) { return usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), RTL8150_REQ_GET_REGS, RTL8150_REQT_READ, indx, 0, data, size, 500); } Commit Message: rtl8150: Use heap buffers for all register access Allocating ...
static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data) { void *buf; int ret; buf = kmalloc(size, GFP_NOIO); if (!buf) return -ENOMEM; ret = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), RTL8150_REQ_GET_REGS, RTL8150_REQT_READ, indx, 0, buf, size, 500); if (re...
168,214
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void LogoService::GetLogo(search_provider_logos::LogoObserver* observer) { LogoCallbacks callbacks; callbacks.on_cached_decoded_logo_available = base::BindOnce(ObserverOnLogoAvailable, observer, true); callbacks.on_fresh_decoded_logo_available = base::BindOnce(ObserverOnLogoAvailable, observer, ...
void LogoService::GetLogo(search_provider_logos::LogoObserver* observer) {
171,951
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void WebURLLoaderImpl::Context::OnReceivedResponse( const ResourceResponseInfo& info) { if (!client_) return; WebURLResponse response; response.initialize(); PopulateURLResponse(request_.url(), info, &response); bool show_raw_listing = (GURL(request_.url()).query() == "raw"); if (info.mime_...
void WebURLLoaderImpl::Context::OnReceivedResponse( const ResourceResponseInfo& info) { if (!client_) return; WebURLResponse response; response.initialize(); PopulateURLResponse(request_.url(), info, &response); bool show_raw_listing = (GURL(request_.url()).query() == "raw"); if (info.mime_type =...
171,266
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: FramebufferInfoTest() : manager_(1, 1), feature_info_(new FeatureInfo()), renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples, kDepth24Supported) { texture_manager_.reset(new TextureManager(NULL, ...
FramebufferInfoTest() : manager_(kMaxDrawBuffers, kMaxColorAttachments), feature_info_(new FeatureInfo()), renderbuffer_manager_(NULL, kMaxRenderbufferSize, kMaxSamples, kDepth24Supported) { texture_manager_.reset(new TextureManager(NULL, ...
171,656
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void RenderWidgetHostViewAura::RunCompositingDidCommitCallbacks( ui::Compositor* compositor) { for (std::vector< base::Callback<void(ui::Compositor*)> >::const_iterator it = on_compositing_did_commit_callbacks_.begin(); it != on_compositing_did_commit_callbacks_.end(); ++it) { it->Run(comp...
void RenderWidgetHostViewAura::RunCompositingDidCommitCallbacks( void RenderWidgetHostViewAura::RunCompositingDidCommitCallbacks() { for (std::vector<base::Closure>::const_iterator it = on_compositing_did_commit_callbacks_.begin(); it != on_compositing_did_commit_callbacks_.end(); ++it) { it->Run();...
171,384
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: bool GrabWindowSnapshot(gfx::NativeWindow window, std::vector<unsigned char>* png_representation, const gfx::Rect& snapshot_bounds) { ui::Compositor* compositor = window->layer()->GetCompositor(); gfx::Rect read_pixels_bounds = snapshot_bounds; read_pi...
bool GrabWindowSnapshot(gfx::NativeWindow window, std::vector<unsigned char>* png_representation, const gfx::Rect& snapshot_bounds) { #if defined(OS_LINUX) // We use XGetImage() for Linux/ChromeOS for performance reasons. // See crbug.com/122720 if (window->GetRo...
170,760
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void mntput_no_expire(struct mount *mnt) { rcu_read_lock(); mnt_add_count(mnt, -1); if (likely(mnt->mnt_ns)) { /* shouldn't be the last one */ rcu_read_unlock(); return; } lock_mount_hash(); if (mnt_get_count(mnt)) { rcu_read_unlock(); unlock_mount_hash(); return; } if (unlikely(mnt->mnt....
static void mntput_no_expire(struct mount *mnt) { rcu_read_lock(); mnt_add_count(mnt, -1); if (likely(mnt->mnt_ns)) { /* shouldn't be the last one */ rcu_read_unlock(); return; } lock_mount_hash(); if (mnt_get_count(mnt)) { rcu_read_unlock(); unlock_mount_hash(); return; } if (unlikely(mnt->mnt.mnt_fl...
167,589
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: status_t OMXNodeInstance::sendCommand( OMX_COMMANDTYPE cmd, OMX_S32 param) { if (cmd == OMX_CommandStateSet) { mSailed = true; } const sp<GraphicBufferSource> bufferSource(getGraphicBufferSource()); if (bufferSource != NULL && cmd == OMX_CommandStateSet) { if (param == OMX_Stat...
status_t OMXNodeInstance::sendCommand( OMX_COMMANDTYPE cmd, OMX_S32 param) { if (cmd == OMX_CommandStateSet) { // There are no configurations past first StateSet command. mSailed = true; } const sp<GraphicBufferSource> bufferSource(getGraphicBufferSource()); if (bufferSource !...
173,380
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements, int objprops) { while (elements-- > 0) { zval *key, *data, **old_data; ALLOC_INIT_ZVAL(key); if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { zval_dtor(key); FREE_ZVAL(key); return 0; } if (Z...
static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements, int objprops) { while (elements-- > 0) { zval *key, *data, **old_data; ALLOC_INIT_ZVAL(key); if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { zval_dtor(key); FREE_ZVAL(key); return 0; } if (Z_TYPE_...
164,893
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void _out_result(conn_t out, nad_t nad) { int attr; jid_t from, to; char *rkey; int rkeylen; attr = nad_find_attr(nad, 0, -1, "from", NULL); if(attr < 0 || (from = jid_new(NAD_AVAL(nad, attr), NAD_AVAL_L(nad, attr))) == NULL) { log_debug(ZONE, "missing or invalid from on db...
static void _out_result(conn_t out, nad_t nad) { int attr; jid_t from, to; char *rkey; int rkeylen; attr = nad_find_attr(nad, 0, -1, "from", NULL); if(attr < 0 || (from = jid_new(NAD_AVAL(nad, attr), NAD_AVAL_L(nad, attr))) == NULL) { log_debug(ZONE, "missing or invalid from on db resul...
165,576
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void CompileFromResponseCallback( const v8::FunctionCallbackInfo<v8::Value>& args) { ExceptionState exception_state(args.GetIsolate(), ExceptionState::kExecutionContext, "WebAssembly", "compile"); ExceptionToRejectPromiseScope reject_prom...
void CompileFromResponseCallback( const v8::FunctionCallbackInfo<v8::Value>& args) { ExceptionState exception_state(args.GetIsolate(), ExceptionState::kExecutionContext, "WebAssembly", "compile"); ExceptionToRejectPromiseScope reject_promise_sc...
172,938
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: struct dst_entry *inet6_csk_route_req(const struct sock *sk, struct flowi6 *fl6, const struct request_sock *req, u8 proto) { struct inet_request_sock *ireq = inet_rsk(req); const struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *final_p, final; struct dst_entry *dst; mems...
struct dst_entry *inet6_csk_route_req(const struct sock *sk, struct flowi6 *fl6, const struct request_sock *req, u8 proto) { struct inet_request_sock *ireq = inet_rsk(req); const struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *final_p, final; struct dst_entry *dst; memset(fl6...
167,332
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: ServiceWorkerHandler::ServiceWorkerHandler() : DevToolsDomainHandler(ServiceWorker::Metainfo::domainName), enabled_(false), process_(nullptr), weak_factory_(this) {} Commit Message: DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePar...
ServiceWorkerHandler::ServiceWorkerHandler() : DevToolsDomainHandler(ServiceWorker::Metainfo::domainName), enabled_(false), browser_context_(nullptr), storage_partition_(nullptr), weak_factory_(this) {}
172,768
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size) { size_t i, j; cdf_secid_t maxsector = (cdf_secid_t)(sat->sat_len * size); DPRINTF(("Chain:")); for (j = i = 0; sid >= 0; i++, j++) { DPRINTF((" %d", sid)); if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Counting chain loop limit")); ...
cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size) { size_t i, j; cdf_secid_t maxsector = (cdf_secid_t)((sat->sat_len * size) / sizeof(maxsector)); DPRINTF(("Chain:")); for (j = i = 0; sid >= 0; i++, j++) { DPRINTF((" %d", sid)); if (j >= CDF_LOOP_LIMIT) { DPRINTF(("Counting chai...
166,365
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int __init ipgre_init(void) { int err; printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); if (inet_add_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) { printk(KERN_INFO "ipgre init: can't add protocol\n"); return -EAGAIN; } err = register_pernet_device(&ipgre_net_ops); if (err < 0) goto ...
static int __init ipgre_init(void) { int err; printk(KERN_INFO "GRE over IPv4 tunneling driver\n"); err = register_pernet_device(&ipgre_net_ops); if (err < 0) return err; err = inet_add_protocol(&ipgre_protocol, IPPROTO_GRE); if (err < 0) { printk(KERN_INFO "ipgre init: can't add protocol\n"); goto ...
165,884
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb, struct net_device *dev) { struct net_bridge *br = netdev_priv(dev); struct net_bridge_mdb_htable *mdb; struct nlattr *nest, *nest2; int i, err = 0; int idx = 0, s_idx = cb->args[1]; if (br->multicast_disabled) return 0; ...
static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb, struct net_device *dev) { struct net_bridge *br = netdev_priv(dev); struct net_bridge_mdb_htable *mdb; struct nlattr *nest, *nest2; int i, err = 0; int idx = 0, s_idx = cb->args[1]; if (br->multicast_disabled) return 0; mdb ...
166,053
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void ClipboardMessageFilter::OnWriteObjectsSync( const ui::Clipboard::ObjectMap& objects, base::SharedMemoryHandle bitmap_handle) { DCHECK(base::SharedMemory::IsHandleValid(bitmap_handle)) << "Bad bitmap handle"; scoped_ptr<ui::Clipboard::ObjectMap> long_living_objects( new ui::Clipboar...
void ClipboardMessageFilter::OnWriteObjectsSync( const ui::Clipboard::ObjectMap& objects, base::SharedMemoryHandle bitmap_handle) { DCHECK(base::SharedMemory::IsHandleValid(bitmap_handle)) << "Bad bitmap handle"; scoped_ptr<ui::Clipboard::ObjectMap> long_living_objects( new ui::Clipboard::Obj...
171,692
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: void DownloadController::CreateGETDownload( const content::ResourceRequestInfo::WebContentsGetter& wc_getter, bool must_download, const DownloadInfo& info) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&DownloadController::S...
void DownloadController::CreateGETDownload(
171,881
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output, char* timezone_out, size_t timezone_out_len) { base::Pickle request; request.WriteInt(LinuxSandbox::METHOD_LOCALTIME); request.WriteString( std::st...
static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output, char* timezone_out, size_t timezone_out_len) { base::Pickle request; request.WriteInt(LinuxSandbox::METHOD_LOCALTIME); request.WriteString( std::string(r...
172,926
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: tt_cmap8_validate( FT_Byte* table, FT_Validator valid ) { FT_Byte* p = table + 4; FT_Byte* is32; FT_UInt32 length; FT_UInt32 num_groups; if ( table + 16 + 8192 > valid->limit ) FT_INVALID_TOO_SHORT; length = TT_NEXT_ULONG( p ); if ( tabl...
tt_cmap8_validate( FT_Byte* table, FT_Validator valid ) { FT_Byte* p = table + 4; FT_Byte* is32; FT_UInt32 length; FT_UInt32 num_groups; if ( table + 16 + 8192 > valid->limit ) FT_INVALID_TOO_SHORT; length = TT_NEXT_ULONG( p ); if ( length > (...
164,741
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type) { int name_index; void *value = NULL; size_t size = 0; int error; switch(type) { case ACL_TYPE_ACCESS: name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; if (acl) { error = posix_acl_equiv_mode(acl, &inode->i_mode); if (error...
ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type) { int name_index; void *value = NULL; size_t size = 0; int error; switch(type) { case ACL_TYPE_ACCESS: name_index = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS; if (acl) { error = posix_acl_update_mode(inode, &inode->i_mode, &acl); if (er...
166,969
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: static ext4_io_end_t *ext4_init_io_end (struct inode *inode) { ext4_io_end_t *io = NULL; io = kmalloc(sizeof(*io), GFP_NOFS); if (io) { igrab(inode); io->inode = inode; io->flag = 0; io->offset = 0; io->size = 0; io->error = 0; INIT_WORK(&io->work, ext4_end_io_work); INIT_LIST_HEA...
static ext4_io_end_t *ext4_init_io_end (struct inode *inode) static ext4_io_end_t *ext4_init_io_end (struct inode *inode, gfp_t flags) { ext4_io_end_t *io = NULL; io = kmalloc(sizeof(*io), flags); if (io) { igrab(inode); io->inode = inode; io->flag = 0; io->offset = 0; io->size = 0; io->page ...
167,546
Analyze the following vulnerable code snippet, the commit message, and the CWE ID. Determine the impact category of this vulnerability. Respond with the corrected function only. Remember, I want response with just the fixed code only, No explanation.
Code: bool BrokerDuplicateHandle(HANDLE source_handle, DWORD target_process_id, HANDLE* target_handle, DWORD desired_access, DWORD options) { if (!g_target_services) { base::win::ScopedHandle target_proc...
bool BrokerDuplicateHandle(HANDLE source_handle, DWORD target_process_id, HANDLE* target_handle, DWORD desired_access, DWORD options) { // If our process is the target just duplicate the handle. if (::GetC...
170,946