ChamaraVishwajithRajapaksha/Code-Vulnerability-FineTune huggingface dataset:
CotpConnection_parseIncomingMessage(CotpConnection* self)
{
    CotpIndication indication = parseCotpMessage(self);

    self->readBuffer->size = 0;
    self->packetSize = 0;

    return indication;
}
int seq_release_private(struct inode *inode, struct file *file)
{
	struct seq_file *seq = file->private_data;

	kfree(seq->private);
	seq->private = NULL;
	return seq_release(inode, file);
}
xfs_bulk_ireq_teardown(
	struct xfs_bulk_ireq	*hdr,
	struct xfs_ibulk	*breq)
{
	hdr->ino = breq->startino;
	hdr->ocount = breq->ocount;
}
box_le(PG_FUNCTION_ARGS)
{
	BOX		   *box1 = PG_GETARG_BOX_P(0);
	BOX		   *box2 = PG_GETARG_BOX_P(1);

	PG_RETURN_BOOL(FPle(box_ar(box1), box_ar(box2)));
}
static int replmd_make_prefix_child_dn(TALLOC_CTX *tmp_ctx,
				       struct ldb_context *ldb,
				       struct ldb_dn *dn,
				       const char *four_char_prefix,
				       const char *rdn_name,
				       const struct ldb_val *rdn_value,
				       struct GUID guid)
{
	struct ldb_val deleted_child_rdn_val;
	struct GUID_txt_buf guid_str;
	int ret;
	bool retb;

	GUID_buf_string(&guid, &guid_str);

	retb = ldb_dn_add_child_fmt(dn, "X=Y");
	if (!retb) {
		ldb_asprintf_errstring(ldb, __location__
				       ": Unable to add a formatted child to dn: %s",
				       ldb_dn_get_linearized(dn));
		return LDB_ERR_OPERATIONS_ERROR;
	}

	/*
	 * TODO: Per MS-ADTS 3.1.1.5.5 Delete Operation
	 * we should truncate this value to ensure the RDN is not more than 255 chars.
	 *
	 * However we MS-ADTS 3.1.1.5.1.2 Naming Constraints indicates that:
	 *
	 * "Naming constraints are not enforced for replicated
	 * updates." so this is safe and we don't have to work out not
	 * splitting a UTF8 char right now.
	 */
	deleted_child_rdn_val = ldb_val_dup(tmp_ctx, rdn_value);

	/*
	 * sizeof(guid_str.buf) will always be longer than
	 * strlen(guid_str.buf) but we allocate using this and
	 * waste the trailing bytes to avoid scaring folks
	 * with memcpy() using strlen() below
	 */

	deleted_child_rdn_val.data
		= talloc_realloc(tmp_ctx, deleted_child_rdn_val.data,
				 uint8_t,
				 rdn_value->length + 5
				 + sizeof(guid_str.buf));
	if (!deleted_child_rdn_val.data) {
		ldb_asprintf_errstring(ldb, __location__
				       ": Unable to add a formatted child to dn: %s",
				       ldb_dn_get_linearized(dn));
		return LDB_ERR_OPERATIONS_ERROR;
	}

	deleted_child_rdn_val.length =
		rdn_value->length + 5
		+ strlen(guid_str.buf);

	SMB_ASSERT(deleted_child_rdn_val.length <
		   talloc_get_size(deleted_child_rdn_val.data));

	/*
	 * talloc won't allocate more than 256MB so we can't
	 * overflow but just to be sure
	 */
	if (deleted_child_rdn_val.length < rdn_value->length) {
		return LDB_ERR_OPERATIONS_ERROR;
	}

	deleted_child_rdn_val.data[rdn_value->length] = 0x0a;
	memcpy(&deleted_child_rdn_val.data[rdn_value->length + 1],
	       four_char_prefix, 4);
	memcpy(&deleted_child_rdn_val.data[rdn_value->length + 5],
	       guid_str.buf,
	       sizeof(guid_str.buf));

