instruction
stringclasses
1 value
input
stringlengths
56
241k
output
int64
0
1
__index_level_0__
int64
0
175k
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _rpc_ping(slurm_msg_t *msg) { int rc = SLURM_SUCCESS; uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, conf->auth_info); static bool first_msg = true; if (!_slurm_authorized_user(req_uid)) { error("Security violation, ping RPC from uid %d", req_uid); if (first_msg) { error...
0
72,121
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int strToMatch(const char* str ,char *retstr) { char* anchor = NULL; const char* anchor1 = NULL; int result = 0; if( (!str) || str[0] == '\0'){ return result; } else { anchor = retstr; anchor1 = str; while( (*str)!='\0' ){ if( *str == '-' ){ *retstr = '_'; } else ...
0
52,219
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned char *read_chunk(struct mschm_decompressor_p *self, struct mschmd_header *chm, struct mspack_file *fh, unsigned int chunk_num) { struct mspack_system *sys = self->system; unsigned char *buf; /* check arguments - most are already checked by chmd_fast_find */ if (chun...
0
79,155
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ToggleFullscreenToolbar(Browser* browser) { DCHECK(browser); PrefService* prefs = browser->profile()->GetPrefs(); bool show_toolbar = prefs->GetBoolean(prefs::kShowFullscreenToolbar); prefs->SetBoolean(prefs::kShowFullscreenToolbar, !show_toolbar); } Commit Message: mac: Do not let synthetic events...
0
153,551
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void alsoPropagate(struct redisCommand *cmd, int dbid, robj **argv, int argc, int target) { robj **argvcopy; int j; if (server.loading) return; /* No propagation during loading. */ argvcopy = zmalloc(sizeof(robj*)*argc); for (j = 0; j < argc; j++) { argvcopy[j] = a...
0
69,996
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline int flexarray_append(struct flexarray *flex, void *data) { return flexarray_set(flex, flexarray_size(flex), data); } Commit Message: jpeg: Fix another possible buffer overrun Found via the clang libfuzzer CWE ID: CWE-125
0
82,976
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool ion_handle_validate(struct ion_client *client, struct ion_handle *handle) { WARN_ON(!mutex_is_locked(&client->lock)); return idr_find(&client->idr, handle->id) == handle; } Commit Message: staging/android/ion : fix a race condition in the ion driver There is a use-after-free problem in the ...
0
48,556
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: MockDelegate* mock_delegate() { return &delegate_; } Commit Message: Refactors to simplify rename pathway in DownloadFileManager. This is https://chromiumcodereview.appspot.com/10668004 / r144817 (reverted due to CrOS failure) with the completion logic moved to after the auto-opening. The tests that ...
0
106,175
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Referrer RenderViewImpl::GetReferrerFromRequest( WebFrame* frame, const WebURLRequest& request) { return Referrer(blink::WebStringToGURL( request.HttpHeaderField(WebString::FromUTF8("Referer"))), request.GetReferrerPolicy()); } Commit Message: Prevent renderer in...
0
145,121
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void CL_CompleteRcon( char *args, int argNum ) { if( argNum == 2 ) { char *p = Com_SkipTokens( args, 1, " " ); if( p > args ) Field_CompleteCommand( p, qtrue, qtrue ); } } Commit Message: All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s CWE ID: CWE-269
0
95,660
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: g_NPN_GetIntIdentifier(int32_t intid) { if (!thread_check()) { npw_printf("WARNING: NPN_GetIntIdentifier not called from the main thread\n"); return NULL; } D(bugiI("NPN_GetIntIdentifier intid=%d\n", intid)); NPIdentifier ret = cached_NPN_GetIntIdentifier(intid); D(bugiD("NPN_GetIntIdentifier return:...
0
27,039
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static uint16_t full_header_get_msg_type(SpiceDataHeaderOpaque *header) { return ((SpiceDataHeader *)header->data)->type; } Commit Message: CWE ID: CWE-399
0
2,062
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xfs_inode_validate_extsize( struct xfs_mount *mp, uint32_t extsize, uint16_t mode, uint16_t flags) { bool rt_flag; bool hint_flag; bool inherit_flag; uint32_t extsize_bytes; uint32_t blocksize_bytes; rt_flag = (flags & XFS_DIFLAG_REALTIME); hint_flag = (flags & XFS_DIFLAG_EXTSIZE);...
0
79,904
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: uint8_t GLES2Util::StencilBitsPerPixel(int format) { switch (format) { case GL_STENCIL_INDEX8: case GL_DEPTH24_STENCIL8_OES: return 8; default: return 0; } } Commit Message: Validate glClearBuffer*v function |buffer| param on the client side Otherwise we could read out-of-bounds even...
0
153,378
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static MagickBooleanType ReadPSDChannelZip(Image *image,const size_t channels, const ssize_t type,const PSDCompressionType compression, const size_t compact_size,ExceptionInfo *exception) { MagickBooleanType status; register unsigned char *p; size_t count, length, packet_size, ...
0
61,516
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void PartiallyRuntimeEnabledOverloadedVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::ToImpl(info.Holder()); V8StringResource<> string_arg; string_arg = info[0]; if (!string_arg.Prepare()) return; impl->partiallyRuntimeEnabledOverloadedV...
0
134,995
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(Phar, getStub) { size_t len; zend_string *buf; php_stream *fp; php_stream_filter *filter = NULL; phar_entry_info *stub; PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters_none() == FAILURE) { return; } if (phar_obj->archive->is_tar || phar_obj->archive->is_zip) { if (NULL != (stub = zend...
0
11,157
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void StreamTcpSetSessionBypassFlag (TcpSession *ssn) { ssn->flags |= STREAMTCP_FLAG_BYPASS; } Commit Message: stream: support RST getting lost/ignored In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'. However, the target of the RST may not have received it, or may not have accepted it....
0
79,228
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void smp_start_secure_connection_phase1(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { SMP_TRACE_DEBUG("%s", __func__); if (p_cb->selected_association_model == SMP_MODEL_SEC_CONN_JUSTWORKS) { p_cb->sec_level = SMP_SEC_UNAUTHENTICATE; SMP_TRACE_EVENT("p_cb->sec_level =%d (SMP_SEC_UNAUTHENTICATE) ", ...
0
162,794
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void SetPermissionInfo(const PermissionInfoList& permission_info_list, ChosenObjectInfoList chosen_object_info_list) { last_chosen_object_info_.clear(); for (auto& chosen_object_info : chosen_object_info_list) last_chosen_object_info_.push_back(std::move(chosen_object_info...
0
138,044
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ErrorResilienceTestLarge() : EncoderTest(GET_PARAM(0)), psnr_(0.0), nframes_(0), mismatch_psnr_(0.0), mismatch_nframes_(0), encoding_mode_(GET_PARAM(1)) { Reset(); } Commit Message: Merge Conflict Fix CL to lmp-mr1-release for ag/849478 DO NOT MERGE - libvpx: Pull fro...
0
164,416
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static const char *parse_object(cJSON *item,const char *value,const char **ep) { cJSON *child; if (*value!='{') {*ep=value;return 0;} /* not an object! */ item->type=cJSON_Object; value=skip(value+1); if (*value=='}') return value+1; /* empty array. */ item->child=child=cJSON_New_Item(); if (!item->chi...
0
93,734
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) { struct sk_buff_fclones *fclones = container_of(skb, struct sk_buff_fclones, skb1); struct sk_buff *n; if (skb_orphan_frags(skb, gfp_mask)) return NULL; if (skb->fclone == SKB_FCLONE_ORIG && atomic_read(&fclones...
0
67,693
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool PaymentHandlerWebFlowViewController::ShouldShowSecondaryButton() { return false; } Commit Message: [Payment Handler] Don't wait for response from closed payment app. Before this patch, tapping the back button on top of the payment handler window on desktop would not affect the |response_helper_|, which w...
0
151,124
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FrameLoader::LoadInSameDocument( const KURL& url, scoped_refptr<SerializedScriptValue> state_object, FrameLoadType frame_load_type, HistoryItem* history_item, ClientRedirectPolicy client_redirect, Document* initiating_document) { DCHECK(!state_object || frame_load_type == kFrameLoad...
0
125,801
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static TEE_Result tee_svc_obj_generate_key_dsa( struct tee_obj *o, const struct tee_cryp_obj_type_props *type_props, uint32_t key_size) { TEE_Result res; res = crypto_acipher_gen_dsa_key(o->attr, key_size); if (res != TEE_SUCCESS) return res; /* Set bits for all known attributes for this object type */ ...
0
86,896
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void svm_set_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg) { struct vcpu_svm *svm = to_svm(vcpu); struct vmcb_seg *s = svm_seg(vcpu, seg); s->base = var->base; s->limit = var->limit; s->selector = var->selector; if (var->unusable) s->attrib = 0; else { s->attrib = (var...
0
41,917
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool BluetoothSocketListenUsingL2capFunction::CreateParams() { params_ = bluetooth_socket::ListenUsingL2cap::Params::Create(*args_); return params_ != nullptr; } Commit Message: chrome.bluetoothSocket: Fix regression in send() In https://crrev.com/c/997098, params_ was changed to a local variable, but it ne...
0
154,059
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int dpcm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end = buf + buf_size; DPCMContext *s = avctx->priv_data; int out = 0, ret; in...
1
165,241
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_METHOD(Phar, mount) { char *fname, *arch = NULL, *entry = NULL, *path, *actual; int fname_len, arch_len, entry_len, path_len, actual_len; phar_archive_data **pphar; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &actual, &actual_len) == FAILURE) { return; } fname = (cha...
0
4,352
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool AMediaCodecActionCode_isTransient(int32_t actionCode) { return (actionCode == ACTION_CODE_TRANSIENT); } Commit Message: Check for overflow of crypto size Bug: 111603051 Test: CTS Change-Id: Ib5b1802b9b35769a25c16e2b977308cf7a810606 (cherry picked from commit d1fd02761236b35a336434367131f71bef7405c9) CWE ...
0
162,976
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void disable_sched_clock_irqtime(void) { sched_clock_irqtime = 0; } Commit Message: Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as w...
0
22,412
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned int cqspi_calc_rdreg(struct spi_nor *nor, const u8 opcode) { struct cqspi_flash_pdata *f_pdata = nor->priv; u32 rdreg = 0; rdreg |= f_pdata->inst_width << CQSPI_REG_RD_INSTR_TYPE_INSTR_LSB; rdreg |= f_pdata->addr_width << CQSPI_REG_RD_INSTR_TYPE_ADDR_LSB; rdreg |= f_pdata->data_width << CQSP...
0
93,656
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int xfrm_exp_state_notify(struct xfrm_state *x, const struct km_event *c) { struct net *net = xs_net(x); struct sk_buff *skb; skb = nlmsg_new(xfrm_expire_msgsize(), GFP_ATOMIC); if (skb == NULL) return -ENOMEM; if (build_expire(skb, x, c) < 0) { kfree_skb(skb); return -EMSGSIZE; } return xf...
0
59,362
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void nfs4_recover_open_prepare(struct rpc_task *task, void *calldata) { rpc_task_set_priority(task, RPC_PRIORITY_PRIVILEGED); nfs4_open_prepare(task, calldata); } Commit Message: Fix length of buffer copied in __nfs4_get_acl_uncached _copy_from_pages() used to copy data from the temporary buffer to the...
0
20,014
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int find_highest_bits(int *dat) { u32 bits, bitnum; int i; /* loop for all 256 bits */ for (i = 7; i >= 0 ; i--) { bits = dat[i]; if (bits) { bitnum = fls(bits); return i * 32 + bitnum - 1; } } return -1; } Commit Message: KVM: Ensure all vcpus are consistent with in-kernel irqchip se...
0
20,559
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool GetModifiedSinceOnDBThread(StorageType type, base::Time modified_since, QuotaDatabase* database) { DCHECK(database); return database->GetOriginsModifiedSince(type, &origins_, modified_since); } Commit Message: Wipe out QuotaThr...
0
102,187
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void register_sysctl_root(struct ctl_table_root *root) { } Commit Message: sysctl: Drop reference added by grab_header in proc_sys_readdir Fixes CVE-2016-9191, proc_sys_readdir doesn't drop reference added by grab_header when return from !dir_emit_dots path. It can cause any path called unregister_sysctl_table ...
0
48,493
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void CWebServer::SetWebCompressionMode(const _eWebCompressionMode gzmode) { if (m_pWebEm == NULL) return; m_pWebEm->SetWebCompressionMode(gzmode); } Commit Message: Fixed possible SQL Injection Vulnerability (Thanks to Fabio Carretto!) CWE ID: CWE-89
0
91,075
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: png_write_rows(png_structp png_ptr, png_bytepp row, png_uint_32 num_rows) { png_uint_32 i; /* row counter */ png_bytepp rp; /* row pointer */ png_debug(1, "in png_write_rows"); if (png_ptr == NULL) return; /* Loop through the rows */ for (i = 0, rp = row; i < num_rows; i++, rp++) ...
0
131,442
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int process_cpu_clock_get(const clockid_t which_clock, struct timespec *tp) { return posix_cpu_clock_get(PROCESS_CLOCK, tp); } Commit Message: remove div_long_long_rem x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very c...
0
24,689
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int __glXDisp_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) { xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; return DoQueryContext(cl, req->context); } Commit Message: CWE ID: CWE-20
0
14,170
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderWidgetHostViewAura::InsertText(const base::string16& text) { DCHECK_NE(GetTextInputType(), ui::TEXT_INPUT_TYPE_NONE); if (text_input_manager_ && text_input_manager_->GetActiveWidget()) { if (text.length()) text_input_manager_->GetActiveWidget()->ImeCommitText( text, std::vector...
0
132,252
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void V8TestObject::derefObject(void* object) { fromInternalPointer(object)->deref(); } Commit Message: document.location bindings fix BUG=352374 R=jochen@chromium.org Review URL: https://codereview.chromium.org/196343011 git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b202...
0
121,649
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void tcp_rcv_rtt_update(struct tcp_sock *tp, u32 sample, int win_dep) { u32 new_sample = tp->rcv_rtt_est.rtt; long m = sample; if (m == 0) m = 1; if (new_sample != 0) { /* If we sample in larger samples in the non-timestamp * case, we could grossly overestimate the RTT especially * with cha...
0
41,190
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void rfc_send_credit(tRFC_MCB* p_mcb, uint8_t dlci, uint8_t credit) { uint8_t* p_data; uint8_t cr = RFCOMM_CR(p_mcb->is_initiator, true); BT_HDR* p_buf = (BT_HDR*)osi_malloc(RFCOMM_CMD_BUF_SIZE); p_buf->offset = L2CAP_MIN_OFFSET; p_data = (uint8_t*)(p_buf + 1) + p_buf->offset; *p_data++ = RFCOMM_EA | c...
0
162,910
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: xpathDocTest(const char *filename, const char *resul ATTRIBUTE_UNUSED, const char *err ATTRIBUTE_UNUSED, int options) { char pattern[500]; char result[500]; glob_t globbuf; size_t i; int ret = 0, res; xpathDocument = xmlReadFile(filename, NULL, ...
0
59,654
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: _PUBLIC_ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *src) { return strupper_talloc(ctx, src); } Commit Message: CWE ID: CWE-200
0
2,304
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int createSocketChannelNative(JNIEnv *env, jobject object, jint type, jstring name_str, jbyteArray uuidObj, jint channel, jint flag) { const char *service_name = NULL; jbyte *uuid = NULL; int socket_fd; bt_status_t status; i...
0
163,674
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RendererSchedulerImpl::DisableVirtualTimeForTesting() { if (!main_thread_only().use_virtual_time) return; main_thread_only().use_virtual_time = false; if (main_thread_only().virtual_time_stopped) { main_thread_only().virtual_time_stopped = false; VirtualTimeResumed(); } ForceUpdatePol...
0
143,400
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ConnectionChangeHandler(void* object, bool connected) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { LOG(ERROR) << "Not on UI thread"; return; } InputMethodLibraryImpl* input_method_library = static_cast<InputMethodLibraryImpl*>(object); input_metho...
1
170,482
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static bool peer_pmtu_cleaned(struct inet_peer *peer) { unsigned long orig = ACCESS_ONCE(peer->pmtu_expires); return orig && cmpxchg(&peer->pmtu_expires, orig, 0) == orig; } Commit Message: net: Compute protocol sequence numbers and fragment IDs using MD5. Computers have become a lot faster since we ...
0
25,143
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: ssh_packet_is_rekeying(struct ssh *ssh) { return compat20 && (ssh->state->rekeying || (ssh->kex != NULL && ssh->kex->done == 0)); } Commit Message: CWE ID: CWE-476
0
17,980
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static u64 blkg_prfill_rwstat_field(struct seq_file *sf, struct blkg_policy_data *pd, int off) { struct blkg_rwstat rwstat = blkg_rwstat_read((void *)pd->blkg + off); return __blkg_prfill_rwstat(sf, pd, &rwstat); } Commit Message: blkcg: fix double free of new_blkg in blkcg_init_queue If blkg_create ...
0
84,140
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int validatedevicenspace(i_ctx_t * i_ctx_p, ref **space) { int i, code = 0; ref *devicenspace = *space, proc; ref nameref, sref, altspace, namesarray, sname; /* Check enough arguments in the space */ if (r_size(devicenspace) < 4) return_error(gs_error_rangecheck); /* Check ...
0
3,164
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: RList *r_bin_wasm_get_exports (RBinWasmObj *bin) { RBinWasmSection *export = NULL; RList *exports = NULL; if (!bin || !bin->g_sections) { return NULL; } if (bin->g_exports) { return bin->g_exports; } if (!(exports= r_bin_wasm_get_sections_by_id (bin->g_sections, R_BIN_WASM_SECTION_EXPORT))) {...
0
67,079
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { struct net_bridge_port *p; struct net_bridge *br; struct net_device **d = (struct net_device **)(skb->cb); p ...
0
34,709
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void QuitMessageLoop() { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); } Commit Message: Follow-on fixes and naming changes for https://codereview.chromium.org/12086077/ BUG=172573 Review URL: https://codereview.chromium.org/12177018 git-...
0
116,819
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void __net_exit tcp4_proc_exit_net(struct net *net) { tcp_proc_unregister(net, &tcp4_seq_afinfo); } Commit Message: inet: add RCU protection to inet->opt We lack proper synchronization to manipulate inet->opt ip_options Problem is ip_make_skb() calls ip_setup_cork() and ip_setup_cork() possibly makes a...
0
19,002
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ib_uverbs_comp_dev(struct ib_uverbs_device *dev) { complete(&dev->comp); } Commit Message: IB/security: Restrict use of the write() interface The drivers/infiniband stack uses write() as a replacement for bi-directional ioctl(). This is not safe. There are ways to trigger write calls that result i...
0
52,885
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void WebGLRenderingContextBase::EmitGLWarning(const char* function_name, const char* description) { if (synthesized_errors_to_console_) { String message = String("WebGL: ") + String(function_name) + ": " + String(description); PrintGLErrorToConsole(m...
0
142,251
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: logger_create_directory () { int rc; char *file_path; rc = 1; file_path = logger_get_file_path (); if (file_path) { if (!weechat_mkdir_parents (file_path, 0700)) rc = 0; free (file_path); } else rc = 0; return rc; } Commit Message: logger...
0
60,830
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void RenderBlockFlow::handleAfterSideOfBlock(RenderBox* lastChild, LayoutUnit beforeSide, LayoutUnit afterSide, MarginInfo& marginInfo) { marginInfo.setAtAfterSideOfBlock(true); if (lastChild && lastChild->isRenderBlockFlow() && lastChild->isSelfCollapsingBlock()) setLogicalHeight(logicalHeight()...
0
116,369
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void _c2s_hosts_expand(c2s_t c2s) { char *realm; config_elem_t elem; char id[1024]; int i; elem = config_get(c2s->config, "local.id"); if(!elem) { log_write(c2s->log, LOG_NOTICE, "no local.id configured - skipping local domains configuration"); return; } for...
0
63,759
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int nfs4_xdr_enc_renew(struct rpc_rqst *req, __be32 *p, struct nfs_client *clp) { struct xdr_stream xdr; struct compound_hdr hdr = { .nops = 1, }; xdr_init_encode(&xdr, &req->rq_snd_buf, p); encode_compound_hdr(&xdr, &hdr); return encode_renew(&xdr, clp); } Commit Message: NFSv4: Convert the open...
0
23,153
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool SetUpEncryption(NigoriStatus nigori_status, EncryptionStatus encryption_status) { UserShare* share = sync_manager_.GetUserShare(); share->directory->set_initial_sync_ended_for_type(syncable::NIGORI, true); int64 nigori_id = GetIdForDataType(syncable::NIGORI); if (nig...
0
105,205
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(snmpset) { php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_SET, SNMP_VERSION_1); } Commit Message: CWE ID: CWE-416
0
9,518
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: SiteFeatureUsage LocalSiteCharacteristicsDataImpl::UsesAudioInBackground() const { return GetFeatureUsage( site_characteristics_.uses_audio_in_background(), GetSiteCharacteristicsDatabaseParams().audio_usage_observation_window); } Commit Message: Connect the LocalDB to TabManager. Bug: 773382 ...
0
132,066
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void ohci_set_frame_interval(OHCIState *ohci, uint16_t val) { val &= OHCI_FMI_FI; if (val != ohci->fi) { trace_usb_ohci_set_frame_interval(ohci->name, ohci->fi, ohci->fi); } ohci->fi = val; } Commit Message: CWE ID: CWE-835
0
5,939
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void rds_tcp_accept_worker(struct work_struct *work) { struct rds_tcp_net *rtn = container_of(work, struct rds_tcp_net, rds_tcp_accept_w); while (rds_tcp_accept_one(rtn->rds_tcp_listen_sock) == 0) cond_resched(); } Commit Message: net: rds: force to destroy connection if t_soc...
0
90,182
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void HTMLInputElement::setSize(unsigned size, ExceptionState& exception_state) { if (size == 0) { exception_state.ThrowDOMException( kIndexSizeError, "The value provided is 0, which is an invalid size."); } else { SetUnsignedIntegralAttribute(sizeAttr, size ? size : kDefaultSize, ...
0
126,158
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void print_usage(void) { printf("mosquitto version %s\n\n", VERSION); printf("mosquitto is an MQTT v3.1.1 broker.\n\n"); printf("Usage: mosquitto [-c config_file] [-d] [-h] [-p port]\n\n"); printf(" -c : specify the broker config file.\n"); printf(" -d : put the broker into the background after starti...
0
75,609
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void ContentSecurityPolicy::AddPolicyFromHeaderValue( const String& header, ContentSecurityPolicyHeaderType type, ContentSecurityPolicyHeaderSource source) { if (source == kContentSecurityPolicyHeaderSourceMeta && type == kContentSecurityPolicyHeaderTypeReport) { ReportReportOnlyInMeta(hea...
0
152,445
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int __init ecryptfs_init_crypto(void) { mutex_init(&key_tfm_list_mutex); INIT_LIST_HEAD(&key_tfm_list); return 0; } Commit Message: eCryptfs: Remove buggy and unnecessary write in file name decode routine Dmitry Chernenkov used KASAN to discover that eCryptfs writes past the end of the allocated buffer durin...
0
45,426
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: WORD32 ihevcd_delete(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op) { codec_t *ps_dec; ihevcd_cxa_delete_ip_t *ps_ip = (ihevcd_cxa_delete_ip_t *)pv_api_ip; ihevcd_cxa_delete_op_t *ps_op = (ihevcd_cxa_delete_op_t *)pv_api_op; ps_dec = (codec_t *)(ps_codec_obj->pv_codec_handle); UNUSED(ps_ip)...
0
163,305
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *ift) { struct inet6_dev *idev = ifp->idev; struct in6_addr addr, *tmpaddr; unsigned long tmp_prefered_lft, tmp_valid_lft, tmp_tstamp, age; unsigned long regen_advance; int tmp_plen; int ret = 0; u32 addr_flags; unsigned long no...
0
41,867
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_FUNCTION(imagegammacorrect) { zval *IM; gdImagePtr im; int i; double input, output; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) { return; } ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); if (gdImageTrueColor(im)) { int x, y, c; ...
0
15,139
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: double AffineTransform::xScale() const { return sqrt(m_transform[0] * m_transform[0] + m_transform[1] * m_transform[1]); } Commit Message: Avoid using forced layout to trigger paint invalidation for SVG containers Currently, SVG containers in the LayoutObject hierarchy force layout of their children if t...
1
171,669
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: const char *string_of_NPPVariable(int variable) { const char *str; switch (variable) { #define _(VAL) case VAL: str = #VAL; break; _(NPPVpluginNameString); _(NPPVpluginDescriptionString); _(NPPVpluginWindowBool); _(NPPVpluginTransparentBool); _(NPPVjavaClass); _(NPPVpluginWindowSize); _(NPPVpluginTime...
1
165,866
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void killchild(gpointer key, gpointer value, gpointer user_data) { pid_t *pid=value; kill(*pid, SIGTERM); } Commit Message: nbd-server: handle modern-style negotiation in a child process Previously, the modern style negotiation was carried out in the root server (listener) process before forking the actual c...
0
46,575
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: js_Function *jsC_compile(js_State *J, js_Ast *prog) { return newfun(J, NULL, NULL, prog, 1); } Commit Message: CWE ID: CWE-476
0
7,937
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: vldb_reply_print(netdissect_options *ndo, register const u_char *bp, int length, int32_t opcode) { const struct rx_header *rxh; unsigned long i; if (length < (int)sizeof(struct rx_header)) return; rxh = (const struct rx_header *) bp; /* * Print out the afs call we're invoking. The ta...
0
62,285
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int StreamTcpCheckMemcap(uint64_t size) { uint64_t memcapcopy = SC_ATOMIC_GET(stream_config.memcap); if (memcapcopy == 0 || size + SC_ATOMIC_GET(st_memuse) <= memcapcopy) return 1; return 0; } Commit Message: stream: support RST getting lost/ignored In case of a valid RST on a SYN, the state...
0
79,182
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void fz_colorspace_name_colorant(fz_context *ctx, fz_colorspace *cs, int i, const char *name) { if (!cs) return; if (i < 0 || i >= cs->n) fz_throw(ctx, FZ_ERROR_GENERIC, "Attempt to name out of range colorant"); fz_free(ctx, cs->colorant[i]); cs->colorant[i] = NULL; if (name) { cs->colorant[i] = fz_...
0
353
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void AppCacheGroup::RemoveUpdateObserver(UpdateObserver* observer) { observers_.RemoveObserver(observer); queued_observers_.RemoveObserver(observer); } Commit Message: Refcount AppCacheGroup correctly. Bug: 888926 Change-Id: Iab0d82d272e2f24a5e91180d64bc8e2aa8a8238d Reviewed-on: https://chromium-review.goog...
0
145,413
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: PHP_NAMED_FUNCTION(php_if_ftruncate) { zval *fp; long size; php_stream *stream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &fp, &size) == FAILURE) { RETURN_FALSE; } PHP_STREAM_TO_ZVAL(stream, &fp); if (!php_stream_truncate_supported(stream)) { php_error_docref(NULL TSRMLS_CC, E_WARNI...
0
52,181
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: __weak void arch_setup_gd(struct global_data *gd_ptr) { gd = gd_ptr; } Commit Message: Merge branch '2020-01-22-master-imports' - Re-add U8500 platform support - Add bcm968360bg support - Assorted Keymile fixes - Other assorted bugfixes CWE ID: CWE-787
0
89,356
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; int err = 0; BT_DBG("sock %p, sk %p", sock, sk); err = sock_error(sk); if (err) return err; if (msg->msg_flags & MSG_OOB) return -EOPNOTSUPP; /* Check outgoing MTU */...
0
58,974
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int GetNextCookieRequestId() { static int id = 0; if (id == std::numeric_limits<int>::max()) { int i = id; id = 0; return i; } return id++; } Commit Message: CWE ID: CWE-20
0
16,960
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static __net_exit void net_ns_net_exit(struct net *net) { ns_free_inum(&net->ns); } Commit Message: net: Fix double free and memory corruption in get_net_ns_by_id() (I can trivially verify that that idr_remove in cleanup_net happens after the network namespace count has dropped to zero --EWB) Function get_ne...
0
86,287
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Bool PVDecSetReference(VideoDecControls *decCtrl, uint8 *refYUV, uint32 timestamp) { VideoDecData *video = (VideoDecData *) decCtrl->videoDecoderData; Vop *prevVop = video->prevVop; int width = video->width; uint8 *dstPtr, *orgPtr, *dstPtr2, *orgPtr2; int32 size = (int32)width * video->height; /* set new ...
0
162,439
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void invalid_filename(const char *fname) { assert(fname); const char *ptr = fname; if (arg_debug_check_filename) printf("Checking filename %s\n", fname); if (strncmp(ptr, "${HOME}", 7) == 0) ptr = fname + 7; else if (strncmp(ptr, "${PATH}", 7) == 0) ptr = fname + 7; else if (strcmp(fname, "${DOWNL...
0
96,105
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static inline u32 nfsd4_layoutreturn_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) { return (op_encode_hdr_size + 1 /* lrs_stateid */ + op_encode_stateid_maxsz) * sizeof(__be32); } Commit Message: Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Anothe...
0
65,341
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: int BrowserContextIOData::GetMaxCacheSizeHint() const { int max_cache_size_hint = GetSharedData().max_cache_size_hint; static int upper_limit = std::numeric_limits<int>::max() / (1024 * 1024); DCHECK_LE(max_cache_size_hint, upper_limit); return max_cache_size_hint; } Commit Message: CWE ID: CWE-20
0
17,208
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int do_timerfd_gettime(int ufd, struct itimerspec *t) { struct fd f; struct timerfd_ctx *ctx; int ret = timerfd_fget(ufd, &f); if (ret) return ret; ctx = f.file->private_data; spin_lock_irq(&ctx->wqh.lock); if (ctx->expired && ctx->tintv) { ctx->expired = 0; if (isalarm(ctx)) { ctx->ticks...
0
63,906
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: Buffer* GetBuffer(GLuint client_id) { Buffer* buffer = buffer_manager()->GetBuffer(client_id); return buffer; } Commit Message: Framebuffer clear() needs to consider the situation some draw buffers are disabled. This is when we expose DrawBuffers extension. BUG=376951 TEST=the attached test case, w...
0
120,901
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static void intel_pmu_drain_pebs_core(struct pt_regs *iregs) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct debug_store *ds = cpuc->ds; struct perf_event *event = cpuc->events[0]; /* PMC0 only */ struct pebs_record_core *at, *top; int n; if (!x86_pmu.pebs_active) return; at = (st...
0
25,834
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: void FeatureInfo::InitializeForTesting(ContextType context_type) { initialized_ = false; Initialize(context_type, false /* is_passthrough_cmd_decoder */, DisallowedFeatures()); } Commit Message: gpu: Disallow use of IOSurfaces for half-float format with swiftshader. R=kbr@chromium.org Bug: 998...
0
137,062
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: static int gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1, BIGNUM *z1, BIGNUM *x2, BIGNUM *z2, BN_CTX *ctx) { BIGNUM *t3, *t4, *t5; int ret = 0; if (BN_is_zero(z1)) { BN_zero(x2); BN_zero(z2); return 1; } if (BN_is_zero(z2)) { if (!BN_copy(x2, x)) return 0; ...
0
14,568
Analyze the following code, commit message, and CWE ID. Determine whether it has a vulnerability. If it does, return '1'; if it doesn't, return '0'.
Code: bool ChromeContentBrowserClient::IsSafeRedirectTarget( const GURL& url, content::ResourceContext* context) { #if BUILDFLAG(ENABLE_EXTENSIONS) if (url.SchemeIs(extensions::kExtensionScheme)) { ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); const Extension* extension = ...
0
142,713