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: xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) {
xmlXPathParserContextPtr ctxt;
xmlXPathObjectPtr res = NULL, tmp;
xmlXPathObjectPtr init = NULL;
int stack = 0;
xmlXPathInit();
if ((ctx == NULL) || (str == NULL))
return(NULL);
ctxt = xmlXPathNewParserContext(str, ctx);
... | 0 | 109,046 |
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 hugetlb_report_node_meminfo(int nid, char *buf)
{
struct hstate *h = &default_hstate;
return sprintf(buf,
"Node %d HugePages_Total: %5u\n"
"Node %d HugePages_Free: %5u\n"
"Node %d HugePages_Surp: %5u\n",
nid, h->nr_huge_pages_node[nid],
nid, h->free_huge_pages_node[nid],
nid, h->surplus_huge_p... | 0 | 19,711 |
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: ExtensionFunction::ResponseAction WindowsGetAllFunction::Run() {
std::unique_ptr<windows::GetAll::Params> params(
windows::GetAll::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
ApiParameterExtractor<windows::GetAll::Params> extractor(params.get());
std::unique_ptr<base::ListVa... | 0 | 151,512 |
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 rfcomm_tty_write_room(struct tty_struct *tty)
{
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
int room;
BT_DBG("tty %p", tty);
if (!dev || !dev->dlc)
return 0;
room = rfcomm_room(dev->dlc) - atomic_read(&dev->wmem_alloc);
if (room < 0)
room = 0;
return room;
}
Commit ... | 0 | 94,507 |
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: size_t OmniboxPopupViewGtk::LineFromY(int y) {
size_t line = std::max(y - kBorderThickness, 0) / kHeightPerResult;
return std::min(line, model_->result().size() - 1);
}
Commit Message: GTK: Stop listening to gtk signals in the omnibox before destroying the model.
BUG=123530
TEST=none
Review URL: http://co... | 0 | 108,773 |
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: node_addrs_changed(node_t *node)
{
node->last_reachable = node->last_reachable6 = 0;
node->country = -1;
}
Commit Message: Consider the exit family when applying guard restrictions.
When the new path selection logic went into place, I accidentally
dropped the code that considered the _family_ of the exit no... | 0 | 69,770 |
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 Extension* ExtensionRegistry::GetExtensionById(const std::string& id,
int include_mask) const {
std::string lowercase_id = base::StringToLowerASCII(id);
if (include_mask & ENABLED) {
const Extension* extension = enabled_extensions_.GetByID(lowerca... | 0 | 123,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 int __init crypto_ccm_module_init(void)
{
int err;
err = crypto_register_template(&crypto_ccm_base_tmpl);
if (err)
goto out;
err = crypto_register_template(&crypto_ccm_tmpl);
if (err)
goto out_undo_base;
err = crypto_register_template(&crypto_rfc4309_tmpl);
if (err)
goto out_undo_ccm;
out:... | 0 | 45,583 |
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 sr_lock_door(struct cdrom_device_info *cdi, int lock)
{
Scsi_CD *cd = cdi->handle;
return scsi_set_medium_removal(cd->device, lock ?
SCSI_REMOVAL_PREVENT : SCSI_REMOVAL_ALLOW);
}
Commit Message: sr: pass down correctly sized SCSI sense buffer
We're casting the CDROM layer request_sense to the SC... | 0 | 82,661 |
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 SyncSocket::PrepareTransitDescriptor(ProcessHandle peer_process_handle,
TransitDescriptor* descriptor) {
DCHECK(descriptor);
if (!::DuplicateHandle(GetCurrentProcess(), handle(), peer_process_handle,
descriptor, 0, FALSE, DUPLICATE_SAME_A... | 0 | 110,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 V8TestObject::VoidMethodEventTargetArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestObject_voidMethodEventTargetArg");
test_object_v8_internal::VoidMethodEventTargetArgMethod(info);
}
Commit Message: bindings... | 0 | 135,421 |
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 __gup_device_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr,
unsigned long end, struct page **pages, int *nr)
{
BUILD_BUG();
return 0;
}
Commit Message: Merge branch 'page-refs' (page ref overflow)
Merge page ref overflow branch.
Jann Horn reported that he can overflow the page ref count w... | 0 | 96,936 |
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 ext3_check_descriptors(struct super_block *sb)
{
struct ext3_sb_info *sbi = EXT3_SB(sb);
int i;
ext3_debug ("Checking group descriptors");
for (i = 0; i < sbi->s_groups_count; i++) {
struct ext3_group_desc *gdp = ext3_get_group_desc(sb, i, NULL);
ext3_fsblk_t first_block = ext3_group_first_bl... | 0 | 32,914 |
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 XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
{
TestObject* imp = V8TestObject::toNative(info.Holder());
V8TRYCATCH_VOID(TestObject*, cppValue, V8TestObject::toNativeWithTypeCheck(info.GetIsolate(), jsValue));
imp->setXMLObjAttr(WTF::ge... | 0 | 121,485 |
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_decache_cr0_guest_bits(struct kvm_vcpu *vcpu)
{
}
Commit Message: KVM: x86: Check non-canonical addresses upon WRMSR
Upon WRMSR, the CPU should inject #GP if a non-canonical value (address) is
written to certain MSRs. The behavior is "almost" identical for AMD and Intel
(ignoring MSRs that are n... | 0 | 37,836 |
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 wifi_interface_handle getIfaceHandle(JNIHelper &helper, jclass cls, jint index) {
return (wifi_interface_handle) helper.getStaticLongArrayField(cls, WifiIfaceHandleVarName, index);
}
Commit Message: Deal correctly with short strings
The parseMacAddress function anticipates only properly formed
MAC addre... | 0 | 159,126 |
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: relay_set_digest(crypto_digest_t *digest, cell_t *cell)
{
char integrity[4];
relay_header_t rh;
crypto_digest_add_bytes(digest, (char*)cell->payload, CELL_PAYLOAD_SIZE);
crypto_digest_get_digest(digest, integrity, 4);
relay_header_unpack(&rh, cell->payload);
memcpy(rh.integrity, integrity, 4);
rela... | 0 | 69,873 |
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: float PrintRenderFrameHelper::RenderPageContent(blink::WebLocalFrame* frame,
int page_number,
const gfx::Rect& canvas_area,
const gfx::Rect& content_area,
... | 0 | 149,141 |
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 pdf_run_Do_image(fz_context *ctx, pdf_processor *proc, const char *name, fz_image *image)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_image(ctx, pr, image);
}
Commit Message:
CWE ID: CWE-416 | 0 | 478 |
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: uint64_t PlatformHandleValueFromPlatformFile(base::PlatformFile file) {
#if defined(OS_WIN)
return reinterpret_cast<uint64_t>(file);
#else
return static_cast<uint64_t>(file);
#endif
}
Commit Message: Correct mojo::WrapSharedMemoryHandle usage
Fixes some incorrect uses of mojo::WrapSharedMemoryHandle which
w... | 0 | 149,624 |
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 num_done_bitstream_buffers() { return num_done_bitstream_buffers_; }
Commit Message: Convert plugin and GPU process to brokered handle duplication.
BUG=119250
Review URL: https://chromiumcodereview.appspot.com/9958034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872... | 0 | 107,000 |
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 __fwnet_broadcast_stop(struct fwnet_device *dev)
{
unsigned u;
if (dev->broadcast_state != FWNET_BROADCAST_ERROR) {
for (u = 0; u < FWNET_ISO_PAGE_COUNT; u++)
kunmap(dev->broadcast_rcv_buffer.pages[u]);
fw_iso_buffer_destroy(&dev->broadcast_rcv_buffer, dev->card);
}
if (dev->broadcast_rcv_... | 0 | 49,314 |
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 setJSTestInterfaceSupplementalStr2(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestInterface* castedThis = jsCast<JSTestInterface*>(thisObject);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
TestSupplemental::setSupplementalStr2(impl, ustringToString(value.i... | 0 | 101,148 |
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::RType_Mobiles(WebEmSession & session, const request& req, Json::Value &root)
{
bool bHaveUser = (session.username != "");
int urights = 3;
if (bHaveUser)
{
int iUser = FindUser(session.username.c_str());
if (iUser != -1)
urights = static_cast<int>(m_users[iUser].userr... | 0 | 91,057 |
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(date_create_from_format)
{
zval *timezone_object = NULL;
char *time_str = NULL, *format_str = NULL;
int time_str_len = 0, format_str_len = 0;
zval datetime_object;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_le... | 0 | 6,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 venc_dev::venc_set_deinterlace(OMX_U32 enable)
{
DEBUG_PRINT_LOW("venc_set_deinterlace: enable = %u", (unsigned int)enable);
struct v4l2_control control;
int rc;
control.id = V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE;
if (enable)
control.value = V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE_ENABLED;
el... | 0 | 159,282 |
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: ~WaitForProcessLauncherThreadToGoIdleObserver() {
}
Commit Message: Remove TabContents from TabStripModelObserver::TabDetachedAt.
BUG=107201
TEST=no visible change
Review URL: https://chromiumcodereview.appspot.com/11293205
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b95... | 0 | 117,699 |
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 js_Ast *memberexp(js_State *J)
{
js_Ast *a;
INCREC();
a = newexp(J);
loop:
if (jsP_accept(J, '.')) { a = EXP2(MEMBER, a, identifiername(J)); goto loop; }
if (jsP_accept(J, '[')) { a = EXP2(INDEX, a, expression(J, 0)); jsP_expect(J, ']'); goto loop; }
DECREC();... | 1 | 165,136 |
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 CreateVizFrameSinkManager() {
viz::mojom::FrameSinkManagerPtr frame_sink_manager;
viz::mojom::FrameSinkManagerRequest frame_sink_manager_request =
mojo::MakeRequest(&frame_sink_manager);
viz::mojom::FrameSinkManagerClientPtr frame_sink_manager_client;
viz::mojom::FrameSinkManagerCli... | 0 | 130,808 |
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 enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value)
{
enum TIFFReadDirEntryErr err;
uint32 count;
void* origdata;
uint64* data;
switch (direntry->tdir_type)
{
case TIFF_LONG:
case TIFF_LONG8:
case TIFF_IFD:
case TIFF_IFD8:
break;
default:... | 0 | 70,189 |
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: onig_is_code_in_cc(OnigEncoding enc, OnigCodePoint code, CClassNode* cc)
{
int len;
if (ONIGENC_MBC_MINLEN(enc) > 1) {
len = 2;
}
else {
len = ONIGENC_CODE_TO_MBCLEN(enc, code);
}
return onig_is_code_in_cc_len(len, code, cc);
}
Commit Message: Fix CVE-2019-13225: problem in converting if-the... | 0 | 89,191 |
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 em_vmmcall(struct x86_emulate_ctxt *ctxt)
{
int rc;
rc = ctxt->ops->fix_hypercall(ctxt);
/* Disable writeback. */
ctxt->dst.type = OP_NONE;
return rc;
}
Commit Message: KVM: x86: fix missing checks in syscall emulation
On hosts without this patch, 32bit guests will crash (and 64bit guests
may ... | 0 | 21,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: ModuleExport void UnregisterFAXImage(void)
{
(void) UnregisterMagickInfo("FAX");
(void) UnregisterMagickInfo("G3");
}
Commit Message:
CWE ID: CWE-119 | 0 | 71,538 |
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 SetEnvironmentString16(const std::wstring& variable_name,
const std::wstring& new_value) {
return !!SetEnvironmentVariable(variable_name.c_str(), new_value.c_str());
}
Commit Message: Ignore switches following "--" when parsing a command line.
BUG=933004
R=wfh@chromium.org
Ch... | 0 | 152,659 |
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 RedirectToNtpOrAppsPageIfNecessary(
content::WebContents* contents,
signin_metrics::AccessPoint access_point) {
if (access_point != signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS)
RedirectToNtpOrAppsPage(contents, access_point);
}
Commit Message: [signin] Add metrics to track the source fo... | 0 | 143,265 |
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 ehci_trace_guest_bug(EHCIState *s, const char *message)
{
trace_usb_ehci_guest_bug(message);
fprintf(stderr, "ehci warning: %s\n", message);
}
Commit Message:
CWE ID: CWE-772 | 0 | 5,827 |
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 SkPath::FillType ParseWinding(const String& winding_rule_string) {
if (winding_rule_string == "nonzero")
return SkPath::kWinding_FillType;
if (winding_rule_string == "evenodd")
return SkPath::kEvenOdd_FillType;
NOTREACHED();
return SkPath::kEvenOdd_FillType;
}
Commit Message: [PE] Disting... | 0 | 149,888 |
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 decode_test_stateid(struct xdr_stream *xdr,
struct nfs41_test_stateid_res *res)
{
__be32 *p;
int status;
int num_res;
status = decode_op_hdr(xdr, OP_TEST_STATEID);
if (status)
return status;
p = xdr_inline_decode(xdr, 4);
if (unlikely(!p))
goto out_overflow;
num_res = be32_to_cp... | 0 | 23,336 |
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 reflectedIdAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectPythonV8Internal::reflectedIdAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
Commit Me... | 0 | 122,602 |
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: cib_GCompareFunc(gconstpointer a, gconstpointer b)
{
const xmlNode *a_msg = a;
const xmlNode *b_msg = b;
int msg_a_id = 0;
int msg_b_id = 0;
const char *value = NULL;
value = crm_element_value_const(a_msg, F_CIB_CALLID);
msg_a_id = crm_parse_int(value, NULL);
value = crm_element... | 0 | 33,848 |
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: rdpsnd_init_packet(uint8 type, uint16 size)
{
STREAM s;
s = channel_init(rdpsnd_channel, size + 4);
out_uint8(s, type);
out_uint8(s, 0); /* protocol-mandated padding */
out_uint16_le(s, size);
return s;
}
Commit Message: Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulne... | 0 | 93,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: running_checker(void)
{
return (__test_bit(DAEMON_CHECKERS, &daemon_mode) &&
(global_data->have_checker_config ||
__test_bit(RUN_ALL_CHILDREN, &daemon_mode)));
}
Commit Message: Add command line and configuration option to set umask
Issue #1048 identified that files created by keepalived are created... | 0 | 75,903 |
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: cifs_parse_devname(const char *devname, struct smb_vol *vol)
{
char *pos;
const char *delims = "/\\";
size_t len;
/* make sure we have a valid UNC double delimiter prefix */
len = strspn(devname, delims);
if (len != 2)
return -EINVAL;
/* find delimiter between host and sharename */
pos = strpbrk(devna... | 0 | 29,824 |
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 Document::didAssociateFormControl(Element* element)
{
if (!frame() || !frame()->page())
return;
m_associatedFormControls.add(element);
if (!m_didAssociateFormControlsTimer.isActive())
m_didAssociateFormControlsTimer.startOneShot(0, FROM_HERE);
}
Commit Message: Don't change Docum... | 0 | 125,282 |
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: ExtensionConfig() {
scripting_whitelist_.push_back("kgejglhpjiefppelpmljglcjbhoiplfn");
scripting_whitelist_.push_back("angkfkebojeancgemegoedelbnjgcgme");
}
Commit Message: Tighten restrictions on hosted apps calling extension APIs
Only allow component apps to make any API calls, and for them only... | 0 | 114,281 |
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 OnStoreCreated(const SessionStore::SessionInfo& session_info,
SessionStore::FactoryCompletionCallback callback,
const base::Optional<syncer::ModelError>& error,
std::unique_ptr<ModelTypeStore> store) {
if (error) {
std::move(callba... | 0 | 143,784 |
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 ReadDXT3(Image *image, DDSInfo *dds_info,
ExceptionInfo *exception)
{
DDSColors
colors;
ssize_t
j,
y;
PixelPacket
*q;
register ssize_t
i,
x;
unsigned char
alpha;
size_t
a0,
a1,
bits,
code;
unsigned short
c0,
c1;
... | 1 | 168,900 |
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 StreamTcp4WHSTest02 (void)
{
int ret = 0;
Packet *p = SCMalloc(SIZE_OF_PACKET);
if (unlikely(p == NULL))
return 0;
Flow f;
ThreadVars tv;
StreamTcpThread stt;
TCPHdr tcph;
memset(p, 0, SIZE_OF_PACKET);
PacketQueue pq;
memset(&pq,0,sizeof(PacketQueue));
... | 0 | 79,179 |
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: get_head_value_node(Node* node, int exact, regex_t* reg)
{
Node* n = NULL_NODE;
switch (NODE_TYPE(node)) {
case NODE_BACKREF:
case NODE_ALT:
#ifdef USE_CALL
case NODE_CALL:
#endif
break;
case NODE_CTYPE:
if (CTYPE_(node)->ctype == CTYPE_ANYCHAR)
break;
/* fall */
case NODE_CCLASS... | 0 | 89,166 |
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: String Document::visibilityState() const {
return PageVisibilityStateString(GetPageVisibilityState());
}
Commit Message: Inherit CSP when we inherit the security origin
This prevents attacks that use main window navigation to get out of the
existing csp constraints such as the related bug
Bug: 747847
Change-... | 0 | 134,239 |
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_open_prepare(struct rpc_task *task, void *calldata)
{
struct nfs4_opendata *data = calldata;
struct nfs4_state_owner *sp = data->owner;
if (nfs_wait_on_sequence(data->o_arg.seqid, task) != 0)
return;
/*
* Check if we still need to send an OPEN call, or if we can use
* a delegation inst... | 0 | 29,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: struct pending_message_list *get_open_deferred_message(uint16 mid)
{
struct pending_message_list *pml;
for (pml = deferred_open_queue; pml; pml = pml->next) {
if (SVAL(pml->buf.data,smb_mid) == mid) {
return pml;
}
}
return NULL;
}
Commit Message:
CWE ID: | 0 | 11,057 |
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 cm_convert_to_ms(int iba_time)
{
/* approximate conversion to ms from 4.096us x 2^iba_time */
return 1 << max(iba_time - 8, 0);
}
Commit Message: IB/core: Don't resolve passive side RoCE L2 address in CMA REQ handler
The code that resolves the passive side source MAC within the rdma_cm
conne... | 0 | 38,351 |
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 Range::detach(ExceptionCode& ec)
{
if (!m_start.container()) {
ec = INVALID_STATE_ERR;
return;
}
m_ownerDocument->detachRange(this);
m_start.clear();
m_end.clear();
}
Commit Message: There are too many poorly named functions to create a fragment from markup
https://bugs... | 0 | 100,242 |
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 JSTestInterfaceConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
{
Base::finishCreation(exec->globalData());
ASSERT(inherits(&s_info));
putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadO... | 0 | 101,123 |
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 NavigateIframeToURL(WebContents* web_contents,
std::string iframe_id,
const GURL& url) {
std::string script = base::StringPrintf(
"setTimeout(\""
"var iframes = document.getElementById('%s');iframes.src='%s';"
"\",0)",
iframe_id.c_st... | 0 | 156,103 |
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 struct object_entry *dereference(struct object_entry *oe,
unsigned char sha1[20])
{
unsigned long size;
char *buf = NULL;
if (!oe) {
enum object_type type = sha1_object_info(sha1, NULL);
if (type < 0)
die("object not found: %s", sha1_to_hex(sha1));
/* cache it! */
oe = insert_object(sha1... | 0 | 55,058 |
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 tls12_find_nid(int id, tls12_lookup *table, size_t tlen)
{
size_t i;
for (i = 0; i < tlen; i++) {
if ((table[i].id) == id)
return table[i].nid;
}
return NID_undef;
}
Commit Message:
CWE ID: | 0 | 6,151 |
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 GestureSequence::AppendDoubleClickGestureEvent(const GesturePoint& point,
Gestures* gestures) {
gestures->push_back(linked_ptr<GestureEvent>(new GestureEvent(
ui::ET_GESTURE_DOUBLE_TAP,
point.first_touch_position().x(),
point.first_touch... | 0 | 108,738 |
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 ModuleSystem::Invalidate() {
{
v8::HandleScope scope(GetIsolate());
v8::Local<v8::Object> global = context()->v8_context()->Global();
DeletePrivate(global, kModulesField);
DeletePrivate(global, kModuleSystem);
}
for (const auto& handler : native_handler_map_)
handler.second->Invali... | 0 | 156,330 |
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: ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> object)
{
return toNative(object);
}
Commit Message: [V8] Pass Isolate to throwNotEnoughArgumentsError()
https://bugs.webkit.org/show_bug.cgi?id=86983
Reviewed by Adam Barth.
The objective is to pass Isolate around in V8 bindi... | 0 | 109,499 |
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: ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC) /* {{{ */
{
if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, fcc, error TSRMLS_CC)) {
return FAILURE;
}
fci->size = si... | 0 | 13,797 |
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 DownloadManagerImpl::BeginDownloadInternal(
std::unique_ptr<content::DownloadUrlParameters> params,
uint32_t id) {
download::InProgressCache* in_progress_cache =
GetBrowserContext()->GetDownloadManagerDelegate()->GetInProgressCache();
if (in_progress_cache) {
in_progress_cache->AddOrRep... | 0 | 146,415 |
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: DevToolsConfirmInfoBarDelegate::~DevToolsConfirmInfoBarDelegate() {
if (!callback_.is_null())
callback_.Run(false);
}
Commit Message: DevTools: handle devtools renderer unresponsiveness during beforeunload event interception
This patch fixes the crash which happenes under the following conditions:
1. DevT... | 0 | 113,222 |
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: RenderThreadImpl::HistogramCustomizer::HistogramCustomizer() {
custom_histograms_.insert("V8.MemoryExternalFragmentationTotal");
custom_histograms_.insert("V8.MemoryHeapSampleTotalCommitted");
custom_histograms_.insert("V8.MemoryHeapSampleTotalUsed");
}
Commit Message: Suspend shared timers while blockingl... | 0 | 111,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: addentry(struct magic_set *ms, struct magic_entry *me,
struct magic_entry_set *mset)
{
size_t i = me->mp->type == FILE_NAME ? 1 : 0;
if (mset[i].count == mset[i].max) {
struct magic_entry *mp;
mset[i].max += ALLOC_INCR;
if ((mp = CAST(struct magic_entry *,
realloc(mset[i].me, sizeof(*mp) * mset[... | 0 | 37,953 |
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 nested_svm_vmrun(struct vcpu_svm *svm)
{
struct vmcb *nested_vmcb;
struct vmcb *hsave = svm->nested.hsave;
struct vmcb *vmcb = svm->vmcb;
struct page *page;
u64 vmcb_gpa;
vmcb_gpa = svm->vmcb->save.rax;
nested_vmcb = nested_svm_map(svm, svm->vmcb->save.rax, &page);
if (!nested_vmcb)
return... | 0 | 37,797 |
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 cJSON_AddItemToArray( cJSON *array, cJSON *item )
{
cJSON *c = array->child;
if ( ! item )
return;
if ( ! c ) {
array->child = item;
} else {
while ( c && c->next )
c = c->next;
suffix_object( c, item );
}
}
Commit Message: Fix a buffer overflow / heap corruption issue that could occur if a
... | 1 | 167,267 |
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: Action::AuthStatus DBusHelperProxy::authorizeAction(const QString &action, const QString &helperID)
{
if (!m_actionsInProgress.isEmpty()) {
return Action::ErrorStatus;
}
m_busConnection.interface()->startService(helperID);
QDBusMessage message;
message = QDBusMessage::createMethodCal... | 0 | 7,189 |
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: long long Chapters::Atom::GetStartTimecode() const { return m_start_timecode; }
Commit Message: external/libvpx/libwebm: Update snapshot
Update libwebm snapshot. This update contains security fixes from upstream.
Upstream git hash: 229f49347d19b0ca0941e072b199a242ef6c5f2b
BUG=23167726
Change-Id: Id3e140e7b31... | 0 | 160,798 |
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: parse_file(struct xkb_compose_table *table, FILE *file, const char *file_name)
{
bool ok;
char *string;
size_t size;
ok = map_file(file, &string, &size);
if (!ok) {
log_err(table->ctx, "Couldn't read Compose file %s: %s\n",
file_name, strerror(errno));
return f... | 0 | 79,019 |
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 utf8len(const uint8_t *b)
{
int len = 0;
int val;
while (*b) {
GET_UTF8(val, *b++, return -1;)
len++;
}
return len;
}
Commit Message: avformat/movenc: Write version 2 of audio atom if channels is not known
The version 1 needs the channel count and would divide by 0... | 0 | 79,449 |
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 *Type_XYZ_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag)
{
cmsCIEXYZ* xyz;
*nItems = 0;
xyz = (cmsCIEXYZ*) _cmsMallocZero(self ->ContextID, sizeof(cmsCIEXYZ));
if (xyz == NULL) return NULL;
if (!_cmsReadXYZNumber(io, xyz)... | 0 | 71,078 |
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: TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile)
: delegate_(delegate),
profile_(profile),
closing_all_(false),
order_controller_(NULL) {
DCHECK(delegate_);
registrar_.Add(this,
NotificationType::TAB_CONTENTS_DESTROYED,
Not... | 0 | 98,132 |
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: bgp_vpn_rd_print(netdissect_options *ndo,
const u_char *pptr)
{
/* allocate space for the largest possible string */
static char rd[sizeof("xxxxxxxxxx:xxxxx (xxx.xxx.xxx.xxx:xxxxx)")];
char *pos = rd;
/* ok lets load the RD format */
switch (EXTRACT_16BITS(pptr)) {
/*... | 0 | 62,253 |
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 noinline int cow_file_range_inline(struct btrfs_root *root,
struct inode *inode, u64 start,
u64 end, size_t compressed_size,
int compress_type,
struct page **compressed_pages)
{
struct btrfs_trans_handle *trans;
u64 isize = i_size_read(inode);
u64 actual_end = min(end + 1, is... | 0 | 41,703 |
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 tun_can_build_skb(struct tun_struct *tun, struct tun_file *tfile,
int len, int noblock, bool zerocopy)
{
if ((tun->flags & TUN_TYPE_MASK) != IFF_TAP)
return false;
if (tfile->socket.sk->sk_sndbuf != INT_MAX)
return false;
if (!noblock)
return false;
if (zerocopy)
return false;
... | 0 | 93,264 |
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 ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
{
struct compat_sioc_sg_req6 sr;
struct compat_sioc_mif_req6 vr;
struct mif_device *vif;
struct mfc6_cache *c;
struct net *net = sock_net(sk);
struct mr6_table *mrt;
mrt = ip6mr_get_table(net, raw6_sk(sk)->ip6mr_table ? : RT6_TABL... | 0 | 93,522 |
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: TestLifecycleUnit::TestLifecycleUnit(base::TimeTicks last_focused_time,
base::ProcessHandle process_handle,
bool can_discard)
: LifecycleUnitBase(content::Visibility::VISIBLE),
last_focused_time_(last_focused_time),
process_... | 0 | 132,180 |
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 vrend_set_streamout_targets(struct vrend_context *ctx,
uint32_t append_bitmask,
uint32_t num_targets,
uint32_t *handles)
{
struct vrend_so_target *target;
int i;
if (num_targets) {
bool found = ... | 0 | 8,944 |
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(mcrypt_enc_get_iv_size)
{
MCRYPT_GET_TD_ARG
RETURN_LONG(mcrypt_enc_get_iv_size(pm->td));
}
Commit Message: Fix bug #72455: Heap Overflow due to integer overflows
CWE ID: CWE-190 | 0 | 51,367 |
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 CrosLibrary::TestApi::SetLoginLibrary(
LoginLibrary* library, bool own) {
library_->login_lib_.SetImpl(library, own);
}
Commit Message: chromeos: Replace copy-and-pasted code with macros.
This replaces a bunch of duplicated-per-library cros
function definitions and comments.
BUG=none
TEST=built it
... | 1 | 170,640 |
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: android::SoftOMXComponent *createSoftOMXComponent(
const char *name, const OMX_CALLBACKTYPE *callbacks,
OMX_PTR appData, OMX_COMPONENTTYPE **component) {
return new android::SoftVPXEncoder(name, callbacks, appData, component);
}
Commit Message: codecs: check OMX buffer size before use in VP8 encoder.
... | 0 | 161,007 |
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: TabRecordingIndicatorAnimation::Create() {
MultiAnimation::Parts parts;
static_assert(kCaptureIndicatorThrobCycles % 2 != 0,
"odd number of cycles required so animation finishes in showing state");
for (int i = 0; i < kCaptureIndicatorThrobCycles; ++i) {
parts.push_back(MultiAnimation::Part(
... | 0 | 126,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 int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
void *data)
{
IRSSI_INPUT_REC *rec = data;
int icond = 0;
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
/* error, we have to call the function.. */
if (rec->condition & G_IO_IN)
icond |= G_INPUT_READ;
else
icond |=... | 0 | 63,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: cf2_getUnitsPerEm( CFF_Decoder* decoder )
{
FT_ASSERT( decoder && decoder->builder.face );
FT_ASSERT( decoder->builder.face->root.units_per_EM );
return decoder->builder.face->root.units_per_EM;
}
Commit Message:
CWE ID: CWE-20 | 0 | 13,092 |
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 tg3_nvram_init(struct tg3 *tp)
{
if (tg3_flag(tp, IS_SSB_CORE)) {
/* No NVRAM and EEPROM on the SSB Broadcom GigE core. */
tg3_flag_clear(tp, NVRAM);
tg3_flag_clear(tp, NVRAM_BUFFERED);
tg3_flag_set(tp, NO_NVRAM);
return;
}
tw32_f(GRC_EEPROM_ADDR,
(EEPROM_ADDR_FSM_RESET |
(E... | 0 | 32,633 |
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 aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
unsigned int key_len)
{
struct AES_CTX *ctx = crypto_tfm_ctx(tfm);
switch (key_len) {
case AES_KEYSIZE_128:
key_len = 128;
break;
case AES_KEYSIZE_192:
key_len = 192;
break;
case AES_KEYSIZE_256:
key_len = 256;
break;
default:
... | 0 | 46,599 |
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: set_fflags_platform(struct archive_write_disk *a, int fd, const char *name,
mode_t mode, unsigned long set, unsigned long clear)
{
int ret;
int myfd = fd;
int newflags, oldflags;
int sf_mask = 0;
if (set == 0 && clear == 0)
return (ARCHIVE_OK);
/* Only regular files and dirs can have flags. */
... | 0 | 43,930 |
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 rwpng_free_image24(png24_image *image)
{
free(image->row_pointers);
image->row_pointers = NULL;
free(image->rgba_data);
image->rgba_data = NULL;
rwpng_free_chunks(image->chunks);
image->chunks = NULL;
}
Commit Message: Fix integer overflow in rwpng.h (CVE-2016-5735)
Reported by Ch... | 0 | 73,853 |
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 __exit ip6_tunnel_cleanup(void)
{
if (xfrm6_tunnel_deregister(&ip4ip6_handler, AF_INET))
printk(KERN_INFO "ip6_tunnel close: can't deregister ip4ip6\n");
if (xfrm6_tunnel_deregister(&ip6ip6_handler, AF_INET6))
printk(KERN_INFO "ip6_tunnel close: can't deregister ip6ip6\n");
unregister_pernet_... | 0 | 27,427 |
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 sysctl_init(void)
{
struct ctl_table_header *hdr;
hdr = register_sysctl_table(sysctl_base_table);
kmemleak_not_leak(hdr);
return 0;
}
Commit Message: mnt: Add a per mount namespace limit on the number of mounts
CAI Qian <caiqian@redhat.com> pointed out that the semantics
of shared subtrees make ... | 0 | 51,000 |
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 SSLManager::NotifySSLInternalStateChanged(
NavigationControllerImpl* controller) {
content::NotificationService::current()->Notify(
content::NOTIFICATION_SSL_INTERNAL_STATE_CHANGED,
content::Source<content::BrowserContext>(controller->GetBrowserContext()),
content::NotificationService... | 0 | 107,952 |
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 snd_usbmidi_error_timer(unsigned long data)
{
struct snd_usb_midi *umidi = (struct snd_usb_midi *)data;
unsigned int i, j;
spin_lock(&umidi->disc_lock);
if (umidi->disconnected) {
spin_unlock(&umidi->disc_lock);
return;
}
for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
struct snd_usb_midi_in_e... | 0 | 54,770 |
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 GLES2Util::GetColorFormatComponentSizes(
uint32_t internal_format, uint32_t type, int* r, int* g, int* b, int* a) {
DCHECK(r && g && b && a);
*r = 0;
*g = 0;
*b = 0;
*a = 0;
switch (internal_format) {
case GL_LUMINANCE:
switch (type) {
case GL_UNSIGNED_BYTE:
inter... | 0 | 153,354 |
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 rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg)
{
switch (cmd) {
case SIOCOUTQ: {
int amount = sk_wmem_alloc_get(sk);
return put_user(amount, (int __user *)arg);
}
case SIOCINQ: {
struct sk_buff *skb;
int amount = 0;
spin_lock_bh(&sk->sk_receive_queue.lock);
skb = skb_peek(&s... | 0 | 40,202 |
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: sa_errorstr(int err)
{
static char errstr[32];
char *ret = NULL;
switch (err) {
case SA_OK:
ret = dgettext(TEXT_DOMAIN, "ok");
break;
case SA_NO_SUCH_PATH:
ret = dgettext(TEXT_DOMAIN, "path doesn't exist");
break;
case SA_NO_MEMORY:
ret = dgettext(TEXT_DOMAIN, "no memory");
break;
case SA_DUPL... | 0 | 96,268 |
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 BlinkTestRunner::OnTryLeakDetection() {
WebLocalFrame* main_frame =
render_view()->GetWebView()->mainFrame()->toWebLocalFrame();
DCHECK_EQ(GURL(url::kAboutBlankURL), GURL(main_frame->document().url()));
DCHECK(!main_frame->isLoading());
leak_detector_->TryLeakDetection(main_frame);
}
Commit M... | 0 | 123,578 |
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: OVS_REQUIRES(ofproto_mutex)
{
switch (ofm->command) {
case OFPFC_ADD:
add_flow_finish(ofproto, ofm, req);
break;
case OFPFC_MODIFY:
case OFPFC_MODIFY_STRICT:
modify_flows_finish(ofproto, ofm, req);
break;
case OFPFC_DELETE:
case OFPFC_DELETE_STRICT:
... | 0 | 77,201 |
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 FindMultipleClickBoundary(bool is_double_click, base::char16 cur) {
if (!is_double_click)
return cur == '\n';
if (base::IsAsciiAlpha(cur) || base::IsAsciiDigit(cur) || cur == '_')
return false;
if (cur < 128)
return true;
static constexpr base::char16 kZeroWidthSpace = 0x200B;
if (cur... | 0 | 146,106 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.