	/* Now set the value into the RDN, without parsing it */
	ret = ldb_dn_set_component(
		dn,
		0,
		rdn_name,
		deleted_child_rdn_val);

	return ret;
}
void subs_del(GF_Box *s)
{
	GF_SubSampleInformationBox *ptr = (GF_SubSampleInformationBox *)s;
	if (ptr == NULL) return;

	while (gf_list_count(ptr->Samples)) {
		GF_SubSampleInfoEntry *pSamp;
		pSamp = (GF_SubSampleInfoEntry*)gf_list_get(ptr->Samples, 0);
		while (gf_list_count(pSamp->SubSamples)) {
			GF_SubSampleEntry *pSubSamp;
			pSubSamp = (GF_SubSampleEntry*) gf_list_get(pSamp->SubSamples, 0);
			gf_free(pSubSamp);
			gf_list_rem(pSamp->SubSamples, 0);
		}
		gf_list_del(pSamp->SubSamples);
		gf_free(pSamp);
		gf_list_rem(ptr->Samples, 0);
	}
	gf_list_del(ptr->Samples);
	gf_free(ptr);
void stop() {
    delay_lock.Lock();
    stop_delayed_delivery = true;
    delay_cond.Signal();
    delay_lock.Unlock();
  }
static void __exit nf_conntrack_proto_dccp_fini(void)
{
	nf_ct_l4proto_unregister(&dccp_proto6);
	nf_ct_l4proto_unregister(&dccp_proto4);
	unregister_pernet_subsys(&dccp_net_ops);
}
void _php_import_environment_variables(zval *array_ptr)
{
	char buf[128];
	char **env, *p, *t = buf;
	size_t alloc_size = sizeof(buf);
	unsigned long nlen; /* ptrdiff_t is not portable */

	for (env = environ; env != NULL && *env != NULL; env++) {
		p = strchr(*env, '=');
		if (!p) {				/* malformed entry? */
			continue;
		}
		nlen = p - *env;
		if (nlen >= alloc_size) {
			alloc_size = nlen + 64;
			t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size));
		}
		memcpy(t, *env, nlen);
		t[nlen] = '\0';
		php_register_variable(t, p + 1, array_ptr);
	}
	if (t != buf && t != NULL) {
		efree(t);
	}
}
static int find_max_supported_pagesize(Object *obj, void *opaque)
{
    char *mem_path;
    long *hpsize_min = opaque;

    if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
        mem_path = object_property_get_str(obj, "mem-path", NULL);
        if (mem_path) {
            long hpsize = qemu_mempath_getpagesize(mem_path);
            if (hpsize < *hpsize_min) {
                *hpsize_min = hpsize;
            }
        } else {
            *hpsize_min = getpagesize();
        }
    }

    return 0;
}
**/
    CImg<T>& cosh() {
      if (is_empty()) return *this;
      cimg_pragma_openmp(parallel for cimg_openmp_if(size()>=2048))
      cimg_rof(*this,ptrd,T) *ptrd = (T)std::cosh((double)*ptrd);
      return *this;
static void js_defvar(js_State *J, const char *name)
{
	jsR_defproperty(J, J->E->variables, name, JS_DONTENUM | JS_DONTCONF, NULL, NULL, NULL);
}
gif_prepare_lzw (GifContext *context)
{
	gint i;

	if (!gif_read (context, &(context->lzw_set_code_size), 1)) {
		/*g_message (_("GIF: EOF / read error on image data\n"));*/
		return -1;
	}

	context->lzw_code_size = context->lzw_set_code_size + 1;
	context->lzw_clear_code = 1 << context->lzw_set_code_size;
	context->lzw_end_code = context->lzw_clear_code + 1;
	context->lzw_max_code_size = 2 * context->lzw_clear_code;
	context->lzw_max_code = context->lzw_clear_code + 2;
	context->lzw_fresh = TRUE;
	context->code_curbit = 0;
	context->code_lastbit = 0;
	context->code_last_byte = 0;
	context->code_done = FALSE;

	for (i = 0; i < context->lzw_clear_code; ++i) {
		context->lzw_table[0][i] = 0;
		context->lzw_table[1][i] = i;
	}
	for (; i < (1 << MAX_LZW_BITS); ++i)
		context->lzw_table[0][i] = context->lzw_table[1][0] = 0;

	context->lzw_sp = context->lzw_stack;
	gif_set_get_lzw (context);

	return 0;
}
static int _snd_timer_stop(struct snd_timer_instance * timeri,
			   int keep_flag, int event)
{
	struct snd_timer *timer;
	unsigned long flags;

	if (snd_BUG_ON(!timeri))
		return -ENXIO;

	if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE) {
		if (!keep_flag) {
			spin_lock_irqsave(&slave_active_lock, flags);
			timeri->flags &= ~SNDRV_TIMER_IFLG_RUNNING;
			spin_unlock_irqrestore(&slave_active_lock, flags);
		}
		goto __end;
	}
	timer = timeri->timer;
	if (!timer)
		return -EINVAL;
	spin_lock_irqsave(&timer->lock, flags);
	list_del_init(&timeri->ack_list);
	list_del_init(&timeri->active_list);
	if ((timeri->flags & SNDRV_TIMER_IFLG_RUNNING) &&
	    !(--timer->running)) {
		timer->hw.stop(timer);
		if (timer->flags & SNDRV_TIMER_FLG_RESCHED) {
			timer->flags &= ~SNDRV_TIMER_FLG_RESCHED;
			snd_timer_reschedule(timer, 0);
			if (timer->flags & SNDRV_TIMER_FLG_CHANGE) {
				timer->flags &= ~SNDRV_TIMER_FLG_CHANGE;
				timer->hw.start(timer);
			}
		}
	}
	if (!keep_flag)
		timeri->flags &=
			~(SNDRV_TIMER_IFLG_RUNNING | SNDRV_TIMER_IFLG_START);
	spin_unlock_irqrestore(&timer->lock, flags);
      __end:
	if (event != SNDRV_TIMER_EVENT_RESOLUTION)
		snd_timer_notify1(timeri, event);
	return 0;
}
nautilus_directory_stop_monitoring_file_list (NautilusDirectory *directory)
{
    if (!directory->details->file_list_monitored)
    {
        g_assert (directory->details->directory_load_in_progress == NULL);
        return;
    }

    directory->details->file_list_monitored = FALSE;
    file_list_cancel (directory);
    nautilus_file_list_unref (directory->details->file_list);
    directory->details->directory_loaded = FALSE;
}
static void openpic_gcr_write(OpenPICState *opp, uint64_t val)
{
    bool mpic_proxy = false;

    if (val & GCR_RESET) {
        openpic_reset(DEVICE(opp));
        return;
    }

    opp->gcr &= ~opp->mpic_mode_mask;
    opp->gcr |= val & opp->mpic_mode_mask;

    /* Set external proxy mode */
    if ((val & opp->mpic_mode_mask) == GCR_MODE_PROXY) {
        mpic_proxy = true;
    }

    ppce500_set_mpic_proxy(mpic_proxy);
}
ofputil_encode_port_status(const struct ofputil_port_status *ps,
                           enum ofputil_protocol protocol)
{
    struct ofp_port_status *ops;
    struct ofpbuf *b;
    enum ofp_version version;
    enum ofpraw raw;

