idx
int64
func
string
target
int64
250,717
poppler_page_init (PopplerPage *page) { }
0
61,581
mrb_obj_singleton_methods_m(mrb_state *mrb, mrb_value self) { mrb_bool recur = TRUE; mrb_get_args(mrb, "|b", &recur); return mrb_obj_singleton_methods(mrb, recur, self); }
0
357,715
static int key_get_type_from_user(char *type, const char __user *_type, unsigned len) { int ret; ret = strncpy_from_user(type, _type, len); if (ret < 0) return -EFAULT; if (ret == 0 || ret >= len) return -EINVAL; if (type[0] == '.') return -EPERM; type[len - 1] = '\0'; return 0; }
0
307,191
bool NotificationsEngine::registerDBusService() { QDBusConnection dbus = QDBusConnection::sessionBus(); bool so = dbus.registerService(QStringLiteral("org.freedesktop.Notifications")); if (so) { bool ro = dbus.registerObject(QStringLiteral("/org/freedesktop/Notifications"), this); if (ro) { qDebug() << "Notifications service registered"; return true; } else { dbus.unregisterService(QStringLiteral("org.freedesktop.Notifications")); } } qDebug() << "Failed to register Notifications service"; return false; }
0
97,840
writeSWFShapeBlockToMethod(SWFBlock block, SWFByteOutputMethod method, void* data) { SWFOutput out = ((SWFShape)block)->out; SWFOutput_writeToMethod(out, method, data); }
0
316,394
static bool CombineClip(const ClipPaintPropertyNode* clip, FloatRoundedRect& combined_clip_rect) { if (clip->Parent()->ClipPath()) return false; if (clip->LocalTransformSpace() != clip->Parent()->LocalTransformSpace() && !GeometryMapper::SourceToDestinationProjection( clip->Parent()->LocalTransformSpace(), clip->LocalTransformSpace()) .IsIdentity()) return false; bool clip_is_rounded = clip->ClipRect().IsRounded(); bool combined_is_rounded = combined_clip_rect.IsRounded(); if (clip_is_rounded && combined_is_rounded) return false; if (combined_is_rounded) return clip->ClipRect().Rect().Contains(combined_clip_rect.Rect()); if (clip_is_rounded) { if (combined_clip_rect.Rect().Contains(clip->ClipRect().Rect())) { combined_clip_rect = clip->ClipRect(); return true; } return false; } DCHECK(!combined_is_rounded && !clip_is_rounded); combined_clip_rect = FloatRoundedRect( Intersection(combined_clip_rect.Rect(), clip->ClipRect().Rect())); return true; }
0
76,319
static void kvm_ioapic_inject_all(struct kvm_ioapic *ioapic, unsigned long irr) { u32 idx; rtc_irq_eoi_tracking_reset(ioapic); for_each_set_bit(idx, &irr, IOAPIC_NUM_PINS) ioapic_set_irq(ioapic, idx, 1, true); kvm_rtc_eoi_tracking_restore_all(ioapic); }
0
30
TEST_F ( WebUsbDetectorTest , ThreeUsbDevicesAddedAndRemoved ) { base : : string16 product_name_1 = base : : UTF8ToUTF16 ( kProductName_1 ) ; GURL landing_page_1 ( kLandingPage_1 ) ; scoped_refptr < device : : MockUsbDevice > device_1 ( new device : : MockUsbDevice ( 0 , 1 , "Google" , kProductName_1 , "002" , landing_page_1 ) ) ; std : : string guid_1 = device_1 -> guid ( ) ; base : : string16 product_name_2 = base : : UTF8ToUTF16 ( kProductName_2 ) ; GURL landing_page_2 ( kLandingPage_2 ) ; scoped_refptr < device : : MockUsbDevice > device_2 ( new device : : MockUsbDevice ( 3 , 4 , "Google" , kProductName_2 , "005" , landing_page_2 ) ) ; std : : string guid_2 = device_2 -> guid ( ) ; base : : string16 product_name_3 = base : : UTF8ToUTF16 ( kProductName_3 ) ; GURL landing_page_3 ( kLandingPage_3 ) ; scoped_refptr < device : : MockUsbDevice > device_3 ( new device : : MockUsbDevice ( 6 , 7 , "Google" , kProductName_3 , "008" , landing_page_3 ) ) ; std : : string guid_3 = device_3 -> guid ( ) ; Initialize ( ) ; device_client_ . usb_service ( ) -> AddDevice ( device_1 ) ; message_center : : Notification * notification_1 = message_center_ -> FindVisibleNotificationById ( guid_1 ) ; ASSERT_TRUE ( notification_1 != nullptr ) ; base : : string16 expected_title_1 = base : : ASCIIToUTF16 ( "Google Product A detected" ) ; EXPECT_EQ ( expected_title_1 , notification_1 -> title ( ) ) ; base : : string16 expected_message_1 = base : : ASCIIToUTF16 ( "Go to www.google.com/A to connect." ) ; EXPECT_EQ ( expected_message_1 , notification_1 -> message ( ) ) ; EXPECT_TRUE ( notification_1 -> delegate ( ) != nullptr ) ; device_client_ . usb_service ( ) -> RemoveDevice ( device_1 ) ; EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_1 ) == nullptr ) ; device_client_ . usb_service ( ) -> AddDevice ( device_2 ) ; message_center : : Notification * notification_2 = message_center_ -> FindVisibleNotificationById ( guid_2 ) ; ASSERT_TRUE ( notification_2 != nullptr ) ; base : : string16 expected_title_2 = base : : ASCIIToUTF16 ( "Google Product B detected" ) ; EXPECT_EQ ( expected_title_2 , notification_2 -> title ( ) ) ; base : : string16 expected_message_2 = base : : ASCIIToUTF16 ( "Go to www.google.com/B to connect." ) ; EXPECT_EQ ( expected_message_2 , notification_2 -> message ( ) ) ; EXPECT_TRUE ( notification_2 -> delegate ( ) != nullptr ) ; device_client_ . usb_service ( ) -> RemoveDevice ( device_2 ) ; EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_2 ) == nullptr ) ; device_client_ . usb_service ( ) -> AddDevice ( device_3 ) ; message_center : : Notification * notification_3 = message_center_ -> FindVisibleNotificationById ( guid_3 ) ; ASSERT_TRUE ( notification_3 != nullptr ) ; base : : string16 expected_title_3 = base : : ASCIIToUTF16 ( "Google Product C detected" ) ; EXPECT_EQ ( expected_title_3 , notification_3 -> title ( ) ) ; base : : string16 expected_message_3 = base : : ASCIIToUTF16 ( "Go to www.google.com/C to connect." ) ; EXPECT_EQ ( expected_message_3 , notification_3 -> message ( ) ) ; EXPECT_TRUE ( notification_3 -> delegate ( ) != nullptr ) ; device_client_ . usb_service ( ) -> RemoveDevice ( device_3 ) ; EXPECT_TRUE ( message_center_ -> FindVisibleNotificationById ( guid_3 ) == nullptr ) ; }
1
430,208
void Downstream::inspect_http1_response() { auto transfer_encoding = resp_.fs.header(http2::HD_TRANSFER_ENCODING); if (transfer_encoding) { resp_.fs.content_length = -1; if (util::iends_with_l(transfer_encoding->value, "chunked")) { chunked_response_ = true; } } }
0
45,321
int wc_ecc_copy_point(ecc_point* p, ecc_point *r) { int ret; /* prevents null arguments */ if (p == NULL || r == NULL) return ECC_BAD_ARG_E; ret = mp_copy(p->x, r->x); if (ret != MP_OKAY) return ret; ret = mp_copy(p->y, r->y); if (ret != MP_OKAY) return ret; ret = mp_copy(p->z, r->z); if (ret != MP_OKAY) return ret; return MP_OKAY; }
0
333,418
static void msvideo1_decode_8bit(Msvideo1Context *s) { int block_ptr, pixel_ptr; int total_blocks; int pixel_x, pixel_y; /* pixel width and height iterators */ int block_x, block_y; /* block width and height iterators */ int blocks_wide, blocks_high; /* width and height in 4x4 blocks */ int block_inc; int row_dec; /* decoding parameters */ int stream_ptr; unsigned char byte_a, byte_b; unsigned short flags; int skip_blocks; unsigned char colors[8]; unsigned char *pixels = s->frame.data[0]; unsigned char *prev_pixels = s->prev_frame.data[0]; int stride = s->frame.linesize[0]; stream_ptr = 0; skip_blocks = 0; blocks_wide = s->avctx->width / 4; blocks_high = s->avctx->height / 4; total_blocks = blocks_wide * blocks_high; block_inc = 4; row_dec = stride + 4; for (block_y = blocks_high; block_y > 0; block_y--) { block_ptr = ((block_y * 4) - 1) * stride; for (block_x = blocks_wide; block_x > 0; block_x--) { /* check if this block should be skipped */ if (skip_blocks) { COPY_PREV_BLOCK(); block_ptr += block_inc; skip_blocks--; total_blocks--; continue; } pixel_ptr = block_ptr; /* get the next two bytes in the encoded data stream */ CHECK_STREAM_PTR(2); byte_a = s->buf[stream_ptr++]; byte_b = s->buf[stream_ptr++]; /* check if the decode is finished */ if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0)) return; else if ((byte_b & 0xFC) == 0x84) { /* skip code, but don't count the current block */ skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1; COPY_PREV_BLOCK(); } else if (byte_b < 0x80) { /* 2-color encoding */ flags = (byte_b << 8) | byte_a; CHECK_STREAM_PTR(2); colors[0] = s->buf[stream_ptr++]; colors[1] = s->buf[stream_ptr++]; for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1) pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1]; pixel_ptr -= row_dec; } } else if (byte_b >= 0x90) { /* 8-color encoding */ flags = (byte_b << 8) | byte_a; CHECK_STREAM_PTR(8); memcpy(colors, &s->buf[stream_ptr], 8); stream_ptr += 8; for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1) pixels[pixel_ptr++] = colors[((pixel_y & 0x2) << 1) + (pixel_x & 0x2) + ((flags & 0x1) ^ 1)]; pixel_ptr -= row_dec; } } else { /* 1-color encoding */ colors[0] = byte_a; for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++) pixels[pixel_ptr++] = colors[0]; pixel_ptr -= row_dec; } } block_ptr += block_inc; total_blocks--; } } /* make the palette available on the way out */ if (s->avctx->pix_fmt == PIX_FMT_PAL8) memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4); }
0
410,863
THEME_REC *theme_load(const char *setname) { THEME_REC *theme, *oldtheme; struct stat statbuf; char *fname, *name, *p; name = g_strdup(setname); p = strrchr(name, '.'); if (p != NULL && strcmp(p, ".theme") == 0) { /* remove the trailing .theme */ *p = '\0'; } theme = theme_find(name); /* check home dir */ fname = g_strdup_printf("%s/%s.theme", get_irssi_dir(), name); if (stat(fname, &statbuf) != 0) { /* check global config dir */ g_free(fname); fname = g_strdup_printf(THEMESDIR"/%s.theme", name); if (stat(fname, &statbuf) != 0) { /* theme not found */ g_free(fname); g_free(name); return theme; /* use the one in memory if possible */ } } if (theme != NULL && theme->last_modify == statbuf.st_mtime) { /* theme not modified, use the one already in memory */ g_free(fname); g_free(name); return theme; } oldtheme = theme; theme = theme_create(fname, name); theme->last_modify = statbuf.st_mtime; if (!theme_read(theme, theme->path, NULL)) { /* error reading .theme file */ theme_destroy(theme); theme = NULL; } if (oldtheme != NULL && theme != NULL) { theme_destroy(oldtheme); window_themes_update(); } g_free(fname); g_free(name); return theme; }
0
98,005
static void do_foot(HttpResponse res) { StringBuffer_append(res->outputbuffer, "</center></div></div>" "<div id='footer'>" "Copyright &copy; 2001-2018 <a href=\"http://tildeslash.com/\">Tildeslash</a>. All rights reserved. " "<span style='margin-left:5px;'></span>" "<a href=\"http://mmonit.com/monit/\">Monit web site</a> | " "<a href=\"http://mmonit.com/wiki/\">Monit Wiki</a> | " "<a href=\"http://mmonit.com/\">M/Monit</a>" "</div></body></html>"); }
0
391,285
PHP_FUNCTION(xml_get_current_line_number) { xml_parser *parser; zval *pind; if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pind) == FAILURE) { return; } if ((parser = (xml_parser *)zend_fetch_resource(Z_RES_P(pind), "XML Parser", le_xml_parser)) == NULL) { RETURN_FALSE; } RETVAL_LONG(XML_GetCurrentLineNumber(parser->parser)); }
0
155,402
combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols, uint32 rows, uint32 imagewidth, uint32 tw, uint16 spp, uint16 bps, FILE *dumpfile, int format, int level) { int ready_bits = 0; uint32 src_rowsize, dst_rowsize, src_offset; uint32 bit_offset; uint32 row, col, src_byte = 0, src_bit = 0; uint8 maskbits = 0, matchbits = 0; uint8 buff1 = 0, buff2 = 0; tsample_t s; unsigned char *src = in[0]; unsigned char *dst = out; char action[32]; if ((src == NULL) || (dst == NULL)) { TIFFError("combineSeparateTileSamples8bits","Invalid input or output buffer"); return (1); } src_rowsize = ((bps * tw) + 7) / 8; dst_rowsize = ((imagewidth * bps * spp) + 7) / 8; maskbits = (uint8)-1 >> ( 8 - bps); for (row = 0; row < rows; row++) { ready_bits = 0; buff1 = buff2 = 0; dst = out + (row * dst_rowsize); src_offset = row * src_rowsize; for (col = 0; col < cols; col++) { /* Compute src byte(s) and bits within byte(s) */ bit_offset = col * bps; src_byte = bit_offset / 8; src_bit = bit_offset % 8; matchbits = maskbits << (8 - src_bit - bps); /* load up next sample from each plane */ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++) { src = in[s] + src_offset + src_byte; buff1 = ((*src) & matchbits) << (src_bit); /* If we have a full buffer's worth, write it out */ if (ready_bits >= 8) { *dst++ = buff2; buff2 = buff1; ready_bits -= 8; strcpy (action, "Flush"); } else { buff2 = (buff2 | (buff1 >> ready_bits)); strcpy (action, "Update"); } ready_bits += bps; if ((dumpfile != NULL) && (level == 3)) { dump_info (dumpfile, format, "", "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d", row + 1, col + 1, s, src_byte, src_bit, dst - out); dump_byte (dumpfile, format, "Match bits", matchbits); dump_byte (dumpfile, format, "Src bits", *src); dump_byte (dumpfile, format, "Buff1 bits", buff1); dump_byte (dumpfile, format, "Buff2 bits", buff2); dump_info (dumpfile, format, "","%s", action); } } } if (ready_bits > 0) { buff1 = (buff2 & ((unsigned int)255 << (8 - ready_bits))); *dst++ = buff1; if ((dumpfile != NULL) && (level == 3)) { dump_info (dumpfile, format, "", "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d", row + 1, col + 1, src_byte, src_bit, dst - out); dump_byte (dumpfile, format, "Final bits", buff1); } } if ((dumpfile != NULL) && (level >= 2)) { dump_info (dumpfile, format, "combineSeparateTileSamples8bits","Output data"); dump_buffer(dumpfile, format, 1, dst_rowsize, row, out + (row * dst_rowsize)); } } return (0); } /* end combineSeparateTileSamples8bits */
0
464,313
static u32 gfar_get_flowctrl_cfg(struct gfar_private *priv) { struct net_device *ndev = priv->ndev; struct phy_device *phydev = ndev->phydev; u32 val = 0; if (!phydev->duplex) return val; if (!priv->pause_aneg_en) { if (priv->tx_pause_en) val |= MACCFG1_TX_FLOW; if (priv->rx_pause_en) val |= MACCFG1_RX_FLOW; } else { u16 lcl_adv, rmt_adv; u8 flowctrl; /* get link partner capabilities */ rmt_adv = 0; if (phydev->pause) rmt_adv = LPA_PAUSE_CAP; if (phydev->asym_pause) rmt_adv |= LPA_PAUSE_ASYM; lcl_adv = linkmode_adv_to_lcl_adv_t(phydev->advertising); flowctrl = mii_resolve_flowctrl_fdx(lcl_adv, rmt_adv); if (flowctrl & FLOW_CTRL_TX) val |= MACCFG1_TX_FLOW; if (flowctrl & FLOW_CTRL_RX) val |= MACCFG1_RX_FLOW; } return val; }
0
158,590
void WebContents::SetAudioMuted(bool muted) { web_contents()->SetAudioMuted(muted); }
0
77,759
int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen) { struct inet_connection_sock *icsk = inet_csk(sk); if (level != SOL_TCP) return icsk->icsk_af_ops->setsockopt(sk, level, optname, optval, optlen); return do_tcp_setsockopt(sk, level, optname, optval, optlen); }
0
301,821
static gcry_cipher_hd_t network_get_aes256_cypher (sockent_t *se, /* {{{ */ const void *iv, size_t iv_size, const char *username) { gcry_error_t err; gcry_cipher_hd_t *cyper_ptr; unsigned char password_hash[32]; if (se->type == SOCKENT_TYPE_CLIENT) { cyper_ptr = &se->data.client.cypher; memcpy (password_hash, se->data.client.password_hash, sizeof (password_hash)); } else { char *secret; cyper_ptr = &se->data.server.cypher; if (username == NULL) return (NULL); secret = fbh_get (se->data.server.userdb, username); if (secret == NULL) return (NULL); gcry_md_hash_buffer (GCRY_MD_SHA256, password_hash, secret, strlen (secret)); sfree (secret); } if (*cyper_ptr == NULL) { err = gcry_cipher_open (cyper_ptr, GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_OFB, /* flags = */ 0); if (err != 0) { ERROR ("network plugin: gcry_cipher_open returned: %s", gcry_strerror (err)); *cyper_ptr = NULL; return (NULL); } } else { gcry_cipher_reset (*cyper_ptr); } assert (*cyper_ptr != NULL); err = gcry_cipher_setkey (*cyper_ptr, password_hash, sizeof (password_hash)); if (err != 0) { ERROR ("network plugin: gcry_cipher_setkey returned: %s", gcry_strerror (err)); gcry_cipher_close (*cyper_ptr); *cyper_ptr = NULL; return (NULL); } err = gcry_cipher_setiv (*cyper_ptr, iv, iv_size); if (err != 0) { ERROR ("network plugin: gcry_cipher_setkey returned: %s", gcry_strerror (err)); gcry_cipher_close (*cyper_ptr); *cyper_ptr = NULL; return (NULL); } return (*cyper_ptr); } /* }}} int network_get_aes256_cypher */
0
276,986
void FailLoading() { data_provider()->DidFail(response_generator_->GenerateError()); base::RunLoop().RunUntilIdle(); }
0
172,867
cmd_http_timeout(CMD_ARGS) { struct http *hp; (void)cmd; (void)vl; CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC); AN(av[1]); AZ(av[2]); hp->timeout = (int)(strtod(av[1], NULL) * 1000.0); }
0
54,542
Status GetOutputDTypes(EagerOperation* op, DataTypeVector* output_dtypes) { const auto& node_def = op->MutableAttrs()->BuildNodeDef(); const OpDef* op_def = nullptr; const FunctionDef* function_def = op->EagerContext().FuncLibDef()->Find(op->Name()); if (function_def != nullptr) { op_def = &(function_def->signature()); } else { TF_RETURN_IF_ERROR(OpDefForOp(op->Name().c_str(), &op_def)); } TF_RETURN_IF_ERROR(OutputTypesForNode(node_def, *op_def, output_dtypes)); return Status::OK(); }
0
248,632
void ThreadableBlobRegistry::finalizeStream(const KURL& url) void BlobRegistry::finalizeStream(const KURL& url) { if (isMainThread()) { if (WebBlobRegistry* registry = blobRegistry()) registry->finalizeStream(url); } else { OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url)); callOnMainThread(&finalizeStreamTask, context.leakPtr()); } }
0
291,336
off_t PackLinuxElf64::pack3(OutputFile *fo, Filter &ft) { off_t flen = super::pack3(fo, ft); // loader follows compressed PT_LOADs // NOTE: PackLinuxElf::pack3 adjusted xct_off for the extra page unsigned v_hole = sz_pack2 + lsize; set_te64(&elfout.phdr[C_TEXT].p_filesz, v_hole); set_te64(&elfout.phdr[C_TEXT].p_memsz, v_hole); // Then compressed gaps (including debuginfo.) for (unsigned k = 0; k < e_phnum; ++k) { Extent x; x.size = find_LOAD_gap(phdri, k, e_phnum); if (x.size) { x.offset = get_te64(&phdri[k].p_offset) + get_te64(&phdri[k].p_filesz); packExtent(x, nullptr, fo); } } // write block end marker (uncompressed size 0) b_info hdr; memset(&hdr, 0, sizeof(hdr)); set_le32(&hdr.sz_cpr, UPX_MAGIC_LE32); fo->write(&hdr, sizeof(hdr)); flen = fpad4(fo); set_te64(&elfout.phdr[C_TEXT].p_filesz, sz_pack2 + lsize); set_te64(&elfout.phdr[C_TEXT].p_memsz, sz_pack2 + lsize); if (0==xct_off) { // not shared library set_te64(&elfout.phdr[C_BASE].p_align, ((upx_uint64_t)0) - page_mask); elfout.phdr[C_BASE].p_paddr = elfout.phdr[C_BASE].p_vaddr; elfout.phdr[C_BASE].p_offset = 0; upx_uint64_t abrk = getbrk(phdri, e_phnum); // vbase handles ET_EXEC. FIXME: pre-linking? upx_uint64_t const vbase = get_te64(&elfout.phdr[C_BASE].p_vaddr); set_te64(&elfout.phdr[C_BASE].p_filesz, 0x1000); // Linux kernel SIGSEGV if (0==.p_filesz) set_te64(&elfout.phdr[C_BASE].p_memsz, abrk - vbase); set_te32(&elfout.phdr[C_BASE].p_flags, Elf32_Phdr::PF_W|Elf32_Phdr::PF_R); set_te64(&elfout.phdr[C_TEXT].p_vaddr, abrk= (page_mask & (~page_mask + abrk))); elfout.phdr[C_TEXT].p_paddr = elfout.phdr[C_TEXT].p_vaddr; set_te64(&elfout.ehdr.e_entry, abrk + get_te64(&elfout.ehdr.e_entry) - vbase); } if (0!=xct_off) { // shared library upx_uint64_t word = load_va + sz_pack2; set_te64(&file_image[user_init_off], word); // set the hook Elf64_Phdr *phdr = (Elf64_Phdr *)lowmem.subref( "bad e_phoff", e_phoff, e_phnum * sizeof(Elf64_Phdr)); unsigned off = fo->st_size(); so_slide = 0; for (unsigned j = 0; j < e_phnum; ++j, ++phdr) { upx_uint64_t const len = get_te64(&phdr->p_filesz); upx_uint64_t const ioff = get_te64(&phdri[j].p_offset); upx_uint64_t align= get_te64(&phdr->p_align); unsigned const type = get_te32(&phdr->p_type); if (Elf64_Phdr::PT_INTERP==type) { // Rotate to highest position, so it can be lopped // by decrementing e_phnum. memcpy((unsigned char *)ibuf, phdr, sizeof(*phdr)); // extract memmove(phdr, 1+phdr, (e_phnum - (1+ j))*sizeof(*phdr)); // overlapping memcpy(&phdr[e_phnum - (1+ j)], (unsigned char *)ibuf, sizeof(*phdr)); // to top --phdr; --e_phnum; set_te16(&ehdri.e_phnum, e_phnum); set_te16(&((Elf64_Ehdr *)(unsigned char *)lowmem)->e_phnum, e_phnum); continue; } if (PT_LOAD64 == type) { if ((xct_off - ioff) < len) { // Change length of compressed PT_LOAD. set_te64(&phdr->p_filesz, sz_pack2 + lsize - ioff); set_te64(&phdr->p_memsz, sz_pack2 + lsize - ioff); if (user_init_off < xct_off) { // MIPS puts PT_DYNAMIC here // Allow for DT_INIT in a new [stolen] slot unsigned off2 = user_init_off - sizeof(word); fo->seek(off2, SEEK_SET); fo->rewrite(&file_image[off2], 2*sizeof(word)); } } else if (xct_off < ioff) { // Slide subsequent PT_LOAD. // AMD64 chip supports page sizes of 4KiB, 2MiB, and 1GiB; // the operating system chooses one. .p_align typically // is a forward-looking 2MiB. In 2009 Linux chooses 4KiB. // We choose 4KiB to waste less space. If Linux chooses // 2MiB later, then our output will not run. if ((1u<<12) < align && Elf64_Ehdr::EM_X86_64 ==e_machine ) { align = 1u<<12; set_te64(&phdr->p_align, align); } off += (align-1) & (ioff - off); set_te64(&phdr->p_offset, off); so_slide = off - ioff; fo->seek( off, SEEK_SET); fo->write(&file_image[ioff], len); off += len; } continue; // all done with this PT_LOAD } if (xct_off < ioff) set_te64(&phdr->p_offset, so_slide + ioff); } // end each Phdr if (opt->o_unix.android_shlib) { // Update {DYNAMIC}.sh_offset by so_slide. Elf64_Shdr *shdr = (Elf64_Shdr *)lowmem.subref( "bad e_shoff", xct_off - asl_delta, e_shnum * sizeof(Elf64_Shdr)); for (unsigned j = 0; j < e_shnum; ++shdr, ++j) { unsigned sh_type = get_te32(&shdr->sh_type); if (Elf64_Shdr::SHT_DYNAMIC == sh_type) { upx_uint64_t offset = get_te64(&shdr->sh_offset); set_te64(&shdr->sh_offset, so_slide + offset); fo->seek((j * sizeof(Elf64_Shdr)) + xct_off - asl_delta, SEEK_SET); fo->rewrite(shdr, sizeof(*shdr)); fo->seek(0, SEEK_END); } if (Elf64_Shdr::SHT_RELA == sh_type && n_jmp_slot && !strcmp(".rela.plt", get_te32(&shdr->sh_name) + shstrtab)) { upx_uint64_t f_off = elf_get_offset_from_address(plt_off); fo->seek(so_slide + f_off, SEEK_SET); // FIXME: assumes PT_LOAD[1] fo->rewrite(&file_image[f_off], n_jmp_slot * 8); } } } else { // !opt->o_unix.android_shlib) ehdri.e_shnum = 0; ehdri.e_shoff = 0; ehdri.e_shstrndx = 0; } } return flen; }
0
500,318
static void do_show_obj(QPDF& pdf, Options& o, int& exit_code) { QPDFObjectHandle obj; if (o.show_trailer) { obj = pdf.getTrailer(); } else { obj = pdf.getObjectByID(o.show_obj, o.show_gen); } if (obj.isStream()) { if (o.show_raw_stream_data || o.show_filtered_stream_data) { bool filter = o.show_filtered_stream_data; if (filter && (! obj.pipeStreamData(0, 0, qpdf_dl_all))) { QTC::TC("qpdf", "qpdf unable to filter"); std::cerr << "Unable to filter stream data." << std::endl; exit_code = EXIT_ERROR; } else { QUtil::binary_stdout(); Pl_StdioFile out("stdout", stdout); obj.pipeStreamData( &out, (filter && o.normalize) ? qpdf_ef_normalize : 0, filter ? qpdf_dl_all : qpdf_dl_none); } } else { std::cout << "Object is stream. Dictionary:" << std::endl << obj.getDict().unparseResolved() << std::endl; } } else { std::cout << obj.unparseResolved() << std::endl; } }
0
214,859
static inline int build_assignment_string(smart_str *querystr, HashTable *ht, int where_cond, const char *pad, int pad_len TSRMLS_DC) { HashPosition pos; uint fld_len; int key_type; ulong num_idx; char *fld; char buf[256]; zval **val; for (zend_hash_internal_pointer_reset_ex(ht, &pos); zend_hash_get_current_data_ex(ht, (void **)&val, &pos) == SUCCESS; zend_hash_move_forward_ex(ht, &pos)) { key_type = zend_hash_get_current_key_ex(ht, &fld, &fld_len, &num_idx, 0, &pos); if (key_type == HASH_KEY_IS_LONG) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted"); return -1; } smart_str_appendl(querystr, fld, fld_len - 1); if (where_cond && Z_TYPE_PP(val) == IS_STRING && !strcmp(Z_STRVAL_PP(val), "NULL")) { smart_str_appends(querystr, " IS "); } else { smart_str_appendc(querystr, '='); } switch(Z_TYPE_PP(val)) { case IS_STRING: smart_str_appendl(querystr, Z_STRVAL_PP(val), Z_STRLEN_PP(val)); break; case IS_LONG: smart_str_append_long(querystr, Z_LVAL_PP(val)); break; case IS_DOUBLE: smart_str_appendl(querystr, buf, MIN(snprintf(buf, sizeof(buf), "%F", Z_DVAL_PP(val)), sizeof(buf)-1)); break; default: /* should not happen */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values other than NULL. Need to convert?"); return -1; } smart_str_appendl(querystr, pad, pad_len); } querystr->len -= pad_len; return 0; }
0
8,619
qedi_dbg_err(struct qedi_dbg_ctx *qedi, const char *func, u32 line, const char *fmt, ...) { va_list va; struct va_format vaf; char nfunc[32]; memset(nfunc, 0, sizeof(nfunc)); memcpy(nfunc, func, sizeof(nfunc) - 1); va_start(va, fmt); vaf.fmt = fmt; vaf.va = &va; if (likely(qedi) && likely(qedi->pdev)) pr_err("[%s]:[%s:%d]:%d: %pV", dev_name(&qedi->pdev->dev), nfunc, line, qedi->host_no, &vaf); else pr_err("[0000:00:00.0]:[%s:%d]: %pV", nfunc, line, &vaf); va_end(va); }
1
348,664
void undefer_input(__G) __GDEF { if (G.incnt > 0) G.csize += G.incnt; if (G.incnt_leftover > 0) { /* We know that "(G.csize < MAXINT)" so we can cast G.csize to int: * This condition was checked when G.incnt_leftover was set > 0 in * defer_leftover_input(), and it is NOT allowed to touch G.csize * before calling undefer_input() when (G.incnt_leftover > 0) * (single exception: see read_byte()'s "G.csize <= 0" handling) !! */ G.incnt = G.incnt_leftover + (int)G.csize; G.inptr = G.inptr_leftover - (int)G.csize; G.incnt_leftover = 0; } else if (G.incnt < 0) G.incnt = 0; } /* end function undefer_input() */
1
76,917
ModuleExport void UnregisterPWPImage(void) { (void) UnregisterMagickInfo("PWP"); }
0
416,335
static int hidp_session_wake_function(wait_queue_entry_t *wait, unsigned int mode, int sync, void *key) { wake_up_interruptible(&hidp_session_wq); return false; }
0
287,324
error_t httpClientFormatAuthorizationField(HttpClientContext *context) { size_t n; char_t *p; HttpClientAuthParams *authParams; //Make sure the buffer contains a valid HTTP request if(context->bufferLen < 2 || context->bufferLen > HTTP_CLIENT_BUFFER_SIZE) return ERROR_INVALID_SYNTAX; //Point to the HTTP authentication parameters authParams = &context->authParams; #if (HTTP_CLIENT_BASIC_AUTH_SUPPORT == ENABLED) //Basic authentication scheme? if(authParams->mode == HTTP_AUTH_MODE_BASIC) { size_t k; size_t m; //Calculate the length of the username and password n = osStrlen(authParams->username) + osStrlen(authParams->password); //Make sure the buffer is large enough if((context->bufferLen + n + 22) > HTTP_CLIENT_BUFFER_SIZE) return ERROR_BUFFER_OVERFLOW; //Point to the buffer where to format the Authorization header field p = context->buffer + context->bufferLen - 2; //Format Authorization header field n = osSprintf(p, "Authorization: Basic "); //The client sends the username and password, separated by a single //colon character, within a Base64-encoded string in the credentials m = osSprintf(p + n, "%s:%s", authParams->username, authParams->password); //The first pass calculates the length of the Base64-encoded string base64Encode(p + n, m, NULL, &k); //Make sure the buffer is large enough if((context->bufferLen + n + k) > HTTP_CLIENT_BUFFER_SIZE) return ERROR_BUFFER_OVERFLOW; //The second pass encodes the string using Base64 base64Encode(p + n, m, p + n, &k); //Update the total length of the header field n += k; //Make sure the buffer is large enough if((context->bufferLen + n + 2) > HTTP_CLIENT_BUFFER_SIZE) return ERROR_BUFFER_OVERFLOW; //Terminate the header field with a CRLF sequence osSprintf(p + n, "\r\n\r\n"); //Adjust the length of the request header context->bufferLen = context->bufferLen + n + 2; } else #endif #if (HTTP_CLIENT_DIGEST_AUTH_SUPPORT == ENABLED) //Digest authentication scheme? if(authParams->mode == HTTP_AUTH_MODE_DIGEST) { error_t error; const char_t *q; const char_t *uri; size_t uriLen; char_t response[HTTP_CLIENT_MAX_RESPONSE_LEN + 1]; //Properly terminate the string with a NULL character context->buffer[context->bufferLen] = '\0'; //The Request-Line begins with a method token q = strchr(context->buffer, ' '); //Any parsing error? if(q == NULL) return ERROR_INVALID_SYNTAX; //The method token is followed by the Request-URI uri = q + 1; //Point to the end of the Request-URI q = strchr(uri, ' '); //Any parsing error? if(q == NULL) return ERROR_INVALID_SYNTAX; //Compute the length of the current URI uriLen = q - uri; //Check quality of protection if(authParams->qop == HTTP_AUTH_QOP_AUTH || authParams->qop == HTTP_AUTH_QOP_AUTH_INT) { //Make sure that a valid callback function has been registered if(context->randCallback == NULL) return ERROR_PRNG_NOT_READY; //A cryptographically strong random number generator must be used to //generate the cnonce error = context->randCallback(authParams->cnonce, HTTP_CLIENT_CNONCE_SIZE); //Any error to report? if(error) return error; //Convert the byte array to hex string httpEncodeHexString(authParams->cnonce, HTTP_CLIENT_CNONCE_SIZE, authParams->cnonce); //Count of the number of requests (including the current request) //that the client has sent with the nonce value in this request authParams->nc++; } //Perform digest operation error = httpClientComputeDigest(authParams, context->method, osStrlen(context->method), uri, uriLen, response); //Any error to report? if(error) return error; //Determine the length of the header field n = osStrlen(authParams->username) + osStrlen(authParams->realm) + uriLen + osStrlen(authParams->nonce) + osStrlen(authParams->cnonce) + osStrlen(response) + osStrlen(authParams->opaque); //Make sure the buffer is large enough if((context->bufferLen + n + 121) > HTTP_CLIENT_BUFFER_SIZE) return ERROR_BUFFER_OVERFLOW; //Point to the buffer where to format the Authorization header field p = context->buffer + context->bufferLen - 2; //Format Authorization header field n = osSprintf(p, "Authorization: Digest "); //Format username and realm parameter n += osSprintf(p + n, "username=\"%s\", ", authParams->username); n += osSprintf(p + n, "realm=\"%s\", ", authParams->realm); //Format uri parameter n += osSprintf(p + n, "uri=\""); osStrncpy(p + n, uri, uriLen); n += uriLen; n += osSprintf(p + n, "\", "); //Format nonce parameter n += osSprintf(p + n, "nonce=\"%s\", ", authParams->nonce); //Check quality of protection if(authParams->qop == HTTP_AUTH_QOP_AUTH) { //Format qop, nc, cnonce parameters n += osSprintf(p + n, "qop=auth, "); n += osSprintf(p + n, "nc=%08x, ", authParams->nc); n += osSprintf(p + n, "cnonce=\"%s\", ", authParams->cnonce); } //Format response parameter n += osSprintf(p + n, "response=\"%s\"", response); //The opaque parameter should be returned by the client unchanged in //the Authorization header field of subsequent requests if(authParams->opaque[0] != '\0') { //Format opaque parameter n += osSprintf(p + n, ", opaque=\"%s\"", authParams->opaque); } //Terminate the header field with a CRLF sequence osSprintf(p + n, "\r\n\r\n"); //Adjust the length of the request header context->bufferLen = context->bufferLen + n + 2; } else #endif //Unknown authentication scheme? { //Just for sanity } //Successful processing return NO_ERROR; }
1
205,277
error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) { const volatile gles2::cmds::TraceBeginCHROMIUM& c = *static_cast<const volatile gles2::cmds::TraceBeginCHROMIUM*>(cmd_data); Bucket* category_bucket = GetBucket(c.category_bucket_id); Bucket* name_bucket = GetBucket(c.name_bucket_id); static constexpr size_t kMaxStrLen = 256; if (!category_bucket || category_bucket->size() == 0 || category_bucket->size() > kMaxStrLen || !name_bucket || name_bucket->size() == 0 || name_bucket->size() > kMaxStrLen) { return error::kInvalidArguments; } std::string category_name; std::string trace_name; if (!category_bucket->GetAsString(&category_name) || !name_bucket->GetAsString(&trace_name)) { return error::kInvalidArguments; } debug_marker_manager_.PushGroup(trace_name); if (!gpu_tracer_->Begin(category_name, trace_name, kTraceCHROMIUM)) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, "glTraceBeginCHROMIUM", "unable to create begin trace"); return error::kNoError; } return error::kNoError; }
0
369,040
xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { int len = 0, l; int c; int count = 0; #ifdef DEBUG nbParseNCNameComplex++; #endif /* * Handler for more complex cases */ GROW; c = CUR_CHAR(l); if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */ (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) { return(NULL); } while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */ (xmlIsNameChar(ctxt, c) && (c != ':'))) { if (count++ > XML_PARSER_CHUNK_SIZE) { if ((len > XML_MAX_NAME_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); return(NULL); } count = 0; GROW; if (ctxt->instate == XML_PARSER_EOF) return(NULL); } len += l; NEXTL(l); c = CUR_CHAR(l); if (c == 0) { count = 0; GROW; if (ctxt->instate == XML_PARSER_EOF) return(NULL); c = CUR_CHAR(l); } } if ((len > XML_MAX_NAME_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); return(NULL); } return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len)); }
0
169,877
void WebFrameLoaderClient::frameLoaderDestroyed() { webframe_->Closing(); webframe_->Release(); }
0
113,031
static bool link_kind_filtered(const struct net_device *dev, const struct rtnl_link_ops *kind_ops) { if (kind_ops && dev->rtnl_link_ops != kind_ops) return true; return false; }
0
187,509
SelectionInDOMTree createSelection(const size_t start, const size_t end, const bool isDirectional, Element* element) { const EphemeralRange& startRange = PlainTextRange(0, static_cast<int>(start)).createRange(*element); DCHECK(startRange.isNotNull()); const Position& startPosition = startRange.endPosition(); const EphemeralRange& endRange = PlainTextRange(0, static_cast<int>(end)).createRange(*element); DCHECK(endRange.isNotNull()); const Position& endPosition = endRange.endPosition(); const SelectionInDOMTree& selection = SelectionInDOMTree::Builder() .setBaseAndExtent(startPosition, endPosition) .setIsDirectional(isDirectional) .build(); return selection; }
0
119,669
static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) { struct nf_bridge_info *nf_bridge = skb->nf_bridge; struct dst_entry *dst; skb->dev = bridge_parent(skb->dev); if (!skb->dev) goto free_skb; dst = skb_dst(skb); if (dst->hh) { neigh_hh_bridge(dst->hh, skb); skb->dev = nf_bridge->physindev; return br_handle_frame_finish(skb); } else if (dst->neighbour) { /* the neighbour function below overwrites the complete * MAC header, so we save the Ethernet source address and * protocol number. */ skb_copy_from_linear_data_offset(skb, -(ETH_HLEN-ETH_ALEN), skb->nf_bridge->data, ETH_HLEN-ETH_ALEN); /* tell br_dev_xmit to continue with forwarding */ nf_bridge->mask |= BRNF_BRIDGED_DNAT; return dst->neighbour->output(skb); } free_skb: kfree_skb(skb); return 0; }
0
252,789
void BackendIO::OpenEntry(const std::string& key, Entry** entry) { operation_ = OP_OPEN; key_ = key; entry_ptr_ = entry; }
0
200,410
void shut_down(int code) { int i; int bytes_in = 0; int bytes_out = 0; in_shutdown = 1; proc_cleanup(); i = 0; while (backend_cached && backend_cached[i]) { proxy_downserver(backend_cached[i]); if (backend_cached[i]->last_result.s) { free(backend_cached[i]->last_result.s); } free(backend_cached[i]); i++; } if (backend_cached) free(backend_cached); if (mupdate_h) mupdate_disconnect(&mupdate_h); if (idling) idle_stop(index_mboxname(imapd_index)); if (imapd_index) index_close(&imapd_index); sync_log_done(); seen_done(); mboxkey_done(); mboxlist_close(); mboxlist_done(); quotadb_close(); quotadb_done(); denydb_close(); denydb_done(); annotatemore_close(); annotate_done(); idle_done(); if (config_getswitch(IMAPOPT_STATUSCACHE)) { statuscache_close(); statuscache_done(); } partlist_local_done(); if (imapd_in) { /* Flush the incoming buffer */ prot_NONBLOCK(imapd_in); prot_fill(imapd_in); bytes_in = prot_bytes_in(imapd_in); prot_free(imapd_in); } if (imapd_out) { /* Flush the outgoing buffer */ prot_flush(imapd_out); bytes_out = prot_bytes_out(imapd_out); prot_free(imapd_out); /* one less active connection */ snmp_increment(ACTIVE_CONNECTIONS, -1); } if (config_auditlog) syslog(LOG_NOTICE, "auditlog: traffic sessionid=<%s> bytes_in=<%d> bytes_out=<%d>", session_id(), bytes_in, bytes_out); if (protin) protgroup_free(protin); #ifdef HAVE_SSL tls_shutdown_serverengine(); #endif cyrus_done(); exit(code); }
0
221,864
MagickExport PixelPacket *QueueAuthenticPixels(Image *image,const ssize_t x, const ssize_t y,const size_t columns,const size_t rows, ExceptionInfo *exception) { CacheInfo *restrict cache_info; const int id = GetOpenMPThreadId(); assert(image != (Image *) NULL); assert(image->signature == MagickSignature); assert(image->cache != (Cache) NULL); cache_info=(CacheInfo *) image->cache; assert(cache_info->signature == MagickSignature); if (cache_info->methods.queue_authentic_pixels_handler != (QueueAuthenticPixelsHandler) NULL) return(cache_info->methods.queue_authentic_pixels_handler(image,x,y,columns, rows,exception)); assert(id < (int) cache_info->number_threads); return(QueueAuthenticPixelCacheNexus(image,x,y,columns,rows,MagickFalse, cache_info->nexus_info[id],exception)); }
0
438,323
bool SegmentInfo::Write(IMkvWriter* writer) { if (!writer || !muxing_app_ || !writing_app_) return false; uint64_t size = EbmlElementSize(libwebm::kMkvTimecodeScale, static_cast<uint64>(timecode_scale_)); if (duration_ > 0.0) size += EbmlElementSize(libwebm::kMkvDuration, static_cast<float>(duration_)); if (date_utc_ != LLONG_MIN) size += EbmlDateElementSize(libwebm::kMkvDateUTC); size += EbmlElementSize(libwebm::kMkvMuxingApp, muxing_app_); size += EbmlElementSize(libwebm::kMkvWritingApp, writing_app_); if (!WriteEbmlMasterElement(writer, libwebm::kMkvInfo, size)) return false; const int64_t payload_position = writer->Position(); if (payload_position < 0) return false; if (!WriteEbmlElement(writer, libwebm::kMkvTimecodeScale, static_cast<uint64>(timecode_scale_))) return false; if (duration_ > 0.0) { // Save for later duration_pos_ = writer->Position(); if (!WriteEbmlElement(writer, libwebm::kMkvDuration, static_cast<float>(duration_))) return false; } if (date_utc_ != LLONG_MIN) WriteEbmlDateElement(writer, libwebm::kMkvDateUTC, date_utc_); if (!WriteEbmlElement(writer, libwebm::kMkvMuxingApp, muxing_app_)) return false; if (!WriteEbmlElement(writer, libwebm::kMkvWritingApp, writing_app_)) return false; const int64_t stop_position = writer->Position(); if (stop_position < 0 || stop_position - payload_position != static_cast<int64_t>(size)) return false; return true; }
0
379,189
static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); zend_free_op free_op1, free_op2; concat_function(&EX_T(opline->result.u.var).tmp_var, _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; ZEND_VM_NEXT_OPCODE(); }
0
110,454
static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev) { /* * If still on the runqueue then deactivate_task() * was not called and update_curr() has to be done: */ if (prev->on_rq) update_curr(cfs_rq); /* throttle cfs_rqs exceeding runtime */ check_cfs_rq_runtime(cfs_rq); check_spread(cfs_rq, prev); if (prev->on_rq) { update_stats_wait_start(cfs_rq, prev); /* Put 'current' back into the tree. */ __enqueue_entity(cfs_rq, prev); /* in !on_rq case, update occurred at dequeue */ update_load_avg(cfs_rq, prev, 0); } cfs_rq->curr = NULL; }
0
463,954
static CURLcode pkp_pin_peer_pubkey(struct Curl_easy *data, struct connectdata *conn, int sockindex, const char *pinnedpubkey) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; CERT_CONTEXT *pCertContextServer = NULL; /* Result is returned to caller */ CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH; /* if a path wasn't specified, don't pin */ if(!pinnedpubkey) return CURLE_OK; do { SECURITY_STATUS sspi_status; const char *x509_der; DWORD x509_der_len; struct Curl_X509certificate x509_parsed; struct Curl_asn1Element *pubkey; sspi_status = s_pSecFn->QueryContextAttributes(&BACKEND->ctxt->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &pCertContextServer); if((sspi_status != SEC_E_OK) || (pCertContextServer == NULL)) { char buffer[STRERROR_LEN]; failf(data, "schannel: Failed to read remote certificate context: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); break; /* failed */ } if(!(((pCertContextServer->dwCertEncodingType & X509_ASN_ENCODING) != 0) && (pCertContextServer->cbCertEncoded > 0))) break; x509_der = (const char *)pCertContextServer->pbCertEncoded; x509_der_len = pCertContextServer->cbCertEncoded; memset(&x509_parsed, 0, sizeof(x509_parsed)); if(Curl_parseX509(&x509_parsed, x509_der, x509_der + x509_der_len)) break; pubkey = &x509_parsed.subjectPublicKeyInfo; if(!pubkey->header || pubkey->end <= pubkey->header) { failf(data, "SSL: failed retrieving public key from server certificate"); break; } result = Curl_pin_peer_pubkey(data, pinnedpubkey, (const unsigned char *)pubkey->header, (size_t)(pubkey->end - pubkey->header)); if(result) { failf(data, "SSL: public key does not match pinned public key!"); } } while(0); if(pCertContextServer) CertFreeCertificateContext(pCertContextServer); return result; }
0
477,440
static int FNAME(page_fault)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault) { struct guest_walker walker; int r; unsigned long mmu_seq; bool is_self_change_mapping; pgprintk("%s: addr %lx err %x\n", __func__, fault->addr, fault->error_code); WARN_ON_ONCE(fault->is_tdp); /* * Look up the guest pte for the faulting address. * If PFEC.RSVD is set, this is a shadow page fault. * The bit needs to be cleared before walking guest page tables. */ r = FNAME(walk_addr)(&walker, vcpu, fault->addr, fault->error_code & ~PFERR_RSVD_MASK); /* * The page is not mapped by the guest. Let the guest handle it. */ if (!r) { pgprintk("%s: guest page fault\n", __func__); if (!fault->prefetch) kvm_inject_emulated_page_fault(vcpu, &walker.fault); return RET_PF_RETRY; } fault->gfn = walker.gfn; fault->slot = kvm_vcpu_gfn_to_memslot(vcpu, fault->gfn); if (page_fault_handle_page_track(vcpu, fault)) { shadow_page_table_clear_flood(vcpu, fault->addr); return RET_PF_EMULATE; } r = mmu_topup_memory_caches(vcpu, true); if (r) return r; vcpu->arch.write_fault_to_shadow_pgtable = false; is_self_change_mapping = FNAME(is_self_change_mapping)(vcpu, &walker, fault->user, &vcpu->arch.write_fault_to_shadow_pgtable); if (is_self_change_mapping) fault->max_level = PG_LEVEL_4K; else fault->max_level = walker.level; mmu_seq = vcpu->kvm->mmu_notifier_seq; smp_rmb(); if (kvm_faultin_pfn(vcpu, fault, &r)) return r; if (handle_abnormal_pfn(vcpu, fault, walker.pte_access, &r)) return r; /* * Do not change pte_access if the pfn is a mmio page, otherwise * we will cache the incorrect access into mmio spte. */ if (fault->write && !(walker.pte_access & ACC_WRITE_MASK) && !is_cr0_wp(vcpu->arch.mmu) && !fault->user && fault->slot) { walker.pte_access |= ACC_WRITE_MASK; walker.pte_access &= ~ACC_USER_MASK; /* * If we converted a user page to a kernel page, * so that the kernel can write to it when cr0.wp=0, * then we should prevent the kernel from executing it * if SMEP is enabled. */ if (is_cr4_smep(vcpu->arch.mmu)) walker.pte_access &= ~ACC_EXEC_MASK; } r = RET_PF_RETRY; write_lock(&vcpu->kvm->mmu_lock); if (is_page_fault_stale(vcpu, fault, mmu_seq)) goto out_unlock; r = make_mmu_pages_available(vcpu); if (r) goto out_unlock; r = FNAME(fetch)(vcpu, fault, &walker); out_unlock: write_unlock(&vcpu->kvm->mmu_lock); kvm_release_pfn_clean(fault->pfn); return r; }
0
87,587
static int dw2102_probe(struct usb_interface *intf, const struct usb_device_id *id) { p1100 = kmemdup(&s6x0_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!p1100) return -ENOMEM; /* copy default structure */ /* fill only different fields */ p1100->firmware = P1100_FIRMWARE; p1100->devices[0] = d1100; p1100->rc.core.rc_query = prof_rc_query; p1100->rc.core.rc_codes = RC_MAP_TBS_NEC; p1100->adapter->fe[0].frontend_attach = stv0288_frontend_attach; s660 = kmemdup(&s6x0_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!s660) { kfree(p1100); return -ENOMEM; } s660->firmware = S660_FIRMWARE; s660->num_device_descs = 3; s660->devices[0] = d660; s660->devices[1] = d480_1; s660->devices[2] = d480_2; s660->adapter->fe[0].frontend_attach = ds3000_frontend_attach; p7500 = kmemdup(&s6x0_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!p7500) { kfree(p1100); kfree(s660); return -ENOMEM; } p7500->firmware = P7500_FIRMWARE; p7500->devices[0] = d7500; p7500->rc.core.rc_query = prof_rc_query; p7500->rc.core.rc_codes = RC_MAP_TBS_NEC; p7500->adapter->fe[0].frontend_attach = prof_7500_frontend_attach; s421 = kmemdup(&su3000_properties, sizeof(struct dvb_usb_device_properties), GFP_KERNEL); if (!s421) { kfree(p1100); kfree(s660); kfree(p7500); return -ENOMEM; } s421->num_device_descs = 2; s421->devices[0] = d421; s421->devices[1] = d632; s421->adapter->fe[0].frontend_attach = m88rs2000_frontend_attach; if (0 == dvb_usb_device_init(intf, &dw2102_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &dw2104_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &dw3101_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &s6x0_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, p1100, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, s660, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, p7500, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, s421, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &su3000_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &t220_properties, THIS_MODULE, NULL, adapter_nr) || 0 == dvb_usb_device_init(intf, &tt_s2_4600_properties, THIS_MODULE, NULL, adapter_nr)) return 0; return -ENODEV; }
0
97,275
static void edge_set_termios(struct tty_struct *tty, struct usb_serial_port *port, struct ktermios *old_termios) { struct edgeport_port *edge_port = usb_get_serial_port_data(port); unsigned int cflag; cflag = tty->termios.c_cflag; dev_dbg(&port->dev, "%s - clfag %08x iflag %08x\n", __func__, tty->termios.c_cflag, tty->termios.c_iflag); dev_dbg(&port->dev, "%s - old clfag %08x old iflag %08x\n", __func__, old_termios->c_cflag, old_termios->c_iflag); if (edge_port == NULL) return; /* change the port settings to the new ones specified */ change_port_settings(tty, edge_port, old_termios); }
0
5,025
mm_zfree(struct mm_master *mm, void *address) { mm_free(mm, address); }
1
262,370
static int ca8210_register_ext_clock(struct spi_device *spi) { struct device_node *np = spi->dev.of_node; struct ca8210_priv *priv = spi_get_drvdata(spi); struct ca8210_platform_data *pdata = spi->dev.platform_data; int ret = 0; if (!np) return -EFAULT; priv->clk = clk_register_fixed_rate( &spi->dev, np->name, NULL, 0, pdata->extclockfreq ); if (IS_ERR(priv->clk)) { dev_crit(&spi->dev, "Failed to register external clk\n"); return PTR_ERR(priv->clk); } ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->clk); if (ret) { clk_unregister(priv->clk); dev_crit( &spi->dev, "Failed to register external clock as clock provider\n" ); } else { dev_info(&spi->dev, "External clock set as clock provider\n"); } return ret; }
0
501
static void e1000e_write_packet_to_guest ( E1000ECore * core , struct NetRxPkt * pkt , const E1000E_RxRing * rxr , const E1000E_RSSInfo * rss_info ) { PCIDevice * d = core -> owner ; dma_addr_t base ; uint8_t desc [ E1000_MAX_RX_DESC_LEN ] ; size_t desc_size ; size_t desc_offset = 0 ; size_t iov_ofs = 0 ; struct iovec * iov = net_rx_pkt_get_iovec ( pkt ) ; size_t size = net_rx_pkt_get_total_len ( pkt ) ; size_t total_size = size + e1000x_fcs_len ( core -> mac ) ; const E1000E_RingInfo * rxi ; size_t ps_hdr_len = 0 ; bool do_ps = e1000e_do_ps ( core , pkt , & ps_hdr_len ) ; bool is_first = true ; rxi = rxr -> i ; do { hwaddr ba [ MAX_PS_BUFFERS ] ; e1000e_ba_state bastate = { { 0 } } ; bool is_last = false ; desc_size = total_size - desc_offset ; if ( desc_size > core -> rx_desc_buf_size ) { desc_size = core -> rx_desc_buf_size ; } base = e1000e_ring_head_descr ( core , rxi ) ; pci_dma_read ( d , base , & desc , core -> rx_desc_len ) ; trace_e1000e_rx_descr ( rxi -> idx , base , core -> rx_desc_len ) ; e1000e_read_rx_descr ( core , desc , & ba ) ; if ( ba [ 0 ] ) { if ( desc_offset < size ) { static const uint32_t fcs_pad ; size_t iov_copy ; size_t copy_size = size - desc_offset ; if ( copy_size > core -> rx_desc_buf_size ) { copy_size = core -> rx_desc_buf_size ; } if ( do_ps ) { if ( is_first ) { size_t ps_hdr_copied = 0 ; do { iov_copy = MIN ( ps_hdr_len - ps_hdr_copied , iov -> iov_len - iov_ofs ) ; e1000e_write_hdr_to_rx_buffers ( core , & ba , & bastate , iov -> iov_base , iov_copy ) ; copy_size -= iov_copy ; ps_hdr_copied += iov_copy ; iov_ofs += iov_copy ; if ( iov_ofs == iov -> iov_len ) { iov ++ ; iov_ofs = 0 ; } } while ( ps_hdr_copied < ps_hdr_len ) ; is_first = false ; } else { e1000e_write_hdr_to_rx_buffers ( core , & ba , & bastate , NULL , 0 ) ; } } while ( copy_size ) { iov_copy = MIN ( copy_size , iov -> iov_len - iov_ofs ) ; e1000e_write_to_rx_buffers ( core , & ba , & bastate , iov -> iov_base + iov_ofs , iov_copy ) ; copy_size -= iov_copy ; iov_ofs += iov_copy ; if ( iov_ofs == iov -> iov_len ) { iov ++ ; iov_ofs = 0 ; } } if ( desc_offset + desc_size >= total_size ) { e1000e_write_to_rx_buffers ( core , & ba , & bastate , ( const char * ) & fcs_pad , e1000x_fcs_len ( core -> mac ) ) ; } } desc_offset += desc_size ; if ( desc_offset >= total_size ) { is_last = true ; } } else { trace_e1000e_rx_null_descriptor ( ) ; } e1000e_write_rx_descr ( core , desc , is_last ? core -> rx_pkt : NULL , rss_info , do_ps ? ps_hdr_len : 0 , & bastate . written ) ; pci_dma_write ( d , base , & desc , core -> rx_desc_len ) ; e1000e_ring_advance ( core , rxi , core -> rx_desc_len / E1000_MIN_RX_DESC_LEN ) ; } while ( desc_offset < total_size ) ; e1000e_update_rx_stats ( core , size , total_size ) ; }
1
119,663
static BOOL update_read_scrblt_order(wStream* s, const ORDER_INFO* orderInfo, SCRBLT_ORDER* scrblt) { ORDER_FIELD_COORD(1, scrblt->nLeftRect); ORDER_FIELD_COORD(2, scrblt->nTopRect); ORDER_FIELD_COORD(3, scrblt->nWidth); ORDER_FIELD_COORD(4, scrblt->nHeight); ORDER_FIELD_BYTE(5, scrblt->bRop); ORDER_FIELD_COORD(6, scrblt->nXSrc); ORDER_FIELD_COORD(7, scrblt->nYSrc); return TRUE; }
0
123,221
void xen_irq_resume(void) { unsigned int cpu; struct irq_info *info; /* New event-channel space is not 'live' yet. */ xen_evtchn_resume(); /* No IRQ <-> event-channel mappings. */ list_for_each_entry(info, &xen_irq_list_head, list) info->evtchn = 0; /* zap event-channel binding */ clear_evtchn_to_irq_all(); for_each_possible_cpu(cpu) { restore_cpu_virqs(cpu); restore_cpu_ipis(cpu); } restore_pirqs(); }
0
336,484
int qemu_register_machine(QEMUMachine *m) { TypeInfo ti = { .name = g_strconcat(m->name, TYPE_MACHINE_SUFFIX, NULL), .parent = TYPE_MACHINE, .class_init = machine_class_init, .class_data = (void *)m, }; type_register(&ti); return 0; }
1
352,602
static ssize_t __cgroup1_procs_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off, bool threadgroup) { struct cgroup *cgrp; struct task_struct *task; const struct cred *cred, *tcred; ssize_t ret; bool locked; cgrp = cgroup_kn_lock_live(of->kn, false); if (!cgrp) return -ENODEV; task = cgroup_procs_write_start(buf, threadgroup, &locked); ret = PTR_ERR_OR_ZERO(task); if (ret) goto out_unlock; /* * Even if we're attaching all tasks in the thread group, we only * need to check permissions on one of them. */ cred = current_cred(); tcred = get_task_cred(task); if (!uid_eq(cred->euid, GLOBAL_ROOT_UID) && !uid_eq(cred->euid, tcred->uid) && !uid_eq(cred->euid, tcred->suid)) ret = -EACCES; put_cred(tcred); if (ret) goto out_finish; ret = cgroup_attach_task(cgrp, task, threadgroup); out_finish: cgroup_procs_write_finish(task, locked); out_unlock: cgroup_kn_unlock(of->kn); return ret ?: nbytes; }
1
385,815
static void pit_realizefn(DeviceState *dev, Error **errp) { PITCommonState *pit = PIT_COMMON(dev); PITClass *pc = PIT_GET_CLASS(dev); PITChannelState *s; s = &pit->channels[0]; /* the timer 0 is connected to an IRQ */ s->irq_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, pit_irq_timer, s); qdev_init_gpio_out(dev, &s->irq, 1); memory_region_init_io(&pit->ioports, OBJECT(pit), &pit_ioport_ops, pit, "pit", 4); qdev_init_gpio_in(dev, pit_irq_control, 1); pc->parent_realize(dev, errp); }
0
489,951
authentic_match_card(struct sc_card *card) { struct sc_context *ctx = card->ctx; int i; sc_log_hex(ctx, "try to match card with ATR", card->atr.value, card->atr.len); i = _sc_match_atr(card, authentic_known_atrs, &card->type); if (i < 0) { sc_log(ctx, "card not matched"); return 0; } sc_log(ctx, "'%s' card matched", authentic_known_atrs[i].name); return 1; }
0
206,617
void RenderViewHostImpl::OnDidStartLoading() { delegate_->DidStartLoading(this); }
0
514,348
static int message_parse_stream(pool_t pool, struct istream *input, const struct message_parser_settings *set, bool parse_data, struct message_part **parts_r) { int ret; struct message_parser_ctx *parser; struct message_block block; i_zero(&block); parser = message_parser_init(pool, input, set); while ((ret = message_parser_parse_next_block(parser, &block)) > 0) if (parse_data) message_part_data_parse_from_header(pool, block.part, block.hdr); message_parser_deinit(&parser, parts_r); test_assert(input->stream_errno == 0); return ret; }
0
394,387
NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share, const char *dev, const char *pass, int passlen) { struct tevent_context *ev; struct tevent_req *req; NTSTATUS status = NT_STATUS_NO_MEMORY; if (smbXcli_conn_has_async_calls(cli->conn)) { return NT_STATUS_INVALID_PARAMETER; } ev = samba_tevent_context_init(talloc_tos()); if (ev == NULL) { goto fail; } req = cli_tree_connect_send(ev, ev, cli, share, dev, pass, passlen); if (req == NULL) { goto fail; } if (!tevent_req_poll_ntstatus(req, ev, &status)) { goto fail; } status = cli_tree_connect_recv(req); fail: TALLOC_FREE(ev); return status; }
0
333,376
int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf) { int i, oi, oi_next, num_insns; #ifdef CONFIG_PROFILER { int n; n = s->gen_last_op_idx + 1; s->op_count += n; if (n > s->op_count_max) { s->op_count_max = n; } n = s->nb_temps; s->temp_count += n; if (n > s->temp_count_max) { s->temp_count_max = n; } } #endif #ifdef DEBUG_DISAS if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP))) { qemu_log("OP:\n"); tcg_dump_ops(s); qemu_log("\n"); } #endif #ifdef CONFIG_PROFILER s->opt_time -= profile_getclock(); #endif #ifdef USE_TCG_OPTIMIZATIONS tcg_optimize(s); #endif #ifdef CONFIG_PROFILER s->opt_time += profile_getclock(); s->la_time -= profile_getclock(); #endif tcg_liveness_analysis(s); #ifdef CONFIG_PROFILER s->la_time += profile_getclock(); #endif #ifdef DEBUG_DISAS if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP_OPT))) { qemu_log("OP after optimization and liveness analysis:\n"); tcg_dump_ops(s); qemu_log("\n"); } #endif tcg_reg_alloc_start(s); s->code_buf = gen_code_buf; s->code_ptr = gen_code_buf; tcg_out_tb_init(s); num_insns = -1; for (oi = s->gen_first_op_idx; oi >= 0; oi = oi_next) { TCGOp * const op = &s->gen_op_buf[oi]; TCGArg * const args = &s->gen_opparam_buf[op->args]; TCGOpcode opc = op->opc; const TCGOpDef *def = &tcg_op_defs[opc]; uint16_t dead_args = s->op_dead_args[oi]; uint8_t sync_args = s->op_sync_args[oi]; oi_next = op->next; #ifdef CONFIG_PROFILER tcg_table_op_count[opc]++; #endif switch (opc) { case INDEX_op_mov_i32: case INDEX_op_mov_i64: tcg_reg_alloc_mov(s, def, args, dead_args, sync_args); break; case INDEX_op_movi_i32: case INDEX_op_movi_i64: tcg_reg_alloc_movi(s, args, dead_args, sync_args); break; case INDEX_op_insn_start: if (num_insns >= 0) { s->gen_insn_end_off[num_insns] = tcg_current_code_size(s); } num_insns++; for (i = 0; i < TARGET_INSN_START_WORDS; ++i) { target_ulong a; #if TARGET_LONG_BITS > TCG_TARGET_REG_BITS a = ((target_ulong)args[i * 2 + 1] << 32) | args[i * 2]; #else a = args[i]; #endif s->gen_insn_data[num_insns][i] = a; } break; case INDEX_op_discard: temp_dead(s, args[0]); break; case INDEX_op_set_label: tcg_reg_alloc_bb_end(s, s->reserved_regs); tcg_out_label(s, arg_label(args[0]), s->code_ptr); break; case INDEX_op_call: tcg_reg_alloc_call(s, op->callo, op->calli, args, dead_args, sync_args); break; default: /* Sanity check that we've not introduced any unhandled opcodes. */ if (def->flags & TCG_OPF_NOT_PRESENT) { tcg_abort(); } /* Note: in order to speed up the code, it would be much faster to have specialized register allocator functions for some common argument patterns */ tcg_reg_alloc_op(s, def, opc, args, dead_args, sync_args); break; } #ifndef NDEBUG check_regs(s); #endif /* Test for (pending) buffer overflow. The assumption is that any one operation beginning below the high water mark cannot overrun the buffer completely. Thus we can test for overflow after generating code without having to check during generation. */ if (unlikely((void *)s->code_ptr > s->code_gen_highwater)) { return -1; } } tcg_debug_assert(num_insns >= 0); s->gen_insn_end_off[num_insns] = tcg_current_code_size(s); /* Generate TB finalization at the end of block */ tcg_out_tb_finalize(s); /* flush instruction cache */ flush_icache_range((uintptr_t)s->code_buf, (uintptr_t)s->code_ptr); return tcg_current_code_size(s); }
0
482,029
static int smtc_blank(int blank_mode, struct fb_info *info) { struct smtcfb_info *sfb = info->par; /* clear DPMS setting */ switch (blank_mode) { case FB_BLANK_UNBLANK: /* Screen On: HSync: On, VSync : On */ switch (sfb->chip_id) { case 0x710: case 0x712: smtc_seqw(0x6a, 0x16); smtc_seqw(0x6b, 0x02); break; case 0x720: smtc_seqw(0x6a, 0x0d); smtc_seqw(0x6b, 0x02); break; } smtc_seqw(0x23, (smtc_seqr(0x23) & (~0xc0))); smtc_seqw(0x01, (smtc_seqr(0x01) & (~0x20))); smtc_seqw(0x21, (smtc_seqr(0x21) & 0x77)); smtc_seqw(0x22, (smtc_seqr(0x22) & (~0x30))); smtc_seqw(0x31, (smtc_seqr(0x31) | 0x03)); smtc_seqw(0x24, (smtc_seqr(0x24) | 0x01)); break; case FB_BLANK_NORMAL: /* Screen Off: HSync: On, VSync : On Soft blank */ smtc_seqw(0x24, (smtc_seqr(0x24) | 0x01)); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); smtc_seqw(0x23, (smtc_seqr(0x23) & (~0xc0))); smtc_seqw(0x01, (smtc_seqr(0x01) & (~0x20))); smtc_seqw(0x22, (smtc_seqr(0x22) & (~0x30))); smtc_seqw(0x6a, 0x16); smtc_seqw(0x6b, 0x02); break; case FB_BLANK_VSYNC_SUSPEND: /* Screen On: HSync: On, VSync : Off */ smtc_seqw(0x24, (smtc_seqr(0x24) & (~0x01))); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); smtc_seqw(0x23, ((smtc_seqr(0x23) & (~0xc0)) | 0x20)); smtc_seqw(0x01, (smtc_seqr(0x01) | 0x20)); smtc_seqw(0x21, (smtc_seqr(0x21) | 0x88)); smtc_seqw(0x20, (smtc_seqr(0x20) & (~0xB0))); smtc_seqw(0x22, ((smtc_seqr(0x22) & (~0x30)) | 0x20)); smtc_seqw(0x34, (smtc_seqr(0x34) | 0x80)); smtc_seqw(0x6a, 0x0c); smtc_seqw(0x6b, 0x02); break; case FB_BLANK_HSYNC_SUSPEND: /* Screen On: HSync: Off, VSync : On */ smtc_seqw(0x24, (smtc_seqr(0x24) & (~0x01))); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); smtc_seqw(0x23, ((smtc_seqr(0x23) & (~0xc0)) | 0xD8)); smtc_seqw(0x01, (smtc_seqr(0x01) | 0x20)); smtc_seqw(0x21, (smtc_seqr(0x21) | 0x88)); smtc_seqw(0x20, (smtc_seqr(0x20) & (~0xB0))); smtc_seqw(0x22, ((smtc_seqr(0x22) & (~0x30)) | 0x10)); smtc_seqw(0x34, (smtc_seqr(0x34) | 0x80)); smtc_seqw(0x6a, 0x0c); smtc_seqw(0x6b, 0x02); break; case FB_BLANK_POWERDOWN: /* Screen On: HSync: Off, VSync : Off */ smtc_seqw(0x24, (smtc_seqr(0x24) & (~0x01))); smtc_seqw(0x31, ((smtc_seqr(0x31) & (~0x07)) | 0x00)); smtc_seqw(0x23, ((smtc_seqr(0x23) & (~0xc0)) | 0xD8)); smtc_seqw(0x01, (smtc_seqr(0x01) | 0x20)); smtc_seqw(0x21, (smtc_seqr(0x21) | 0x88)); smtc_seqw(0x20, (smtc_seqr(0x20) & (~0xB0))); smtc_seqw(0x22, ((smtc_seqr(0x22) & (~0x30)) | 0x30)); smtc_seqw(0x34, (smtc_seqr(0x34) | 0x80)); smtc_seqw(0x6a, 0x0c); smtc_seqw(0x6b, 0x02); break; default: return -EINVAL; } return 0; }
0
461,681
MagickExport MagickBooleanType SetResampleFilterVirtualPixelMethod( ResampleFilter *resample_filter,const VirtualPixelMethod method) { assert(resample_filter != (ResampleFilter *) NULL); assert(resample_filter->signature == MagickCoreSignature); assert(resample_filter->image != (Image *) NULL); if (resample_filter->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", resample_filter->image->filename); resample_filter->virtual_pixel=method; if (method != UndefinedVirtualPixelMethod) (void) SetCacheViewVirtualPixelMethod(resample_filter->view,method); return(MagickTrue); }
0
115,199
code_exist_check(OnigCodePoint c, UChar* from, UChar* end, int ignore_escaped, ScanEnv* env) { int in_esc; OnigCodePoint code; OnigEncoding enc = env->enc; UChar* p = from; in_esc = 0; while (! PEND) { if (ignore_escaped && in_esc) { in_esc = 0; } else { PFETCH_S(code); if (code == c) return 1; if (code == MC_ESC(env->syntax)) in_esc = 1; } } return 0; }
0
66,503
void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size, const uint8_t *elem_data) { int nb = *nb_ptr, nb_alloc; uint8_t *tab = *tab_ptr, *tab_elem_data; if ((nb & (nb - 1)) == 0) { if (nb == 0) { nb_alloc = 1; } else { if (nb > INT_MAX / (2 * elem_size)) goto fail; nb_alloc = nb * 2; } tab = av_realloc(tab, nb_alloc * elem_size); if (!tab) goto fail; *tab_ptr = tab; } *nb_ptr = nb + 1; tab_elem_data = tab + nb*elem_size; if (elem_data) memcpy(tab_elem_data, elem_data, elem_size); else if (CONFIG_MEMORY_POISONING) memset(tab_elem_data, FF_MEMORY_POISON, elem_size); return tab_elem_data; fail: av_freep(tab_ptr); *nb_ptr = 0; return NULL; }
0
243,406
static int grayvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_comps) { os_ptr op = osp; if (!r_has_type(op, t_integer) && !r_has_type(op, t_real)) return_error(gs_error_typecheck); if (num_comps < 1) return_error(gs_error_stackunderflow); if (*values > 1.0) *values = 1.0; if ( *values < 0.0) *values = 0.0; return 0; }
0
215,216
bool BlobURLRequestJob::ReadBytes(const BlobData::Item& item) { DCHECK(read_buf_remaining_bytes_ >= bytes_to_read_); memcpy(read_buf_->data() + read_buf_offset_, &item.data().at(0) + item.offset() + current_item_offset_, bytes_to_read_); AdvanceBytesRead(bytes_to_read_); return true; }
0
98,557
static int tracing_trace_options_show(struct seq_file *m, void *v) { struct tracer_opt *trace_opts; struct trace_array *tr = m->private; u32 tracer_flags; int i; mutex_lock(&trace_types_lock); tracer_flags = tr->current_trace->flags->val; trace_opts = tr->current_trace->flags->opts; for (i = 0; trace_options[i]; i++) { if (tr->trace_flags & (1 << i)) seq_printf(m, "%s\n", trace_options[i]); else seq_printf(m, "no%s\n", trace_options[i]); } for (i = 0; trace_opts[i].name; i++) { if (tracer_flags & trace_opts[i].bit) seq_printf(m, "%s\n", trace_opts[i].name); else seq_printf(m, "no%s\n", trace_opts[i].name); } mutex_unlock(&trace_types_lock); return 0; }
0
271,086
static inline int ext4_handle_valid(handle_t *handle) { if ((unsigned long)handle < EXT4_NOJOURNAL_MAX_REF_COUNT) return 0; return 1; }
0
484,096
static inline u8 i740inb(struct i740fb_par *par, u16 port) { return vga_mm_r(par->regs, port); }
0
266,167
static bool evtchn_2l_is_pending(evtchn_port_t port) { struct shared_info *s = HYPERVISOR_shared_info; return sync_test_bit(port, BM(&s->evtchn_pending[0])); }
0
39,756
void ap_lua_load_request_lmodule(lua_State *L, apr_pool_t *p) { apr_hash_t *dispatch = apr_hash_make(p); apr_hash_set(dispatch, "puts", APR_HASH_KEY_STRING, makefun(&req_puts, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "write", APR_HASH_KEY_STRING, makefun(&req_write, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "document_root", APR_HASH_KEY_STRING, makefun(&req_document_root, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "context_prefix", APR_HASH_KEY_STRING, makefun(&req_context_prefix, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "context_document_root", APR_HASH_KEY_STRING, makefun(&req_context_document_root, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "parseargs", APR_HASH_KEY_STRING, makefun(&req_parseargs, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "parsebody", APR_HASH_KEY_STRING, makefun(&req_parsebody, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "debug", APR_HASH_KEY_STRING, makefun(&req_debug, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "info", APR_HASH_KEY_STRING, makefun(&req_info, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "notice", APR_HASH_KEY_STRING, makefun(&req_notice, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "warn", APR_HASH_KEY_STRING, makefun(&req_warn, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "err", APR_HASH_KEY_STRING, makefun(&req_err, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "crit", APR_HASH_KEY_STRING, makefun(&req_crit, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "alert", APR_HASH_KEY_STRING, makefun(&req_alert, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "emerg", APR_HASH_KEY_STRING, makefun(&req_emerg, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace1", APR_HASH_KEY_STRING, makefun(&req_trace1, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace2", APR_HASH_KEY_STRING, makefun(&req_trace2, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace3", APR_HASH_KEY_STRING, makefun(&req_trace3, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace4", APR_HASH_KEY_STRING, makefun(&req_trace4, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace5", APR_HASH_KEY_STRING, makefun(&req_trace5, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace6", APR_HASH_KEY_STRING, makefun(&req_trace6, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace7", APR_HASH_KEY_STRING, makefun(&req_trace7, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "trace8", APR_HASH_KEY_STRING, makefun(&req_trace8, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "add_output_filter", APR_HASH_KEY_STRING, makefun(&req_add_output_filter, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "construct_url", APR_HASH_KEY_STRING, makefun(&req_construct_url, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "escape_html", APR_HASH_KEY_STRING, makefun(&req_escape_html, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "ssl_var_lookup", APR_HASH_KEY_STRING, makefun(&req_ssl_var_lookup, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "is_https", APR_HASH_KEY_STRING, makefun(&req_ssl_is_https_field, APL_REQ_FUNTYPE_BOOLEAN, p)); apr_hash_set(dispatch, "assbackwards", APR_HASH_KEY_STRING, makefun(&req_assbackwards_field, APL_REQ_FUNTYPE_BOOLEAN, p)); apr_hash_set(dispatch, "status", APR_HASH_KEY_STRING, makefun(&req_status_field, APL_REQ_FUNTYPE_INT, p)); apr_hash_set(dispatch, "protocol", APR_HASH_KEY_STRING, makefun(&req_protocol_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "range", APR_HASH_KEY_STRING, makefun(&req_range_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "content_type", APR_HASH_KEY_STRING, makefun(&req_content_type_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "content_encoding", APR_HASH_KEY_STRING, makefun(&req_content_encoding_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "ap_auth_type", APR_HASH_KEY_STRING, makefun(&req_ap_auth_type_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "unparsed_uri", APR_HASH_KEY_STRING, makefun(&req_unparsed_uri_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "user", APR_HASH_KEY_STRING, makefun(&req_user_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "filename", APR_HASH_KEY_STRING, makefun(&req_filename_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "canonical_filename", APR_HASH_KEY_STRING, makefun(&req_canonical_filename_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "path_info", APR_HASH_KEY_STRING, makefun(&req_path_info_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "args", APR_HASH_KEY_STRING, makefun(&req_args_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "handler", APR_HASH_KEY_STRING, makefun(&req_handler_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "hostname", APR_HASH_KEY_STRING, makefun(&req_hostname_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "uri", APR_HASH_KEY_STRING, makefun(&req_uri_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "the_request", APR_HASH_KEY_STRING, makefun(&req_the_request_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "log_id", APR_HASH_KEY_STRING, makefun(&req_log_id_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "useragent_ip", APR_HASH_KEY_STRING, makefun(&req_useragent_ip_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "method", APR_HASH_KEY_STRING, makefun(&req_method_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "proxyreq", APR_HASH_KEY_STRING, makefun(&req_proxyreq_field, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "headers_in", APR_HASH_KEY_STRING, makefun(&req_headers_in, APL_REQ_FUNTYPE_TABLE, p)); apr_hash_set(dispatch, "headers_out", APR_HASH_KEY_STRING, makefun(&req_headers_out, APL_REQ_FUNTYPE_TABLE, p)); apr_hash_set(dispatch, "err_headers_out", APR_HASH_KEY_STRING, makefun(&req_err_headers_out, APL_REQ_FUNTYPE_TABLE, p)); apr_hash_set(dispatch, "notes", APR_HASH_KEY_STRING, makefun(&req_notes, APL_REQ_FUNTYPE_TABLE, p)); apr_hash_set(dispatch, "subprocess_env", APR_HASH_KEY_STRING, makefun(&req_subprocess_env, APL_REQ_FUNTYPE_TABLE, p)); apr_hash_set(dispatch, "flush", APR_HASH_KEY_STRING, makefun(&lua_ap_rflush, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "port", APR_HASH_KEY_STRING, makefun(&req_ap_get_server_port, APL_REQ_FUNTYPE_INT, p)); apr_hash_set(dispatch, "banner", APR_HASH_KEY_STRING, makefun(&ap_get_server_banner, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "options", APR_HASH_KEY_STRING, makefun(&lua_ap_options, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "allowoverrides", APR_HASH_KEY_STRING, makefun(&lua_ap_allowoverrides, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "started", APR_HASH_KEY_STRING, makefun(&lua_ap_started, APL_REQ_FUNTYPE_INT, p)); apr_hash_set(dispatch, "basic_auth_pw", APR_HASH_KEY_STRING, makefun(&lua_ap_basic_auth_pw, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "limit_req_body", APR_HASH_KEY_STRING, makefun(&lua_ap_limit_req_body, APL_REQ_FUNTYPE_INT, p)); apr_hash_set(dispatch, "server_built", APR_HASH_KEY_STRING, makefun(&ap_get_server_built, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "is_initial_req", APR_HASH_KEY_STRING, makefun(&lua_ap_is_initial_req, APL_REQ_FUNTYPE_BOOLEAN, p)); apr_hash_set(dispatch, "remaining", APR_HASH_KEY_STRING, makefun(&req_remaining_field, APL_REQ_FUNTYPE_INT, p)); apr_hash_set(dispatch, "some_auth_required", APR_HASH_KEY_STRING, makefun(&lua_ap_some_auth_required, APL_REQ_FUNTYPE_BOOLEAN, p)); apr_hash_set(dispatch, "server_name", APR_HASH_KEY_STRING, makefun(&lua_ap_get_server_name, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "auth_name", APR_HASH_KEY_STRING, makefun(&lua_ap_auth_name, APL_REQ_FUNTYPE_STRING, p)); apr_hash_set(dispatch, "sendfile", APR_HASH_KEY_STRING, makefun(&lua_ap_sendfile, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "dbacquire", APR_HASH_KEY_STRING, makefun(&lua_db_acquire, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "stat", APR_HASH_KEY_STRING, makefun(&lua_ap_stat, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "get_direntries", APR_HASH_KEY_STRING, makefun(&lua_ap_getdir, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "regex", APR_HASH_KEY_STRING, makefun(&lua_ap_regex, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "usleep", APR_HASH_KEY_STRING, makefun(&lua_ap_usleep, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "base64_encode", APR_HASH_KEY_STRING, makefun(&lua_apr_b64encode, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "base64_decode", APR_HASH_KEY_STRING, makefun(&lua_apr_b64decode, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "md5", APR_HASH_KEY_STRING, makefun(&lua_apr_md5, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "sha1", APR_HASH_KEY_STRING, makefun(&lua_apr_sha1, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "htpassword", APR_HASH_KEY_STRING, makefun(&lua_apr_htpassword, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "touch", APR_HASH_KEY_STRING, makefun(&lua_apr_touch, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "mkdir", APR_HASH_KEY_STRING, makefun(&lua_apr_mkdir, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "mkrdir", APR_HASH_KEY_STRING, makefun(&lua_apr_mkrdir, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "rmdir", APR_HASH_KEY_STRING, makefun(&lua_apr_rmdir, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "date_parse_rfc", APR_HASH_KEY_STRING, makefun(&lua_apr_date_parse_rfc, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "escape", APR_HASH_KEY_STRING, makefun(&lua_ap_escape, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "unescape", APR_HASH_KEY_STRING, makefun(&lua_ap_unescape, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "mpm_query", APR_HASH_KEY_STRING, makefun(&lua_ap_mpm_query, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "expr", APR_HASH_KEY_STRING, makefun(&lua_ap_expr, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "scoreboard_process", APR_HASH_KEY_STRING, makefun(&lua_ap_scoreboard_process, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "scoreboard_worker", APR_HASH_KEY_STRING, makefun(&lua_ap_scoreboard_worker, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "clock", APR_HASH_KEY_STRING, makefun(&lua_ap_clock, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "requestbody", APR_HASH_KEY_STRING, makefun(&lua_ap_requestbody, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "add_input_filter", APR_HASH_KEY_STRING, makefun(&lua_ap_add_input_filter, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "module_info", APR_HASH_KEY_STRING, makefun(&lua_ap_module_info, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "loaded_modules", APR_HASH_KEY_STRING, makefun(&lua_ap_loaded_modules, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "runtime_dir_relative", APR_HASH_KEY_STRING, makefun(&lua_ap_runtime_dir_relative, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "server_info", APR_HASH_KEY_STRING, makefun(&lua_ap_server_info, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "set_document_root", APR_HASH_KEY_STRING, makefun(&lua_ap_set_document_root, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "set_context_info", APR_HASH_KEY_STRING, makefun(&lua_ap_set_context_info, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "os_escape_path", APR_HASH_KEY_STRING, makefun(&lua_ap_os_escape_path, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "escape_logitem", APR_HASH_KEY_STRING, makefun(&lua_ap_escape_logitem, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "strcmp_match", APR_HASH_KEY_STRING, makefun(&lua_ap_strcmp_match, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "set_keepalive", APR_HASH_KEY_STRING, makefun(&lua_ap_set_keepalive, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "make_etag", APR_HASH_KEY_STRING, makefun(&lua_ap_make_etag, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "send_interim_response", APR_HASH_KEY_STRING, makefun(&lua_ap_send_interim_response, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "custom_response", APR_HASH_KEY_STRING, makefun(&lua_ap_custom_response, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "exists_config_define", APR_HASH_KEY_STRING, makefun(&lua_ap_exists_config_define, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "state_query", APR_HASH_KEY_STRING, makefun(&lua_ap_state_query, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "get_server_name_for_url", APR_HASH_KEY_STRING, makefun(&lua_ap_get_server_name_for_url, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "ivm_get", APR_HASH_KEY_STRING, makefun(&lua_ivm_get, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "ivm_set", APR_HASH_KEY_STRING, makefun(&lua_ivm_set, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "getcookie", APR_HASH_KEY_STRING, makefun(&lua_get_cookie, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "setcookie", APR_HASH_KEY_STRING, makefun(&lua_set_cookie, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "wsupgrade", APR_HASH_KEY_STRING, makefun(&lua_websocket_greet, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "wsread", APR_HASH_KEY_STRING, makefun(&lua_websocket_read, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "wspeek", APR_HASH_KEY_STRING, makefun(&lua_websocket_peek, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "wswrite", APR_HASH_KEY_STRING, makefun(&lua_websocket_write, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "wsclose", APR_HASH_KEY_STRING, makefun(&lua_websocket_close, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "wsping", APR_HASH_KEY_STRING, makefun(&lua_websocket_ping, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "config", APR_HASH_KEY_STRING, makefun(&lua_ap_get_config, APL_REQ_FUNTYPE_LUACFUN, p)); apr_hash_set(dispatch, "activeconfig", APR_HASH_KEY_STRING, makefun(&lua_ap_get_active_config, APL_REQ_FUNTYPE_LUACFUN, p)); lua_pushlightuserdata(L, dispatch); lua_setfield(L, LUA_REGISTRYINDEX, "Apache2.Request.dispatch"); luaL_newmetatable(L, "Apache2.Request"); /* [metatable] */ lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); luaL_register(L, NULL, request_methods); /* [metatable] */ lua_pop(L, 2); luaL_newmetatable(L, "Apache2.Connection"); /* [metatable] */ lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); luaL_register(L, NULL, connection_methods); /* [metatable] */ lua_pop(L, 2); luaL_newmetatable(L, "Apache2.Server"); /* [metatable] */ lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); luaL_register(L, NULL, server_methods); /* [metatable] */ lua_pop(L, 2); }
0
52,152
ofpacts_parse__(char *str, const struct ofpact_parse_params *pp, bool allow_instructions, enum ofpact_type outer_action) { char *key, *value; bool drop = false; char *pos; pos = str; while (ofputil_parse_key_value(&pos, &key, &value)) { enum ofpact_type type; char *error = NULL; ofp_port_t port; if (ofpact_type_from_name(key, &type)) { error = ofpact_parse(type, value, pp); if (type == OFPACT_METER && !allow_instructions) { /* Meter is an action in OF1.5 and it's being used in a * context where instructions aren't allowed. Therefore, * this must be OF1.5+. */ *pp->usable_protocols &= OFPUTIL_P_OF15_UP; } } else if (!strcasecmp(key, "mod_vlan_vid")) { error = parse_set_vlan_vid(value, true, pp); } else if (!strcasecmp(key, "mod_vlan_pcp")) { error = parse_set_vlan_pcp(value, true, pp); } else if (!strcasecmp(key, "set_nw_ttl")) { error = parse_SET_IP_TTL(value, pp); } else if (!strcasecmp(key, "pop_vlan")) { error = parse_pop_vlan(pp); } else if (!strcasecmp(key, "set_tunnel64")) { error = parse_set_tunnel(value, NXAST_RAW_SET_TUNNEL64, pp); } else if (!strcasecmp(key, "load")) { error = parse_reg_load(value, pp); } else if (!strcasecmp(key, "bundle_load")) { error = parse_bundle_load(value, pp); } else if (!strcasecmp(key, "drop")) { drop = true; } else if (!strcasecmp(key, "apply_actions")) { return xstrdup("apply_actions is the default instruction"); } else if (ofputil_port_from_string(key, pp->port_map, &port)) { ofpact_put_OUTPUT(pp->ofpacts)->port = port; } else { return xasprintf("unknown action %s", key); } if (error) { return error; } } if (drop && pp->ofpacts->size) { return xstrdup("\"drop\" must not be accompanied by any other action " "or instruction"); } char *error = NULL; ofpacts_verify(pp->ofpacts->data, pp->ofpacts->size, OFP11_VERSION, (allow_instructions ? (1u << N_OVS_INSTRUCTIONS) - 1 : ((1u << OVSINST_OFPIT11_APPLY_ACTIONS) | (1u << OVSINST_OFPIT13_METER))), outer_action, &error); if (error) { return error; } return NULL; }
0
345,622
PHP_FUNCTION(dom_document_save) { zval *id; xmlDoc *docp; int file_len = 0, bytes, format, saveempty = 0; dom_object *intern; dom_doc_propsptr doc_props; char *file; long options = 0; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &id, dom_document_class_entry, &file, &file_len, &options) == FAILURE) { return; } if (file_len == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Filename"); RETURN_FALSE; } DOM_GET_OBJ(docp, id, xmlDocPtr, intern); /* encoding handled by property on doc */ doc_props = dom_get_doc_props(intern->document); format = doc_props->formatoutput; if (options & LIBXML_SAVE_NOEMPTYTAG) { saveempty = xmlSaveNoEmptyTags; xmlSaveNoEmptyTags = 1; } bytes = xmlSaveFormatFileEnc(file, docp, NULL, format); if (options & LIBXML_SAVE_NOEMPTYTAG) { xmlSaveNoEmptyTags = saveempty; } if (bytes == -1) { RETURN_FALSE; } RETURN_LONG(bytes); }
1
175,830
path_to_hinter(t1_hinter *h, gx_path *path) { int code; gs_path_enum penum; gs_fixed_point pts[3]; gs_fixed_point p = {0, 0}; /* initialize to avoid a warning */ bool first = true; int op; code = gx_path_enum_init(&penum, path); if (code < 0) return code; while ((op = gx_path_enum_next(&penum, pts)) != 0) { switch (op) { case gs_pe_moveto: if (first) { first = false; p = pts[0]; code = t1_hinter__rmoveto(h, p.x, p.y); } else code = t1_hinter__rmoveto(h, pts[0].x - p.x, pts[0].y - p.y); break; case gs_pe_lineto: case gs_pe_gapto: code = t1_hinter__rlineto(h, pts[0].x - p.x, pts[0].y - p.y); break; case gs_pe_curveto: code = t1_hinter__rcurveto(h, pts[0].x - p.x, pts[0].y - p.y, pts[1].x - pts[0].x, pts[1].y - pts[0].y, pts[2].x - pts[1].x, pts[2].y - pts[1].y); pts[0] = pts[2]; break; case gs_pe_closepath: code = t1_hinter__closepath(h); break; default: return_error(gs_error_unregistered); } if (code < 0) return code; p = pts[0]; } return 0; }
0
283,331
void Editor::RegisterCommandGroup(CompositeEditCommand* command_group_wrapper) { DCHECK(command_group_wrapper->IsCommandGroupWrapper()); last_edit_command_ = command_group_wrapper; }
0
295,102
static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { ssize_t y; unsigned z; register const Quantum *p; unsigned int status; int logging; size_t DataSize; char padding; char MATLAB_HDR[0x80]; time_t current_time; struct tm local_time; unsigned char *pixels; int is_gray; MagickOffsetType scene; QuantumInfo *quantum_info; /* Open output image file. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickCoreSignature); assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); logging=LogMagickEvent(CoderEvent,GetMagickModule(),"enter MAT"); (void) logging; assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception); if (status == MagickFalse) return(MagickFalse); image->depth=8; current_time=time((time_t *) NULL); #if defined(MAGICKCORE_HAVE_LOCALTIME_R) (void) localtime_r(&current_time,&local_time); #else (void) memcpy(&local_time,localtime(&current_time),sizeof(local_time)); #endif (void) memset(MATLAB_HDR,' ',MagickMin(sizeof(MATLAB_HDR),124)); FormatLocaleString(MATLAB_HDR,sizeof(MATLAB_HDR), "MATLAB 5.0 MAT-file, Platform: %s, Created on: %s %s %2d %2d:%2d:%2d %d", OsDesc,DayOfWTab[local_time.tm_wday],MonthsTab[local_time.tm_mon], local_time.tm_mday,local_time.tm_hour,local_time.tm_min, local_time.tm_sec,local_time.tm_year+1900); MATLAB_HDR[0x7C]=0; MATLAB_HDR[0x7D]=1; MATLAB_HDR[0x7E]='I'; MATLAB_HDR[0x7F]='M'; (void) WriteBlob(image,sizeof(MATLAB_HDR),(unsigned char *) MATLAB_HDR); scene=0; do { (void) TransformImageColorspace(image,sRGBColorspace,exception); is_gray = SetImageGray(image,exception); z = is_gray ? 0 : 3; /* Store MAT header. */ DataSize = image->rows /*Y*/ * image->columns /*X*/; if(!is_gray) DataSize *= 3 /*Z*/; padding=((unsigned char)(DataSize-1) & 0x7) ^ 0x7; (void) WriteBlobLSBLong(image, miMATRIX); (void) WriteBlobLSBLong(image, (unsigned int) DataSize+padding+(is_gray ? 48 : 56)); (void) WriteBlobLSBLong(image, 0x6); /* 0x88 */ (void) WriteBlobLSBLong(image, 0x8); /* 0x8C */ (void) WriteBlobLSBLong(image, 0x6); /* 0x90 */ (void) WriteBlobLSBLong(image, 0); (void) WriteBlobLSBLong(image, 0x5); /* 0x98 */ (void) WriteBlobLSBLong(image, is_gray ? 0x8 : 0xC); /* 0x9C - DimFlag */ (void) WriteBlobLSBLong(image, (unsigned int) image->rows); /* x: 0xA0 */ (void) WriteBlobLSBLong(image, (unsigned int) image->columns); /* y: 0xA4 */ if(!is_gray) { (void) WriteBlobLSBLong(image, 3); /* z: 0xA8 */ (void) WriteBlobLSBLong(image, 0); } (void) WriteBlobLSBShort(image, 1); /* 0xB0 */ (void) WriteBlobLSBShort(image, 1); /* 0xB2 */ (void) WriteBlobLSBLong(image, 'M'); /* 0xB4 */ (void) WriteBlobLSBLong(image, 0x2); /* 0xB8 */ (void) WriteBlobLSBLong(image, (unsigned int) DataSize); /* 0xBC */ /* Store image data. */ quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); pixels=(unsigned char *) GetQuantumPixels(quantum_info); do { for (y=0; y < (ssize_t)image->columns; y++) { p=GetVirtualPixels(image,y,0,1,image->rows,exception); if (p == (const Quantum *) NULL) break; (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, z2qtype[z],pixels,exception); (void) WriteBlob(image,image->rows,pixels); } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; } while(z-- >= 2); while(padding-->0) (void) WriteBlobByte(image,0); quantum_info=DestroyQuantumInfo(quantum_info); if (GetNextImageInList(image) == (Image *) NULL) break; image=SyncNextImageInList(image); status=SetImageProgress(image,SaveImagesTag,scene++, GetImageListLength(image)); if (status == MagickFalse) break; } while (image_info->adjoin != MagickFalse); (void) CloseBlob(image); return(MagickTrue); }
0
352,572
switch (yych) { case 'a': goto yy35; default: goto yy33; }
1
455,131
TEST_F(ExprMatchTest, ConstantNegativeNumberExpressionMatchesCorrectly) { createMatcher(fromjson("{$expr: -1}")); ASSERT_TRUE(matches(BSON("x" << 2))); }
0
412,039
relpTcpChkOnePeerWildcard(tcpPermittedPeerWildcardComp_t *pRoot, char *peername, int *pbFoundPositiveMatch) { tcpPermittedPeerWildcardComp_t *pWildcard; char *pC; char *pStart; /* start of current domain component */ int iWildcard, iName; /* work indexes for backward comparisons */ *pbFoundPositiveMatch = 0; pWildcard = pRoot; pC = peername; while(*pC != '\0') { if(pWildcard == NULL) { /* we have more domain components than we have wildcards --> no match */ goto done; } pStart = pC; while(*pC != '\0' && *pC != '.') { ++pC; } /* got the component, now do the match */ switch(pWildcard->wildcardType) { case tcpPEER_WILDCARD_NONE: if( pWildcard->lenDomainPart != pC - pStart || strncmp((char*)pStart, (char*)pWildcard->pszDomainPart, pC - pStart)) { goto done; } break; case tcpPEER_WILDCARD_AT_START: /* we need to do the backwards-matching manually */ if(pWildcard->lenDomainPart > pC - pStart) { goto done; } iName = (size_t) (pC - pStart) - pWildcard->lenDomainPart; iWildcard = 0; while(iWildcard < pWildcard->lenDomainPart) { if(pWildcard->pszDomainPart[iWildcard] != pStart[iName]) { goto done; } ++iName; ++iWildcard; } break; case tcpPEER_WILDCARD_AT_END: if( pWildcard->lenDomainPart > pC - pStart || strncmp((char*)pStart, (char*)pWildcard->pszDomainPart, pWildcard->lenDomainPart)) { goto done; } break; case tcpPEER_WILDCARD_MATCH_ALL: /* everything is OK, just continue */ break; case tcpPEER_WILDCARD_EMPTY_COMPONENT: if(pC - pStart > 0) { /* if it is not empty, it is no match... */ goto done; } break; } pWildcard = pWildcard->pNext; /* we processed this entry */ /* skip '.' if we had it and so prepare for next iteration */ if(*pC == '.') ++pC; } /* we need to adjust for a border case, that is if the last component is * empty. That happens frequently if the domain root (e.g. "example.com.") * is properly given. */ if(pWildcard != NULL && pWildcard->wildcardType == tcpPEER_WILDCARD_EMPTY_COMPONENT) pWildcard = pWildcard->pNext; if(pWildcard != NULL) { /* we have more domain components than in the name to be * checked. So this is no match. */ goto done; } *pbFoundPositiveMatch = 1; done: return; }
0
409,434
static void bnx2x_update_eq_prod(struct bnx2x *bp, u16 prod) { /* No memory barriers */ storm_memset_eq_prod(bp, prod, BP_FUNC(bp)); mmiowb(); /* keep prod updates ordered */ }
0
332,384
void helper_rsm(CPUX86State *env) { X86CPU *cpu = x86_env_get_cpu(env); CPUState *cs = CPU(cpu); target_ulong sm_state; int i, offset; uint32_t val; sm_state = env->smbase + 0x8000; #ifdef TARGET_X86_64 cpu_load_efer(env, x86_ldq_phys(cs, sm_state + 0x7ed0)); env->gdt.base = x86_ldq_phys(cs, sm_state + 0x7e68); env->gdt.limit = x86_ldl_phys(cs, sm_state + 0x7e64); env->ldt.selector = x86_lduw_phys(cs, sm_state + 0x7e70); env->ldt.base = x86_ldq_phys(cs, sm_state + 0x7e78); env->ldt.limit = x86_ldl_phys(cs, sm_state + 0x7e74); env->ldt.flags = (x86_lduw_phys(cs, sm_state + 0x7e72) & 0xf0ff) << 8; env->idt.base = x86_ldq_phys(cs, sm_state + 0x7e88); env->idt.limit = x86_ldl_phys(cs, sm_state + 0x7e84); env->tr.selector = x86_lduw_phys(cs, sm_state + 0x7e90); env->tr.base = x86_ldq_phys(cs, sm_state + 0x7e98); env->tr.limit = x86_ldl_phys(cs, sm_state + 0x7e94); env->tr.flags = (x86_lduw_phys(cs, sm_state + 0x7e92) & 0xf0ff) << 8; env->regs[R_EAX] = x86_ldq_phys(cs, sm_state + 0x7ff8); env->regs[R_ECX] = x86_ldq_phys(cs, sm_state + 0x7ff0); env->regs[R_EDX] = x86_ldq_phys(cs, sm_state + 0x7fe8); env->regs[R_EBX] = x86_ldq_phys(cs, sm_state + 0x7fe0); env->regs[R_ESP] = x86_ldq_phys(cs, sm_state + 0x7fd8); env->regs[R_EBP] = x86_ldq_phys(cs, sm_state + 0x7fd0); env->regs[R_ESI] = x86_ldq_phys(cs, sm_state + 0x7fc8); env->regs[R_EDI] = x86_ldq_phys(cs, sm_state + 0x7fc0); for (i = 8; i < 16; i++) { env->regs[i] = x86_ldq_phys(cs, sm_state + 0x7ff8 - i * 8); } env->eip = x86_ldq_phys(cs, sm_state + 0x7f78); cpu_load_eflags(env, x86_ldl_phys(cs, sm_state + 0x7f70), ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK)); env->dr[6] = x86_ldl_phys(cs, sm_state + 0x7f68); env->dr[7] = x86_ldl_phys(cs, sm_state + 0x7f60); cpu_x86_update_cr4(env, x86_ldl_phys(cs, sm_state + 0x7f48)); cpu_x86_update_cr3(env, x86_ldq_phys(cs, sm_state + 0x7f50)); cpu_x86_update_cr0(env, x86_ldl_phys(cs, sm_state + 0x7f58)); for (i = 0; i < 6; i++) { offset = 0x7e00 + i * 16; cpu_x86_load_seg_cache(env, i, x86_lduw_phys(cs, sm_state + offset), x86_ldq_phys(cs, sm_state + offset + 8), x86_ldl_phys(cs, sm_state + offset + 4), (x86_lduw_phys(cs, sm_state + offset + 2) & 0xf0ff) << 8); } val = x86_ldl_phys(cs, sm_state + 0x7efc); /* revision ID */ if (val & 0x20000) { env->smbase = x86_ldl_phys(cs, sm_state + 0x7f00); } #else cpu_x86_update_cr0(env, x86_ldl_phys(cs, sm_state + 0x7ffc)); cpu_x86_update_cr3(env, x86_ldl_phys(cs, sm_state + 0x7ff8)); cpu_load_eflags(env, x86_ldl_phys(cs, sm_state + 0x7ff4), ~(CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C | DF_MASK)); env->eip = x86_ldl_phys(cs, sm_state + 0x7ff0); env->regs[R_EDI] = x86_ldl_phys(cs, sm_state + 0x7fec); env->regs[R_ESI] = x86_ldl_phys(cs, sm_state + 0x7fe8); env->regs[R_EBP] = x86_ldl_phys(cs, sm_state + 0x7fe4); env->regs[R_ESP] = x86_ldl_phys(cs, sm_state + 0x7fe0); env->regs[R_EBX] = x86_ldl_phys(cs, sm_state + 0x7fdc); env->regs[R_EDX] = x86_ldl_phys(cs, sm_state + 0x7fd8); env->regs[R_ECX] = x86_ldl_phys(cs, sm_state + 0x7fd4); env->regs[R_EAX] = x86_ldl_phys(cs, sm_state + 0x7fd0); env->dr[6] = x86_ldl_phys(cs, sm_state + 0x7fcc); env->dr[7] = x86_ldl_phys(cs, sm_state + 0x7fc8); env->tr.selector = x86_ldl_phys(cs, sm_state + 0x7fc4) & 0xffff; env->tr.base = x86_ldl_phys(cs, sm_state + 0x7f64); env->tr.limit = x86_ldl_phys(cs, sm_state + 0x7f60); env->tr.flags = (x86_ldl_phys(cs, sm_state + 0x7f5c) & 0xf0ff) << 8; env->ldt.selector = x86_ldl_phys(cs, sm_state + 0x7fc0) & 0xffff; env->ldt.base = x86_ldl_phys(cs, sm_state + 0x7f80); env->ldt.limit = x86_ldl_phys(cs, sm_state + 0x7f7c); env->ldt.flags = (x86_ldl_phys(cs, sm_state + 0x7f78) & 0xf0ff) << 8; env->gdt.base = x86_ldl_phys(cs, sm_state + 0x7f74); env->gdt.limit = x86_ldl_phys(cs, sm_state + 0x7f70); env->idt.base = x86_ldl_phys(cs, sm_state + 0x7f58); env->idt.limit = x86_ldl_phys(cs, sm_state + 0x7f54); for (i = 0; i < 6; i++) { if (i < 3) { offset = 0x7f84 + i * 12; } else { offset = 0x7f2c + (i - 3) * 12; } cpu_x86_load_seg_cache(env, i, x86_ldl_phys(cs, sm_state + 0x7fa8 + i * 4) & 0xffff, x86_ldl_phys(cs, sm_state + offset + 8), x86_ldl_phys(cs, sm_state + offset + 4), (x86_ldl_phys(cs, sm_state + offset) & 0xf0ff) << 8); } cpu_x86_update_cr4(env, x86_ldl_phys(cs, sm_state + 0x7f14)); val = x86_ldl_phys(cs, sm_state + 0x7efc); /* revision ID */ if (val & 0x20000) { env->smbase = x86_ldl_phys(cs, sm_state + 0x7ef8); } #endif if ((env->hflags2 & HF2_SMM_INSIDE_NMI_MASK) == 0) { env->hflags2 &= ~HF2_NMI_MASK; } env->hflags2 &= ~HF2_SMM_INSIDE_NMI_MASK; env->hflags &= ~HF_SMM_MASK; cpu_smm_update(cpu); qemu_log_mask(CPU_LOG_INT, "SMM: after RSM\n"); log_cpu_state_mask(CPU_LOG_INT, CPU(cpu), CPU_DUMP_CCOP); }
1
285,796
get_negotiable_mechs(OM_uint32 *minor_status, spnego_gss_cred_id_t spcred, gss_cred_usage_t usage, gss_OID_set *rmechs) { OM_uint32 ret, tmpmin; gss_cred_id_t creds = GSS_C_NO_CREDENTIAL, *credptr; gss_OID_set cred_mechs = GSS_C_NULL_OID_SET; gss_OID_set intersect_mechs = GSS_C_NULL_OID_SET; unsigned int i; int present; if (spcred == NULL) { /* * The default credentials were supplied. Return a list of all * available mechs except SPNEGO. When initiating, trim this * list to mechs we can acquire credentials for. */ credptr = (usage == GSS_C_INITIATE) ? &creds : NULL; ret = get_available_mechs(minor_status, GSS_C_NO_NAME, usage, GSS_C_NO_CRED_STORE, credptr, rmechs); gss_release_cred(&tmpmin, &creds); return (ret); } /* Get the list of mechs in the mechglue cred. */ ret = gss_inquire_cred(minor_status, spcred->mcred, NULL, NULL, NULL, &cred_mechs); if (ret != GSS_S_COMPLETE) return (ret); if (spcred->neg_mechs == GSS_C_NULL_OID_SET) { /* gss_set_neg_mechs was never called; return cred_mechs. */ *rmechs = cred_mechs; *minor_status = 0; return (GSS_S_COMPLETE); } /* Compute the intersection of cred_mechs and spcred->neg_mechs, * preserving the order in spcred->neg_mechs. */ ret = gss_create_empty_oid_set(minor_status, &intersect_mechs); if (ret != GSS_S_COMPLETE) { gss_release_oid_set(&tmpmin, &cred_mechs); return (ret); } for (i = 0; i < spcred->neg_mechs->count; i++) { gss_test_oid_set_member(&tmpmin, &spcred->neg_mechs->elements[i], cred_mechs, &present); if (!present) continue; ret = gss_add_oid_set_member(minor_status, &spcred->neg_mechs->elements[i], &intersect_mechs); if (ret != GSS_S_COMPLETE) break; } gss_release_oid_set(&tmpmin, &cred_mechs); if (intersect_mechs->count == 0 || ret != GSS_S_COMPLETE) { gss_release_oid_set(&tmpmin, &intersect_mechs); *minor_status = ERR_SPNEGO_NO_MECHS_AVAILABLE; map_errcode(minor_status); return (GSS_S_FAILURE); } *rmechs = intersect_mechs; *minor_status = 0; return (GSS_S_COMPLETE); }
0
437
static int ipvideo_decode_block_opcode_0x9 ( IpvideoContext * s ) { int x , y ; unsigned char P [ 4 ] ; bytestream2_get_buffer ( & s -> stream_ptr , P , 4 ) ; if ( P [ 0 ] <= P [ 1 ] ) { if ( P [ 2 ] <= P [ 3 ] ) { for ( y = 0 ; y < 8 ; y ++ ) { int flags = bytestream2_get_le16 ( & s -> stream_ptr ) ; for ( x = 0 ; x < 8 ; x ++ , flags >>= 2 ) * s -> pixel_ptr ++ = P [ flags & 0x03 ] ; s -> pixel_ptr += s -> line_inc ; } } else { uint32_t flags ; flags = bytestream2_get_le32 ( & s -> stream_ptr ) ; for ( y = 0 ; y < 8 ; y += 2 ) { for ( x = 0 ; x < 8 ; x += 2 , flags >>= 2 ) { s -> pixel_ptr [ x ] = s -> pixel_ptr [ x + 1 ] = s -> pixel_ptr [ x + s -> stride ] = s -> pixel_ptr [ x + 1 + s -> stride ] = P [ flags & 0x03 ] ; } s -> pixel_ptr += s -> stride * 2 ; } } } else { uint64_t flags ; flags = bytestream2_get_le64 ( & s -> stream_ptr ) ; if ( P [ 2 ] <= P [ 3 ] ) { for ( y = 0 ; y < 8 ; y ++ ) { for ( x = 0 ; x < 8 ; x += 2 , flags >>= 2 ) { s -> pixel_ptr [ x ] = s -> pixel_ptr [ x + 1 ] = P [ flags & 0x03 ] ; } s -> pixel_ptr += s -> stride ; } } else { for ( y = 0 ; y < 8 ; y += 2 ) { for ( x = 0 ; x < 8 ; x ++ , flags >>= 2 ) { s -> pixel_ptr [ x ] = s -> pixel_ptr [ x + s -> stride ] = P [ flags & 0x03 ] ; } s -> pixel_ptr += s -> stride * 2 ; } } } return 0 ; }
1
328,457
static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, enum AVPixelFormat srcFormat_in, enum AVPixelFormat dstFormat_in) { char buf[256]; while (fgets(buf, sizeof(buf), fp)) { struct Results r; enum AVPixelFormat srcFormat; char srcStr[12]; int srcW, srcH; enum AVPixelFormat dstFormat; char dstStr[12]; int dstW, dstH; int flags; int ret; ret = sscanf(buf, " %12s %dx%d -> %12s %dx%d flags=%d CRC=%x" " SSD=%"SCNu64 ", %"SCNu64 ", %"SCNu64 ", %"SCNu64 "\n", srcStr, &srcW, &srcH, dstStr, &dstW, &dstH, &flags, &r.crc, &r.ssdY, &r.ssdU, &r.ssdV, &r.ssdA); if (ret != 12) { srcStr[0] = dstStr[0] = 0; ret = sscanf(buf, "%12s -> %12s\n", srcStr, dstStr); } srcFormat = av_get_pix_fmt(srcStr); dstFormat = av_get_pix_fmt(dstStr); if (srcFormat == AV_PIX_FMT_NONE || dstFormat == AV_PIX_FMT_NONE || srcW > 8192U || srcH > 8192U || dstW > 8192U || dstH > 8192U) { fprintf(stderr, "malformed input file\n"); return -1; } if ((srcFormat_in != AV_PIX_FMT_NONE && srcFormat_in != srcFormat) || (dstFormat_in != AV_PIX_FMT_NONE && dstFormat_in != dstFormat)) continue; if (ret != 12) { printf("%s", buf); continue; } doTest(ref, refStride, w, h, srcFormat, dstFormat, srcW, srcH, dstW, dstH, flags, &r); } return 0; }
1
508,981
static int dtls1_process_buffered_records(SSL *s) { pitem *item; SSL3_BUFFER *rb; SSL3_RECORD *rr; DTLS1_BITMAP *bitmap; unsigned int is_next_epoch; int replayok = 1; item = pqueue_peek(s->d1->unprocessed_rcds.q); if (item) { /* Check if epoch is current. */ if (s->d1->unprocessed_rcds.epoch != s->d1->r_epoch) return 1; /* Nothing to do. */ rr = &s->s3->rrec; rb = &s->s3->rbuf; if (rb->left > 0) { /* * We've still got data from the current packet to read. There could * be a record from the new epoch in it - so don't overwrite it * with the unprocessed records yet (we'll do it when we've * finished reading the current packet). */ return 1; } /* Process all the records. */ while (pqueue_peek(s->d1->unprocessed_rcds.q)) { dtls1_get_unprocessed_record(s); bitmap = dtls1_get_bitmap(s, rr, &is_next_epoch); if (bitmap == NULL) { /* * Should not happen. This will only ever be NULL when the * current record is from a different epoch. But that cannot * be the case because we already checked the epoch above */ SSLerr(SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS, ERR_R_INTERNAL_ERROR); return 0; } #ifndef OPENSSL_NO_SCTP /* Only do replay check if no SCTP bio */ if (!BIO_dgram_is_sctp(SSL_get_rbio(s))) #endif { /* * Check whether this is a repeat, or aged record. We did this * check once already when we first received the record - but * we might have updated the window since then due to * records we subsequently processed. */ replayok = dtls1_record_replay_check(s, bitmap); } if (!replayok || !dtls1_process_record(s, bitmap)) { /* dump this record */ rr->length = 0; s->packet_length = 0; continue; } if (dtls1_buffer_record(s, &(s->d1->processed_rcds), s->s3->rrec.seq_num) < 0) return 0; } } /* * sync epoch numbers once all the unprocessed records have been * processed */ s->d1->processed_rcds.epoch = s->d1->r_epoch; s->d1->unprocessed_rcds.epoch = s->d1->r_epoch + 1; return 1; }
0
314,859
void ExpectDelegateCreation() { delegate_ = new StrictMock<MockDelegate>(); mock_delegate_factory_.PrepareDelegateForCreation( base::WrapUnique(delegate_)); EXPECT_TRUE( base::CancelableSyncSocket::CreatePair(&local_, foreign_socket_.get())); base::SharedMemoryCreateOptions shmem_options; shmem_options.size = kShmemSize; shmem_options.share_read_only = true; EXPECT_TRUE(mem_.Create(shmem_options)); EXPECT_CALL(mock_delegate_factory_, MockCreateDelegate(NotNull())) .WillOnce(SaveArg<0>(&delegate_event_handler_)); }
0
493,207
get_constraint_index(Oid constraintId) { Oid indexId = InvalidOid; Relation depRel; ScanKeyData key[3]; SysScanDesc scan; HeapTuple tup; /* Search the dependency table for the dependent index */ depRel = table_open(DependRelationId, AccessShareLock); ScanKeyInit(&key[0], Anum_pg_depend_refclassid, BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(ConstraintRelationId)); ScanKeyInit(&key[1], Anum_pg_depend_refobjid, BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(constraintId)); ScanKeyInit(&key[2], Anum_pg_depend_refobjsubid, BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(0)); scan = systable_beginscan(depRel, DependReferenceIndexId, true, NULL, 3, key); while (HeapTupleIsValid(tup = systable_getnext(scan))) { Form_pg_depend deprec = (Form_pg_depend) GETSTRUCT(tup); /* * We assume any internal dependency of an index on the constraint * must be what we are looking for. */ if (deprec->classid == RelationRelationId && deprec->objsubid == 0 && deprec->deptype == DEPENDENCY_INTERNAL) { char relkind = get_rel_relkind(deprec->objid); /* * This is pure paranoia; there shouldn't be any other relkinds * dependent on a constraint. */ if (relkind != RELKIND_INDEX && relkind != RELKIND_PARTITIONED_INDEX) continue; indexId = deprec->objid; break; } } systable_endscan(scan); table_close(depRel, AccessShareLock); return indexId; }
0
26,788
TEST_F ( TemplateURLTest , URLRefTestImageURLWithPOST ) { const char kInvalidPostParamsString [ ] = "unknown_template={ UnknownTemplate} ,bad_value=bad{ value} ," "{ google:sbiSource} " ; const char kValidPostParamsString [ ] = "image_content={ google:imageThumbnail} ,image_url={ google:imageURL} ," "sbisrc={ google:imageSearchSource} ,language={ language} ,empty_param=," "constant_param=constant,width={ google:imageOriginalWidth} " ; const char KImageSearchURL [ ] = "http://foo.com/sbi" ; TemplateURLData data ; data . image_url = KImageSearchURL ; data . image_url_post_params = kInvalidPostParamsString ; TemplateURL url_bad ( data ) ; ASSERT_FALSE ( url_bad . image_url_ref ( ) . IsValid ( search_terms_data_ ) ) ; const TemplateURLRef : : PostParams & bad_post_params = url_bad . image_url_ref ( ) . post_params_ ; ASSERT_EQ ( 2U , bad_post_params . size ( ) ) ; ExpectPostParamIs ( bad_post_params [ 0 ] , "unknown_template" , "{ UnknownTemplate} " ) ; ExpectPostParamIs ( bad_post_params [ 1 ] , "bad_value" , "bad{ value} " ) ; data . image_url_post_params = kValidPostParamsString ; TemplateURL url ( data ) ; ASSERT_TRUE ( url . image_url_ref ( ) . IsValid ( search_terms_data_ ) ) ; ASSERT_FALSE ( url . image_url_ref ( ) . SupportsReplacement ( search_terms_data_ ) ) ; TemplateURLRef : : SearchTermsArgs search_args ( ASCIIToUTF16 ( "X" ) ) ; search_args . image_thumbnail_content = "dummy-image-thumbnail" ; search_args . image_url = GURL ( "http://dummyimage.com/dummy.jpg" ) ; search_args . image_original_size = gfx : : Size ( 10 , 10 ) ; TestingSearchTermsData search_terms_data ( "http://X" ) ; GURL result ( url . image_url_ref ( ) . ReplaceSearchTerms ( search_args , search_terms_data ) ) ; ASSERT_TRUE ( result . is_valid ( ) ) ; EXPECT_EQ ( KImageSearchURL , result . spec ( ) ) ; TemplateURLRef : : PostContent post_content ; result = GURL ( url . image_url_ref ( ) . ReplaceSearchTerms ( search_args , search_terms_data , & post_content ) ) ; ASSERT_TRUE ( result . is_valid ( ) ) ; EXPECT_EQ ( KImageSearchURL , result . spec ( ) ) ; ASSERT_FALSE ( post_content . first . empty ( ) ) ; ASSERT_FALSE ( post_content . second . empty ( ) ) ; const TemplateURLRef : : Replacements & replacements = url . image_url_ref ( ) . replacements_ ; const TemplateURLRef : : PostParams & post_params = url . image_url_ref ( ) . post_params_ ; EXPECT_EQ ( 7U , post_params . size ( ) ) ; for ( TemplateURLRef : : PostParams : : const_iterator i = post_params . begin ( ) ; i != post_params . end ( ) ; ++ i ) { TemplateURLRef : : Replacements : : const_iterator j = replacements . begin ( ) ; for ( ; j != replacements . end ( ) ; ++ j ) { if ( j -> is_post_param && j -> index == static_cast < size_t > ( i - post_params . begin ( ) ) ) { switch ( j -> type ) { case TemplateURLRef : : GOOGLE_IMAGE_ORIGINAL_WIDTH : ExpectPostParamIs ( * i , "width" , base : : IntToString ( search_args . image_original_size . width ( ) ) ) ; break ; case TemplateURLRef : : GOOGLE_IMAGE_SEARCH_SOURCE : ExpectPostParamIs ( * i , "sbisrc" , search_terms_data . GoogleImageSearchSource ( ) ) ; break ; case TemplateURLRef : : GOOGLE_IMAGE_THUMBNAIL : ExpectPostParamIs ( * i , "image_content" , search_args . image_thumbnail_content , "image/jpeg" ) ; break ; case TemplateURLRef : : GOOGLE_IMAGE_URL : ExpectPostParamIs ( * i , "image_url" , search_args . image_url . spec ( ) ) ; break ; case TemplateURLRef : : LANGUAGE : ExpectPostParamIs ( * i , "language" , "en" ) ; break ; default : ADD_FAILURE ( ) ; } break ; } } if ( j != replacements . end ( ) ) continue ; if ( i -> name == "empty_param" ) ExpectPostParamIs ( * i , "empty_param" , std : : string ( ) ) ; else ExpectPostParamIs ( * i , "constant_param" , "constant" ) ; } }
0
322,592
static void init_blk_migration_it(void *opaque, BlockDriverState *bs) { Monitor *mon = opaque; BlkMigDevState *bmds; int64_t sectors; if (!bdrv_is_read_only(bs)) { sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS; if (sectors <= 0) { return; } bmds = g_malloc0(sizeof(BlkMigDevState)); bmds->bs = bs; bmds->bulk_completed = 0; bmds->total_sectors = sectors; bmds->completed_sectors = 0; bmds->shared_base = block_mig_state.shared_base; alloc_aio_bitmap(bmds); drive_get_ref(drive_get_by_blockdev(bs)); bdrv_set_in_use(bs, 1); block_mig_state.total_sector_sum += sectors; if (bmds->shared_base) { monitor_printf(mon, "Start migration for %s with shared base " "image\n", bs->device_name); } else { monitor_printf(mon, "Start full migration for %s\n", bs->device_name); } QSIMPLEQ_INSERT_TAIL(&block_mig_state.bmds_list, bmds, entry); } }
0
440,377
CACHE_LIMITER_FUNC(public) /* {{{ */ { char buf[MAX_STR + 1]; struct timeval tv; time_t now; gettimeofday(&tv, NULL); now = tv.tv_sec + PS(cache_expire) * 60; memcpy(buf, EXPIRES, sizeof(EXPIRES) - 1); strcpy_gmt(buf + sizeof(EXPIRES) - 1, &now); ADD_HEADER(buf); snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=" ZEND_LONG_FMT, PS(cache_expire) * 60); /* SAFE */ ADD_HEADER(buf); last_modified(); }
0
342,083
static void pci_host_config_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned len) { PCIHostState *s = opaque; PCI_DPRINTF("%s addr " TARGET_FMT_plx " len %d val %"PRIx64"\n", __func__, addr, len, val); s->config_reg = val;
1
516,421
static int test_smallsafeprime(int kBits) { BIGNUM *r; int st = 0; if (!TEST_ptr(r = BN_new())) goto err; if (kBits <= 5 && kBits != 3) { if (!TEST_false(BN_generate_prime_ex(r, kBits, 1, NULL, NULL, NULL))) goto err; } else { if (!TEST_true(BN_generate_prime_ex(r, kBits, 1, NULL, NULL, NULL)) || !TEST_int_eq(BN_num_bits(r), kBits)) goto err; } st = 1; err: BN_free(r); return st; }
0
370,742
static void nmea_event_hook(struct gps_device_t *session, event_t event) { if (session->context->readonly) return; /* * This is where we try to tickle NMEA devices into revealing their * inner natures. */ if (event == event_configure) { /* * The reason for splitting these probes up by packet sequence * number, interleaving them with the first few packet receives, * is because many generic-NMEA devices get confused if you send * too much at them in one go. * * A fast response to an early probe will change drivers so the * later ones won't be sent at all. Thus, for best overall * performance, order these to probe for the most popular types * soonest. * * Note: don't make the trigger strings identical to the probe, * because some NMEA devices (notably SiRFs) will just echo * unknown strings right back at you. A useful dodge is to append * a comma to the trigger, because that won't be in the response * unless there is actual following data. */ switch (session->packet.counter) { #ifdef NMEA_ENABLE case 0: /* probe for Garmin serial GPS -- expect $PGRMC followed by data */ gpsd_report(LOG_PROG, "=> Probing for Garmin NMEA\n"); (void)nmea_send(session, "$PGRMCE"); break; #endif /* NMEA_ENABLE */ #ifdef SIRF_ENABLE case 1: /* * We used to try to probe for SiRF by issuing "$PSRF105,1" * and expecting "$Ack Input105.". But it turns out this * only works for SiRF-IIs; SiRF-I and SiRF-III don't respond. * Thus the only reliable probe is to try to flip the SiRF into * binary mode, cluing in the library to revert it on close. * * SiRFs dominate the GPS-mouse market, so we used to put this test * first. Unfortunately this causes problems for gpsctl, as it cannot * select the NMEA driver without switching the device back to * binary mode! Fix this if we ever find a nondisruptive probe string. */ gpsd_report(LOG_PROG, "=> Probing for SiRF\n"); (void)nmea_send(session, "$PSRF100,0,%d,%d,%d,0", session->gpsdata.dev.baudrate, 9 - session->gpsdata.dev.stopbits, session->gpsdata.dev.stopbits); session->back_to_nmea = true; break; #endif /* SIRF_ENABLE */ #ifdef NMEA_ENABLE case 2: /* probe for the FV-18 -- expect $PFEC,GPint followed by data */ gpsd_report(LOG_PROG, "=> Probing for FV-18\n"); (void)nmea_send(session, "$PFEC,GPint"); break; case 3: /* probe for the Trimble Copernicus */ gpsd_report(LOG_PROG, "=> Probing for Trimble Copernicus\n"); (void)nmea_send(session, "$PTNLSNM,0139,01"); break; #endif /* NMEA_ENABLE */ #ifdef EVERMORE_ENABLE case 4: gpsd_report(LOG_PROG, "=> Probing for Evermore\n"); /* Enable checksum and GGA(1s), GLL(0s), GSA(1s), GSV(1s), RMC(1s), VTG(0s), PEMT101(1s) */ /* EverMore will reply with: \x10\x02\x04\x38\x8E\xC6\x10\x03 */ (void)gpsd_write(session, "\x10\x02\x12\x8E\x7F\x01\x01\x00\x01\x01\x01\x00\x01\x00\x00\x00\x00\x00\x00\x13\x10\x03", 22); break; #endif /* EVERMORE_ENABLE */ #ifdef GPSCLOCK_ENABLE case 5: /* probe for Furuno Electric GH-79L4-N (GPSClock); expect $PFEC,GPssd */ gpsd_report(LOG_PROG, "=> Probing for GPSClock\n"); (void)nmea_send(session, "$PFEC,GPsrq"); break; #endif /* GPSCLOCK_ENABLE */ #ifdef ASHTECH_ENABLE case 6: /* probe for Ashtech -- expect $PASHR,RID */ gpsd_report(LOG_PROG, "=> Probing for Ashtech\n"); (void)nmea_send(session, "$PASHQ,RID"); break; #endif /* ASHTECH_ENABLE */ #ifdef UBX_ENABLE case 7: /* probe for UBX -- query software version */ gpsd_report(LOG_PROG, "=> Probing for UBX\n"); (void)ubx_write(session, 0x0au, 0x04, NULL, 0); break; #endif /* UBX_ENABLE */ #ifdef MTK3301_ENABLE case 8: /* probe for MTK-3301 -- expect $PMTK705 */ gpsd_report(LOG_PROG, "=> Probing for MediaTek\n"); (void)nmea_send(session, "$PMTK605"); break; #endif /* MTK3301_ENABLE */ default: break; } } }
0
157,006
_lyd_insert_hash(struct lyd_node *node, int keyless_list_check) { struct lyd_node *iter; int i; if (node->parent) { if ((node->schema->nodetype != LYS_LIST) || lyd_list_has_keys(node)) { if ((node->schema->nodetype == LYS_LEAF) && lys_is_key((struct lys_node_leaf *)node->schema, NULL)) { /* we are adding a key which means that it may be the last missing key for our parent's hash */ if (!lyd_hash(node->parent)) { /* yep, we successfully hashed node->parent so it is technically now added to its parent (hash-wise) */ _lyd_insert_hash(node->parent, 0); } } /* create parent hash table if required, otherwise just add the new child */ if (!node->parent->ht) { for (i = 0, iter = node->parent->child; iter; ++i, iter = iter->next) { if ((iter->schema->nodetype == LYS_LIST) && !lyd_list_has_keys(iter)) { /* it will either never have keys and will never be hashed or has not all keys created yet */ --i; } } assert(i <= LY_CACHE_HT_MIN_CHILDREN); if (i == LY_CACHE_HT_MIN_CHILDREN) { /* create hash table, insert all the children */ node->parent->ht = lyht_new(1, sizeof(struct lyd_node *), lyd_hash_table_val_equal, NULL, 1); LY_TREE_FOR(node->parent->child, iter) { if ((iter->schema->nodetype == LYS_LIST) && !lyd_list_has_keys(iter)) { /* skip lists without keys */ continue; } if (lyht_insert(node->parent->ht, &iter, iter->hash, NULL)) { assert(0); } } } } else { if (lyht_insert(node->parent->ht, &node, node->hash, NULL)) { assert(0); } } /* if node was in a state data subtree, wasn't it a part of a key-less list hash? */ if (keyless_list_check) { lyd_keyless_list_hash_change(node->parent); } } } }
0
127,457
static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id) { AVDictionaryEntry *tag = NULL; int ret = 0; if (!tags) return 0; writer_print_section_header(w, section_id); while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX))) { if ((ret = print_str_validate(tag->key, tag->value)) < 0) break; } writer_print_section_footer(w); return ret; }
0
22,387
static inline void e1000e_write_ps_rx_descr ( E1000ECore * core , uint8_t * desc , struct NetRxPkt * pkt , const E1000E_RSSInfo * rss_info , size_t ps_hdr_len , uint16_t ( * written ) [ MAX_PS_BUFFERS ] ) { int i ; union e1000_rx_desc_packet_split * d = ( union e1000_rx_desc_packet_split * ) desc ; memset ( & d -> wb , 0 , sizeof ( d -> wb ) ) ; d -> wb . middle . length0 = cpu_to_le16 ( ( * written ) [ 0 ] ) ; for ( i = 0 ; i < PS_PAGE_BUFFERS ; i ++ ) { d -> wb . upper . length [ i ] = cpu_to_le16 ( ( * written ) [ i + 1 ] ) ; } e1000e_build_rx_metadata ( core , pkt , pkt != NULL , rss_info , & d -> wb . lower . hi_dword . rss , & d -> wb . lower . mrq , & d -> wb . middle . status_error , & d -> wb . lower . hi_dword . csum_ip . ip_id , & d -> wb . middle . vlan ) ; d -> wb . upper . header_status = cpu_to_le16 ( ps_hdr_len | ( ps_hdr_len ? E1000_RXDPS_HDRSTAT_HDRSP : 0 ) ) ; trace_e1000e_rx_desc_ps_write ( ( * written ) [ 0 ] , ( * written ) [ 1 ] , ( * written ) [ 2 ] , ( * written ) [ 3 ] ) ; }
0
38,277
R_API bool r_bin_load_io_at_offset_as(RBin *bin, int fd, ut64 baseaddr, ut64 loadaddr, int xtr_idx, ut64 offset, const char *name) { // adding file_sz to help reduce the performance impact on the system // in this case the number of bytes read will be limited to 2MB // (MIN_LOAD_SIZE) // if it fails, the whole file is loaded. const ut64 MAX_LOAD_SIZE = 0; // 0xfffff; //128 * (1 << 10 << 10); int res = r_bin_load_io_at_offset_as_sz (bin, fd, baseaddr, loadaddr, xtr_idx, offset, name, MAX_LOAD_SIZE); if (!res) { res = r_bin_load_io_at_offset_as_sz (bin, fd, baseaddr, loadaddr, xtr_idx, offset, name, UT64_MAX); } return res; }
0
115,508
static void dmar_unit_show_capability(struct dmar_drhd_rt *dmar_unit) { pr_info("dmar unit[0x%x]", dmar_unit->drhd->reg_base_addr); pr_info("\tNumDomain:%d", iommu_cap_ndoms(dmar_unit->cap)); pr_info("\tAdvancedFaultLogging:%d", iommu_cap_afl(dmar_unit->cap)); pr_info("\tRequiredWBFlush:%d", iommu_cap_rwbf(dmar_unit->cap)); pr_info("\tProtectedLowMemRegion:%d", iommu_cap_plmr(dmar_unit->cap)); pr_info("\tProtectedHighMemRegion:%d", iommu_cap_phmr(dmar_unit->cap)); pr_info("\tCachingMode:%d", iommu_cap_caching_mode(dmar_unit->cap)); pr_info("\tSAGAW:0x%x", iommu_cap_sagaw(dmar_unit->cap)); pr_info("\tMGAW:%d", iommu_cap_mgaw(dmar_unit->cap)); pr_info("\tZeroLenRead:%d", iommu_cap_zlr(dmar_unit->cap)); pr_info("\tLargePageSupport:0x%x", iommu_cap_super_page_val(dmar_unit->cap)); pr_info("\tPageSelectiveInvalidation:%d", iommu_cap_pgsel_inv(dmar_unit->cap)); pr_info("\tPageSelectInvalidation:%d", iommu_cap_pgsel_inv(dmar_unit->cap)); pr_info("\tNumOfFaultRecordingReg:%d", iommu_cap_num_fault_regs(dmar_unit->cap)); pr_info("\tMAMV:0x%x", iommu_cap_max_amask_val(dmar_unit->cap)); pr_info("\tWriteDraining:%d", iommu_cap_write_drain(dmar_unit->cap)); pr_info("\tReadDraining:%d", iommu_cap_read_drain(dmar_unit->cap)); pr_info("\tPostInterrupts:%d\n", iommu_cap_pi(dmar_unit->cap)); pr_info("\tPage-walk Coherency:%d", iommu_ecap_c(dmar_unit->ecap)); pr_info("\tQueuedInvalidation:%d", iommu_ecap_qi(dmar_unit->ecap)); pr_info("\tDeviceTLB:%d", iommu_ecap_dt(dmar_unit->ecap)); pr_info("\tInterruptRemapping:%d", iommu_ecap_ir(dmar_unit->ecap)); pr_info("\tExtendedInterruptMode:%d", iommu_ecap_eim(dmar_unit->ecap)); pr_info("\tPassThrough:%d", iommu_ecap_pt(dmar_unit->ecap)); pr_info("\tSnoopControl:%d", iommu_ecap_sc(dmar_unit->ecap)); pr_info("\tIOTLB RegOffset:0x%x", iommu_ecap_iro(dmar_unit->ecap)); pr_info("\tMHMV:0x%x", iommu_ecap_mhmv(dmar_unit->ecap)); pr_info("\tECS:%d", iommu_ecap_ecs(dmar_unit->ecap)); pr_info("\tMTS:%d", iommu_ecap_mts(dmar_unit->ecap)); pr_info("\tNEST:%d", iommu_ecap_nest(dmar_unit->ecap)); pr_info("\tDIS:%d", iommu_ecap_dis(dmar_unit->ecap)); pr_info("\tPRS:%d", iommu_ecap_prs(dmar_unit->ecap)); pr_info("\tERS:%d", iommu_ecap_ers(dmar_unit->ecap)); pr_info("\tSRS:%d", iommu_ecap_srs(dmar_unit->ecap)); pr_info("\tNWFS:%d", iommu_ecap_nwfs(dmar_unit->ecap)); pr_info("\tEAFS:%d", iommu_ecap_eafs(dmar_unit->ecap)); pr_info("\tPSS:0x%x", iommu_ecap_pss(dmar_unit->ecap)); pr_info("\tPASID:%d", iommu_ecap_pasid(dmar_unit->ecap)); pr_info("\tDIT:%d", iommu_ecap_dit(dmar_unit->ecap)); pr_info("\tPDS:%d\n", iommu_ecap_pds(dmar_unit->ecap)); }
0
345,214
xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { xmlChar *name; const xmlChar *ptr; xmlChar cur; xmlEntityPtr ent = NULL; if ((str == NULL) || (*str == NULL)) return(NULL); ptr = *str; cur = *ptr; if (cur != '&') return(NULL); ptr++; name = xmlParseStringName(ctxt, &ptr); if (name == NULL) { xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED, "xmlParseStringEntityRef: no name\n"); *str = ptr; return(NULL); } if (*ptr != ';') { xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL); xmlFree(name); *str = ptr; return(NULL); } ptr++; /* * Predefined entities override any extra definition */ if ((ctxt->options & XML_PARSE_OLDSAX) == 0) { ent = xmlGetPredefinedEntity(name); if (ent != NULL) { xmlFree(name); *str = ptr; return(ent); } } /* * Increate the number of entity references parsed */ ctxt->nbentities++; /* * Ask first SAX for entity resolution, otherwise try the * entities which may have stored in the parser context. */ if (ctxt->sax != NULL) { if (ctxt->sax->getEntity != NULL) ent = ctxt->sax->getEntity(ctxt->userData, name); if ((ent == NULL) && (ctxt->options & XML_PARSE_OLDSAX)) ent = xmlGetPredefinedEntity(name); if ((ent == NULL) && (ctxt->userData==ctxt)) { ent = xmlSAX2GetEntity(ctxt, name); } } if (ctxt->instate == XML_PARSER_EOF) { xmlFree(name); return(NULL); } /* * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an * internal DTD subset which contains no parameter entity * references, or a document with "standalone='yes'", the * Name given in the entity reference must match that in an * entity declaration, except that well-formed documents * need not declare any of the following entities: amp, lt, * gt, apos, quot. * The declaration of a parameter entity must precede any * reference to it. * Similarly, the declaration of a general entity must * precede any reference to it which appears in a default * value in an attribute-list declaration. Note that if * entities are declared in the external subset or in * external parameter entities, a non-validating processor * is not obligated to read and process their declarations; * for such documents, the rule that an entity must be * declared is a well-formedness constraint only if * standalone='yes'. */ if (ent == NULL) { if ((ctxt->standalone == 1) || ((ctxt->hasExternalSubset == 0) && (ctxt->hasPErefs == 0))) { xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY, "Entity '%s' not defined\n", name); } else { xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY, "Entity '%s' not defined\n", name); } /* TODO ? check regressions ctxt->valid = 0; */ } /* * [ WFC: Parsed Entity ] * An entity reference must not contain the name of an * unparsed entity */ else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) { xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY, "Entity reference to unparsed entity %s\n", name); } /* * [ WFC: No External Entity References ] * Attribute values cannot contain direct or indirect * entity references to external entities. */ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) { xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL, "Attribute references external entity '%s'\n", name); } /* * [ WFC: No < in Attribute Values ] * The replacement text of any entity referred to directly or * indirectly in an attribute value (other than "&lt;") must * not contain a <. */ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && (ent != NULL) && (ent->content != NULL) && (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) && (xmlStrchr(ent->content, '<'))) { xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, "'<' in entity '%s' is not allowed in attributes values\n", name); } /* * Internal check, no parameter entities here ... */ else { switch (ent->etype) { case XML_INTERNAL_PARAMETER_ENTITY: case XML_EXTERNAL_PARAMETER_ENTITY: xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_PARAMETER, "Attempt to reference the parameter entity '%s'\n", name); break; default: break; } } /* * [ WFC: No Recursion ] * A parsed entity must not contain a recursive reference * to itself, either directly or indirectly. * Done somewhere else */ xmlFree(name); *str = ptr; return(ent); }
1
483,250
_gsasl_gssapi_server_finish (Gsasl_session * sctx, void *mech_data) { _Gsasl_gssapi_server_state *state = mech_data; OM_uint32 min_stat; if (!state) return; if (state->context != GSS_C_NO_CONTEXT) gss_delete_sec_context (&min_stat, &state->context, GSS_C_NO_BUFFER); if (state->cred != GSS_C_NO_CREDENTIAL) gss_release_cred (&min_stat, &state->cred); if (state->client != GSS_C_NO_NAME) gss_release_name (&min_stat, &state->client); free (state); }
0