    version = ofputil_protocol_to_ofp_version(protocol);
    switch (version) {
    case OFP10_VERSION:
        raw = OFPRAW_OFPT10_PORT_STATUS;
        break;

    case OFP11_VERSION:
    case OFP12_VERSION:
    case OFP13_VERSION:
        raw = OFPRAW_OFPT11_PORT_STATUS;
        break;

    case OFP14_VERSION:
    case OFP15_VERSION:
        raw = OFPRAW_OFPT14_PORT_STATUS;
        break;

    case OFP16_VERSION:
        raw = OFPRAW_OFPT16_PORT_STATUS;
        break;

    default:
        OVS_NOT_REACHED();
    }

    b = ofpraw_alloc_xid(raw, version, htonl(0), 0);
    ops = ofpbuf_put_zeros(b, sizeof *ops);
    ops->reason = ps->reason;
    ofputil_put_phy_port(version, &ps->desc, b);
    ofpmsg_update_length(b);
    return b;
}
aspath_parse (struct stream *s, size_t length, int use32bit)
{
  struct aspath as;
  struct aspath *find;

  /* If length is odd it's malformed AS path. */
  /* Nit-picking: if (use32bit == 0) it is malformed if odd,
   * otherwise its malformed when length is larger than 2 and (length-2) 
   * is not dividable by 4.
   * But... this time we're lazy
   */
  if (length % AS16_VALUE_SIZE )
    return NULL;

  memset (&as, 0, sizeof (struct aspath));
  if (assegments_parse (s, length, &as.segments, use32bit) < 0)
    return NULL;

  /* If already same aspath exist then return it. */
  find = hash_get (ashash, &as, aspath_hash_alloc);

  /* bug! should not happen, let the daemon crash below */
  assert (find);

  /* if the aspath was already hashed free temporary memory. */
  if (find->refcnt)
    {
      assegment_free_all (as.segments);
      /* aspath_key_make() always updates the string */
      XFREE (MTYPE_AS_STR, as.str);
    }

  find->refcnt++;

  return find;
}
int crypto_register_instance(struct crypto_template *tmpl,
			     struct crypto_instance *inst)
{
	struct crypto_larval *larval;
	int err;

	err = crypto_check_alg(&inst->alg);
	if (err)
		goto err;

	inst->alg.cra_module = tmpl->module;
	inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE;

	down_write(&crypto_alg_sem);

	larval = __crypto_register_alg(&inst->alg);
	if (IS_ERR(larval))
		goto unlock;

	hlist_add_head(&inst->list, &tmpl->instances);
	inst->tmpl = tmpl;

unlock:
	up_write(&crypto_alg_sem);

	err = PTR_ERR(larval);
	if (IS_ERR(larval))
		goto err;

	crypto_wait_for_test(larval);
	err = 0;

err:
	return err;
}
bool Item_field::check_field_expression_processor(void *arg)
{
  Field *org_field= (Field*) arg;
  if (field->flags & NO_DEFAULT_VALUE_FLAG)
    return 0;
  if ((field->default_value && field->default_value->flags) || field->vcol_info)
  {
    if (field == org_field ||
        (!org_field->vcol_info && field->vcol_info) ||
        (((field->vcol_info && org_field->vcol_info) ||
          (!field->vcol_info && !org_field->vcol_info)) &&
         field->field_index >= org_field->field_index))
    {
      my_error(ER_EXPRESSION_REFERS_TO_UNINIT_FIELD,
               MYF(0),
               org_field->field_name.str, field->field_name.str);
      return 1;
    }
  }
  return 0;
}
int crypt_keyslot_add_by_key(struct crypt_device *cd,
	int keyslot,
	const char *volume_key,
	size_t volume_key_size,
	const char *passphrase,
	size_t passphrase_size,
	uint32_t flags)
{
	int digest, r;
	struct luks2_keyslot_params params;
	struct volume_key *vk = NULL;

	if (!passphrase || ((flags & CRYPT_VOLUME_KEY_NO_SEGMENT) &&
			    (flags & CRYPT_VOLUME_KEY_SET)))
		return -EINVAL;

	log_dbg(cd, "Adding new keyslot %d with volume key %sassigned to a crypt segment.",
		keyslot, flags & CRYPT_VOLUME_KEY_NO_SEGMENT ? "un" : "");

	if ((r = onlyLUKS2(cd)))
		return r;

	/* new volume key assignment */
	if ((flags & CRYPT_VOLUME_KEY_SET) && crypt_keyslot_status(cd, keyslot) > CRYPT_SLOT_INACTIVE)
		return verify_and_update_segment_digest(cd, &cd->u.luks2.hdr,
			keyslot, volume_key, volume_key_size, passphrase, passphrase_size);

	r = keyslot_verify_or_find_empty(cd, &keyslot);
	if (r < 0)
		return r;

	if (volume_key)
		vk = crypt_alloc_volume_key(volume_key_size, volume_key);
	else if (flags & CRYPT_VOLUME_KEY_NO_SEGMENT)
		vk = crypt_generate_volume_key(cd, volume_key_size);
	else if (cd->volume_key)
		vk = crypt_alloc_volume_key(cd->volume_key->keylength, cd->volume_key->key);
	else
		return -EINVAL;

	if (!vk)
		return -ENOMEM;

	/* if key matches volume key digest tear down new vk flag */
	digest = LUKS2_digest_verify_by_segment(cd, &cd->u.luks2.hdr, CRYPT_DEFAULT_SEGMENT, vk);
	if (digest >= 0)
		flags &= ~CRYPT_VOLUME_KEY_SET;

	/* if key matches any existing digest, do not create new digest */
	if (digest < 0 && (flags & CRYPT_VOLUME_KEY_DIGEST_REUSE))
		digest = LUKS2_digest_any_matching(cd, &cd->u.luks2.hdr, vk);

	/* no segment flag or new vk flag requires new key digest */
	if (flags & (CRYPT_VOLUME_KEY_NO_SEGMENT | CRYPT_VOLUME_KEY_SET)) {
		if (digest < 0 || !(flags & CRYPT_VOLUME_KEY_DIGEST_REUSE))
			digest = LUKS2_digest_create(cd, "pbkdf2", &cd->u.luks2.hdr, vk);
	}

	r = digest;
	if (r < 0) {
		log_err(cd, _("Volume key does not match the volume."));
		goto out;
	}

	r = LUKS2_keyslot_params_default(cd, &cd->u.luks2.hdr, &params);
	if (r < 0) {
		log_err(cd, _("Failed to initialize default LUKS2 keyslot parameters."));
		goto out;
	}

	r = LUKS2_digest_assign(cd, &cd->u.luks2.hdr, keyslot, digest, 1, 0);
	if (r < 0) {
		log_err(cd, _("Failed to assign keyslot %d to digest."), keyslot);
		goto out;
	}

	r = LUKS2_keyslot_store(cd, &cd->u.luks2.hdr, keyslot,
				passphrase, passphrase_size, vk, &params);

	if (r >= 0 && (flags & CRYPT_VOLUME_KEY_SET))
		r = update_volume_key_segment_digest(cd, &cd->u.luks2.hdr, digest, 1);
out:
	crypt_free_volume_key(vk);
	if (r < 0) {
		_luks2_reload(cd);
		return r;
	}
	return keyslot;
}
cifs_readdata_to_iov(struct cifs_readdata *rdata, const struct iovec *iov,
			unsigned long nr_segs, loff_t offset, ssize_t *copied)
{
	int rc = 0;
	struct iov_iter ii;
	size_t pos = rdata->offset - offset;
	ssize_t remaining = rdata->bytes;
	unsigned char *pdata;
	unsigned int i;

	/* set up iov_iter and advance to the correct offset */
	iov_iter_init(&ii, iov, nr_segs, iov_length(iov, nr_segs), 0);
	iov_iter_advance(&ii, pos);

	*copied = 0;
	for (i = 0; i < rdata->nr_pages; i++) {
		ssize_t copy;
		struct page *page = rdata->pages[i];

		/* copy a whole page or whatever's left */
		copy = min_t(ssize_t, remaining, PAGE_SIZE);

		/* ...but limit it to whatever space is left in the iov */
		copy = min_t(ssize_t, copy, iov_iter_count(&ii));

		/* go while there's data to be copied and no errors */
		if (copy && !rc) {
			pdata = kmap(page);
			rc = memcpy_toiovecend(ii.iov, pdata, ii.iov_offset,
						(int)copy);
			kunmap(page);
			if (!rc) {
				*copied += copy;
				remaining -= copy;
				iov_iter_advance(&ii, copy);
			}
		}
	}

	return rc;
}
ftrace_ops_test(struct ftrace_ops *ops, unsigned long ip)
{
	struct ftrace_hash *filter_hash;
	struct ftrace_hash *notrace_hash;
	int ret;

	filter_hash = rcu_dereference_raw(ops->filter_hash);
	notrace_hash = rcu_dereference_raw(ops->notrace_hash);

	if ((ftrace_hash_empty(filter_hash) ||
	     ftrace_lookup_ip(filter_hash, ip)) &&
	    (ftrace_hash_empty(notrace_hash) ||
	     !ftrace_lookup_ip(notrace_hash, ip)))
		ret = 1;
	else
		ret = 0;

	return ret;
}
void module_register(void) {
  plugin_register_complex_config("snmp", csnmp_config);
  plugin_register_init("snmp", csnmp_init);
  plugin_register_shutdown("snmp", csnmp_shutdown);
} /* void module_register */
HandleBlockDNSMessage(const block_dns_message_t *msg, undo_lists_t *lists)
{
    DWORD err = 0;
    block_dns_data_t *interface_data;
    HANDLE engine = NULL;
    LPCWSTR exe_path;

#ifdef UNICODE
    exe_path = settings.exe_path;
#else
    WCHAR wide_path[MAX_PATH];
    MultiByteToWideChar(CP_UTF8, 0, settings.exe_path, MAX_PATH, wide_path, MAX_PATH);
    exe_path = wide_path;
#endif

    if (msg->header.type == msg_add_block_dns)
    {
        err = add_block_dns_filters(&engine, msg->iface.index, exe_path, BlockDNSErrHandler);
        if (!err)
        {
            interface_data = malloc(sizeof(block_dns_data_t));
            if (!interface_data)
            {
                return ERROR_OUTOFMEMORY;
            }
            interface_data->engine = engine;
            interface_data->index = msg->iface.index;
            int is_auto = 0;
            interface_data->metric_v4 = get_interface_metric(msg->iface.index,
                                                             AF_INET, &is_auto);
            if (is_auto)
            {
                interface_data->metric_v4 = 0;
            }
            interface_data->metric_v6 = get_interface_metric(msg->iface.index,
                                                             AF_INET6, &is_auto);
            if (is_auto)
            {
                interface_data->metric_v6 = 0;
            }
            err = AddListItem(&(*lists)[block_dns], interface_data);
            if (!err)
            {
                err = set_interface_metric(msg->iface.index, AF_INET,
                                           BLOCK_DNS_IFACE_METRIC);
                if (!err)
                {
                    set_interface_metric(msg->iface.index, AF_INET6,
                                         BLOCK_DNS_IFACE_METRIC);
                }
            }
        }
    }
    else
    {
        interface_data = RemoveListItem(&(*lists)[block_dns], CmpEngine, NULL);
        if (interface_data)
        {
            engine = interface_data->engine;
            err = delete_block_dns_filters(engine);
            engine = NULL;
            if (interface_data->metric_v4 >= 0)
            {
                set_interface_metric(msg->iface.index, AF_INET,
                                     interface_data->metric_v4);
            }
            if (interface_data->metric_v6 >= 0)
            {
                set_interface_metric(msg->iface.index, AF_INET6,
                                     interface_data->metric_v6);
            }
            free(interface_data);
        }
        else
        {
            MsgToEventLog(M_ERR, TEXT("No previous block DNS filters to delete"));
        }
    }

    if (err && engine)
    {
        delete_block_dns_filters(engine);
    }

    return err;
}
static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
		int write)
{
	struct page *page;
	int ret;
	unsigned int gup_flags = FOLL_FORCE;

#ifdef CONFIG_STACK_GROWSUP
	if (write) {
		ret = expand_downwards(bprm->vma, pos);
		if (ret < 0)
			return NULL;
	}
#endif

	if (write)
		gup_flags |= FOLL_WRITE;

	/*
	 * We are doing an exec().  'current' is the process
	 * doing the exec and bprm->mm is the new process's mm.
	 */
	ret = get_user_pages_remote(current, bprm->mm, pos, 1, gup_flags,
			&page, NULL, NULL);
	if (ret <= 0)
		return NULL;

	if (write)
		acct_arg_size(bprm, vma_pages(bprm->vma));

	return page;
}
static void pairing_nodes_front_back_split(FriBidiPairingNode *source,
                                           /* output */
                                           FriBidiPairingNode **front,
                                           FriBidiPairingNode **back)
{
  FriBidiPairingNode *pfast, *pslow;
  if (!source || !source->next)
    {
      *front = source;
      *back = NULL;
    }
  else
    {
      pslow = source;
      pfast = source->next;
      while (pfast)
        {
          pfast= pfast->next;
          if (pfast)
            {
              pfast = pfast->next;
              pslow = pslow->next;
            }
        }
      *front = source;
      *back = pslow->next;
      pslow->next = NULL;
    }
}
static int is_git_directory(const char *suspect)
{
	char path[PATH_MAX];
	size_t len = strlen(suspect);

	strcpy(path, suspect);
	if (getenv(DB_ENVIRONMENT)) {
		if (access(getenv(DB_ENVIRONMENT), X_OK))
			return 0;
	}
	else {
		strcpy(path + len, "/objects");
		if (access(path, X_OK))
			return 0;
	}

	strcpy(path + len, "/refs");
	if (access(path, X_OK))
		return 0;

	strcpy(path + len, "/HEAD");
	if (validate_headref(path))
		return 0;

	return 1;
}
TABLE_LIST *LEX::parsed_derived_table(SELECT_LEX_UNIT *unit,
                                     int for_system_time,
                                     LEX_CSTRING *alias)
{
  TABLE_LIST *res;
  derived_tables|= DERIVED_SUBQUERY;
  unit->first_select()->set_linkage(DERIVED_TABLE_TYPE);

  // Add the subtree of subquery to the current SELECT_LEX
  SELECT_LEX *curr_sel= select_stack_head();
  DBUG_ASSERT(current_select == curr_sel ||
              (curr_sel == NULL && current_select == &builtin_select));

  Table_ident *ti= new (thd->mem_root) Table_ident(unit);
  if (ti == NULL)
    return NULL;
  if (!(res= curr_sel->add_table_to_list(thd, ti, alias, 0,
                                         TL_READ, MDL_SHARED_READ)))
    return NULL;
  if (for_system_time)
  {
    res->vers_conditions= vers_conditions;
  }
  return res;
}
static void tcp_mtup_probe_failed(struct sock *sk)
{
	struct inet_connection_sock *icsk = inet_csk(sk);

	icsk->icsk_mtup.search_high = icsk->icsk_mtup.probe_size - 1;
	icsk->icsk_mtup.probe_size = 0;
	NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMTUPFAIL);
}
static struct fuse_io_args *fuse_io_alloc(struct fuse_io_priv *io,
					  unsigned int npages)
{
	struct fuse_io_args *ia;

	ia = kzalloc(sizeof(*ia), GFP_KERNEL);
	if (ia) {
		ia->io = io;
		ia->ap.pages = fuse_pages_alloc(npages, GFP_KERNEL,
						&ia->ap.descs);
		if (!ia->ap.pages) {
			kfree(ia);
			ia = NULL;
		}
	}
	return ia;
}
static unsigned char asn1_octet_decode(struct asn1_ctx *ctx, unsigned char *ch)
{
	if (ctx->pointer >= ctx->end) {
		ctx->error = ASN1_ERR_DEC_EMPTY;
		return 0;
	}
	*ch = *(ctx->pointer)++;
	return 1;
}
httpClientNoticeRequestDelayed(TimeEventHandlerPtr event)
{
    HTTPRequestPtr request = *(HTTPRequestPtr*)event->data;
    httpClientNoticeRequest(request, 0);
    return 1;
}