functionSource
stringlengths
20
97.4k
CWE-119
bool
2 classes
CWE-120
bool
2 classes
CWE-469
bool
2 classes
CWE-476
bool
2 classes
CWE-other
bool
2 classes
combine
int64
0
1
low_start_scan (SANE_Int devnum, SANE_Byte * regs) { SANE_Status status; DBG (2, "low_start_scan: start\n"); /* writes registers to scanner */ regs[0x32] = 0x00; status = low_write_all_regs (devnum, regs); if (status != SANE_STATUS_GOOD) return status; regs[0x32] = 0x40; status = low_write_all_reg...
false
false
false
false
false
0
text_entry_callback(GtkWidget *widget, WrCurveDialog *wcd) { if(wcd) { if(wcd->filename) g_free(wcd->filename); wcd->filename = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); } }
false
false
false
false
false
0
classlibLoaderTable(Object *class_loader) { void *pntr = INST_DATA(class_loader, void*, ldr_classes_offset); if(isObject(pntr)) return NULL; return pntr; }
false
false
false
false
false
0
bfa_fcs_itnim_sm_online(struct bfa_fcs_itnim_s *itnim, enum bfa_fcs_itnim_event event) { struct bfad_s *bfad = (struct bfad_s *)itnim->fcs->bfad; char lpwwn_buf[BFA_STRING_32]; char rpwwn_buf[BFA_STRING_32]; bfa_trc(itnim->fcs, itnim->rport->pwwn); bfa_trc(itnim->fcs, event); switch (event) { case BFA_FCS_I...
true
true
false
false
false
1
folderview_rescan_tree(Folder *folder, gboolean rebuild) { GtkWidget *window; MainWindow *mainwin = mainwindow_get_mainwindow(); FolderView *folderview = NULL; GtkAdjustment *pos = NULL; gint height = 0; cm_return_if_fail(folder != NULL); if (!folder->klass->scan_tree) return; if (rebuild && alertpanel...
false
false
false
false
false
0
g_mime_message_set_subject (GMimeMessage *message, const char *subject) { char *encoded; g_return_if_fail (GMIME_IS_MESSAGE (message)); g_return_if_fail (subject != NULL); g_free (message->subject); message->subject = g_mime_strdup_trim (subject); encoded = g_mime_utils_header_encode_text (message->subject)...
false
false
false
false
false
0
libera(int m, float ***M) { int i; for (i = 0; i < m; i++) { free((*M)[i]); } free(*M); }
false
false
false
false
false
0
standard_ExecutorStart(QueryDesc *queryDesc, int eflags, char relOrMat) { EState *estate; MemoryContext oldcontext; /* sanity checks: queryDesc must not be started already */ Assert(queryDesc != NULL); Assert(queryDesc->estate == NULL); /* * If the transaction is read-only, we need to check if any writes a...
false
false
false
false
false
0
cleanup_pc_files(void) { int ret; int fail_flag; unsigned int max_id, max_max_id; #ifdef ENABLE_PLUGINS GList *plugin_list, *temp_list; struct plugin_s *plugin; #endif int i; char dbname[][32]={ "DatebookDB", "AddressDB", "ToDoDB", "MemoDB", "" }; /* Convert to ...
false
false
false
false
false
0
addchar ( char c ) { checkcursor(); if ( size + 1 > allocated ) changesize ( size + 1 ); for ( int i = size; i > cursor; i--) text[i] = text[i-1]; text[cursor] = c; cursor++; size++; if ( reflow() ) { display(); checkcursorpos(); } }
false
false
false
false
true
1
SetTries(const int n) { triesleft = std::max(0, n); if (triesleft == 0) location = locations.end(); else if (locations.end() == location) location = locations.begin(); SetHandle(); }
false
false
false
false
false
0
update_package_if_needed(Node *n, File *f = f_clwrap) { #ifdef ALLEGROCL_DEBUG Printf(stderr, "update_package: ENTER... \n"); Printf(stderr, " current_package = '%s'\n", current_package); Printf(stderr, " node_package = '%s'\n", Getattr(n, "allegrocl:package")); Printf(stderr, " node(%x) = '%s'\n", n, Ge...
false
false
false
false
false
0
Problem_5_test(){ Chapter10 chapter10; string input[]={"","","abc","","","efg","","hij","lmn","","","","xyz"}; vector<string> strVect(input, input+13); int result = chapter10.searchStr(strVect, 0, strVect.size(), ""); if(result!=-1) return false; result = chapter10.searchStr(strVect, 0, strVect...
false
false
false
false
false
0
addSequences(SeqArray* seqVector) { clearAlignment(); numSeqs = seqVector->size() - 1; vector<int> emptyVec; seqArray.push_back(emptyVec); // EMPTY sequence names.push_back(string("")); titles.push_back(string("")); sequenceIds.push_back(0); cout << "\nThere are " << numSeqs << " in the...
false
false
false
false
false
0
mpt3sas_config_get_sas_iounit_pg1(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigReply_t *mpi_reply, Mpi2SasIOUnitPage1_t *config_page, u16 sz) { Mpi2ConfigRequest_t mpi_request; int r; memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); mpi_request.Function = MPI2_FUNCTION_CONFIG; mpi_request.Action = MPI2_CONFIG_AC...
false
false
false
false
false
0
cs_has_ws(const char *cs) { int i; for (i = 0; cs[i] != '\000'; i++) { switch (cs[i]) { case ' ': case '\r': case '\n': case '\t': case '"': case '#': return 1; } } return 0; }
false
false
false
false
false
0
tds_des_set_odd_parity(des_cblock key) { int i; unsigned char parity; for (i = 0; i < 8; i++) { parity = key[i]; parity ^= parity >> 4; parity ^= parity >> 2; parity ^= parity >> 1; key[i] = (key[i] & 0xfe) | (parity & 1); } }
true
true
false
false
false
1
il3945_verify_ucode(struct il_priv *il) { __le32 *image; u32 len; int rc = 0; /* Try bootstrap */ image = (__le32 *) il->ucode_boot.v_addr; len = il->ucode_boot.len; rc = il3945_verify_inst_sparse(il, image, len); if (rc == 0) { D_INFO("Bootstrap uCode is good in inst SRAM\n"); return 0; } /* Try initia...
false
false
false
false
false
0
process_ai() { //---- think about which technology to research ----// if( !tech_id ) think_new_research(); //------- recruit workers ---------// if( info.game_date%15==firm_recno%15 ) { if( worker_count < MAX_WORKER ) ai_recruit_worker(); } //----- think about closing down this firm -----// if( info...
false
false
false
false
false
0
pico_get_last_fg_color(void) { char *ret = NULL; if(_last_fg_color){ size_t len; len = strlen(_last_fg_color); if((ret = (char *) fs_get((len+1) * sizeof(char))) != NULL){ strncpy(ret, _last_fg_color, len+1); ret[len] = '\0'; } } return(ret); }
false
true
false
false
false
1
gst_registry_chunks_load_plugin_dep_strv (gchar ** in, gchar * end, guint n) { gchar **arr; if (n == 0) return NULL; arr = g_new0 (gchar *, n + 1); while (n > 0) { unpack_string (*in, arr[n - 1], end, fail); --n; } return arr; fail: GST_INFO ("Reading plugin dependency strings failed"); re...
false
false
false
false
false
0
verboselog( int n_level, const char *s_fmt, ... ) { if( VERBOSE_LEVEL >= n_level ) { va_list v; char buf[ 32768 ]; va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); logerror( "%08x: %s", activecpu_get_pc(), buf ); } }
true
true
false
false
true
1
get_file( char *file_name, char **data, long *file_length) { /* Open input file */ FILE *input = fopen( file_name, "r"); if (!input) die( 1, "Can't open file \"%s\": %m.", file_name); /* Get file length */ fseek( input, 0, SEEK_END); *file_length = ftell( input); fseek( input, 0, SEEK_SET); /* Get the buffe...
false
false
false
false
true
1
option_set_command(int argc, char *argv[]) { if (argc != 3) { config_msg = "Wrong number of arguments given to set command"; return ERR; } if (strcmp(argv[1], "=")) { config_msg = "No value assigned"; return ERR; } if (!strcmp(argv[0], "show-author")) { opt_author = parse_bool(argv[2]); return OK; }...
false
false
false
false
false
0
get_native_db_data (const char *dbbase, SERIESINFO *sinfo, double **Z) { char numstr[32]; FILE *fp; dbnumber x; int v = sinfo->v; int t, t2, err = 0; fp = open_binfile(dbbase, GRETL_NATIVE_DB, sinfo->offset, &err); if (err) { return err; } t2 = (sinfo->t2 > 0)? sinfo->t2 : sin...
false
false
false
false
true
1
connect(const std::string& addr, unsigned short port) { if (_addr != addr || _port != port) { _socket.close(); _addr = addr; _port = port; } }
false
false
false
false
false
0
hfi1_read_link_quality(struct hfi1_devdata *dd, u8 *link_quality) { u32 frame; int ret; *link_quality = 0; if (dd->pport->host_link_state & HLS_UP) { ret = read_8051_config(dd, LINK_QUALITY_INFO, GENERAL_CONFIG, &frame); if (ret == 0) *link_quality = (frame >> LINK_QUALITY_SHIFT) & LINK_QUALITY_M...
false
false
false
false
false
0
globus_l_gfs_ipc_unpack_cred( globus_i_gfs_ipc_handle_t * ipc, globus_byte_t * buffer, globus_size_t len, gss_cred_id_t * out_cred) { OM_uint32 maj_rc; OM_uint32 min_rc; ...
false
false
false
false
false
0
_spellSuggest(AV_View* pAV_View, UT_uint32 ndx) { ABIWORD_VIEW; UT_return_val_if_fail (pView, false); pView->cmdContextSuggest(ndx); return true; }
false
false
false
false
false
0
report_loader_error (MonoAotCompile *acfg, MonoError *error, const char *format, ...) { FILE *output; va_list args; if (mono_error_ok (error)) return; if (acfg->logfile) output = acfg->logfile; else output = stderr; va_start (args, format); vfprintf (output, format, args); va_end (args); mono_error_cl...
false
false
false
false
true
1
mac_bench_one (int algo, struct bench_mac_mode *pmode) { struct bench_mac_mode mode = *pmode; struct bench_obj obj = { 0 }; double result; mode.algo = algo; if (mode.name[0] == '\0') bench_print_algo (-18, gcry_mac_algo_name (algo)); else bench_print_algo (18, mode.name); obj.ops = mode.ops; ...
false
false
false
false
true
1
GetLevel(int line) const { if (levels.Length() && (line >= 0) && (line < levels.Length())) { return levels[line]; } else { return SC_FOLDLEVELBASE; } }
false
false
false
false
false
0
getRecord(const int groupcode, dimeParam &param, const int index) const { switch(groupcode) { case 10: case 20: case 30: case 11: case 21: case 31: param.double_data = this->coords[groupcode % 10][groupcode / 10 - 1]; return true; } return dimeExtrusionEntity::getRecord(groupcode, pa...
false
false
false
false
false
0
gsf_output_gzip_new (GsfOutput *sink, GError **err) { GsfOutput *output; GError const *con_err; g_return_val_if_fail (GSF_IS_OUTPUT (sink), NULL); output = g_object_new (GSF_OUTPUT_GZIP_TYPE, "sink", sink, NULL); con_err = gsf_output_error (output); if (con_err) { if (err) *err = g_error_copy (con_err); ...
false
false
false
false
false
0
MochaCheckComputeReachableStates( MochaFigure ) mochafig_list *MochaFigure; { befig_list *BehFigure; ctlfig_list *CtlFigure; btrtransfunc *BtrTransFunc; bddassoc *BddAssoc; bddnode *BddNewSet; bddnode *BddCurrentSet; bddnode *BddReachedSet; bddnode *BddNode; BehFigure ...
false
false
false
false
false
0
krb5_get_time_offsets(krb5_context context, krb5_timestamp *seconds, krb5_int32 *microseconds) { krb5_os_context os_ctx = &context->os_context; if (seconds) *seconds = os_ctx->time_offset; if (microseconds) *microseconds = os_ctx->usec_offset; return 0; }
false
false
false
false
false
0
bitMap2PlayerName( int p, const GameMap* gamemap ) const { ASCString s; for ( int i = 0; i < gamemap->getPlayerCount(); ++i ) if ( p & ( 1 << i)) { if ( !s.empty() ) s += ", "; s += gamemap->getPlayer(i).getName(); } return s; }
false
false
false
false
false
0
avi_read_close(AVFormatContext *s) { int i; AVIContext *avi = s->priv_data; for(i=0;i<s->nb_streams;i++) { AVStream *st = s->streams[i]; av_free(st->codec->palctrl); } if (avi->dv_demux) av_free(avi->dv_demux); return 0; }
false
false
false
false
false
0
is_automorphism(unsigned int* const perm) { std::set<unsigned int, std::less<unsigned int> > edges1; std::set<unsigned int, std::less<unsigned int> > edges2; #if defined(BLISS_CONSISTENCY_CHECKS) if(!is_permutation(get_nof_vertices(), perm)) _INTERNAL_ERROR(); #endif for(unsigned int i = 0; i < get_nof_ve...
false
false
false
false
false
0
compare_service_types_versioned (const char *searched_service, const char *current_service) { const char *searched_version_ptr, *current_version_ptr; guint searched_version, current_version, searched_length; guint current_length; searched_version_ptr = s...
false
false
false
false
false
0
ctf_event_visit(FILE *fd, int depth, struct ctf_node *node, struct declaration_scope *parent_declaration_scope, struct ctf_trace *trace) { int ret = 0; struct ctf_node *iter; struct ctf_event_declaration *event; struct bt_ctf_event_decl *event_decl; if (node->visited) return 0; node->visited = 1; event...
false
false
false
false
false
0
ims_pcu_resume(struct usb_interface *intf) { struct ims_pcu *pcu = usb_get_intfdata(intf); struct usb_host_interface *alt = intf->cur_altsetting; int retval = 0; if (alt->desc.bInterfaceClass == USB_CLASS_COMM) { retval = ims_pcu_start_io(pcu); if (retval == 0) retval = ims_pcu_line_setup(pcu); } return ...
false
false
false
false
false
0
_timeout_job(uint32_t jobid, char *comment_ptr, int *err_code, char **err_msg) { int rc = 0; struct job_record *job_ptr; /* Write lock on job info */ slurmctld_lock_t job_write_lock = { NO_LOCK, WRITE_LOCK, NO_LOCK, NO_LOCK }; lock_slurmctld(job_write_lock); job_ptr = find_job_record(jobid); if (job_p...
false
false
false
false
false
0
resize_requested_by_parent( void ) { // #ifndef NDEBUG // ED4_base *base = (ED4_base*)this; // e4_assert(!base->flag.hidden); // #endif if (update_info.resize) { // likes to resize? if (calc_bounding_box()) { // size changed? parent->resize_requested_by_child(); // tell ...
false
false
false
false
false
0
evrpc_request_done(struct evrpc_req_generic *rpc_state) { struct evhttp_request *req = rpc_state->http_req; struct evrpc *rpc = rpc_state->rpc; if (rpc->reply_complete(rpc_state->reply) == -1) { /* the reply was not completely filled in. error out */ goto error; } if ((rpc_state->rpc_data = evbuffer_new()) ...
false
false
false
false
false
0
vmw_pm_freeze(struct device *kdev) { struct pci_dev *pdev = to_pci_dev(kdev); struct drm_device *dev = pci_get_drvdata(pdev); struct vmw_private *dev_priv = vmw_priv(dev); dev_priv->suspended = true; if (dev_priv->enable_fb) vmw_fifo_resource_dec(dev_priv); if (atomic_read(&dev_priv->num_fifo_resources) != 0)...
false
false
false
false
false
0
get(unsigned char *sector) { unsigned char tmp[2048]; UDFtag tag; dir *d; int LEA,LAD; int LIU,LFI; UDFshortad sad; UDFlongad icb; mom->UDFtagCopy(sector,&tag); if (tag.ident != 257) return NULL; LFI = sector[19]; LIU = bin2intsle(sector+36); mom->UDFlongadCopy(sector+20,&icb); if (mom->pread(icb.locatio...
false
false
false
false
false
0
mwifiex_update_rxreor_flags(struct mwifiex_adapter *adapter, u8 flags) { struct mwifiex_private *priv; struct mwifiex_rx_reorder_tbl *tbl; unsigned long lock_flags; int i; for (i = 0; i < adapter->priv_num; i++) { priv = adapter->priv[i]; if (!priv) continue; spin_lock_irqsave(&priv->rx_reorder_tbl_lock...
false
false
false
false
true
1
merge (Node *nodeA, Node *nodeB, int (*cmp) (Node *a, Node *b)) { Node *thead, *tnode; if (!nodeA) return nodeB; if (!nodeB) return nodeA; /* first move the smallest of the head nodes to our head */ if (cmp (nodeA, nodeB) <= 0) { /* a is smaller than or equal to b */ thead = nodeA; nodeA = nodeA->down; ...
false
false
false
false
false
0
dispatch(Window win, XEvent &ev, bool parent) { EventHandler *evhand = 0; if (parent) evhand = m_parent[win]; else { win = getEventWindow(ev); evhand = m_eventhandlers[win]; } if (evhand == 0) return; switch (ev.type) { case KeyPress: evhand->keyPres...
false
false
false
false
false
0
mkp_project_load_node (MkpProject *project, AnjutaProjectNode *node, GError **error) { switch (anjuta_project_node_get_node_type (node)) { case ANJUTA_PROJECT_ROOT: project->loading++; DEBUG_PRINT("*** Loading project: %p root file: %p\n", project, project->root_file); return mkp_project_load_root (project, no...
false
false
false
false
false
0
delete_file() { char path[1024], buf[1024]; sprintf(path, "%s/data.vda", dir); ssize_t n = readlink(path, buf, sizeof(buf)-1); if (n < 0) { printf("readlink %s failed\n", path); return ERR_SYMLINK; } buf[n] = 0; int retval = unlink(buf); if (retval) { printf("unli...
false
false
false
false
false
0
cleanup(gpointer id) { ConfData *cd; cd = g_hash_table_lookup(id_hash, id); if (cd) { gint defx, defy; gtk_window_get_size(GTK_WINDOW (cd->window), &defx, &defy); if (cd->scrolled) { prefs_set_int("size_conf_sw.x", defx); prefs_set_int("size_conf_sw.y", defy)...
false
false
false
false
false
0
editorWidget(const CLAM::DynamicType & object, unsigned attribute) { CLAM::DirectoryName & value = *(CLAM::DirectoryName *)object.GetAttributeAsVoidPtr(attribute); QFileLineEdit * input = new QFileLineEdit; input->setDirMode(true); input->setLocation(QString::fromLocal8Bit(value.c_str())); input->setDialogCa...
false
false
false
false
false
0
ladish_hide_connections(struct ladish_graph * graph_ptr, struct ladish_graph_port * port_ptr) { struct list_head * node_ptr; struct ladish_graph_connection * connection_ptr; log_info("hidding connections of port %"PRIu64, port_ptr->id); ASSERT(graph_ptr->opath != NULL); list_for_each(node_ptr, &graph_ptr->...
false
false
false
false
false
0
update (void) const { // The existence of the object means a read lock is being held. int result; ACE_stat statbuf; if (ACE_OS::stat (this->filename_, &statbuf) == -1) result = 1; else result = ACE_OS::difftime (this->stat_.st_mtime, statbuf.st_mtime) < 0; return result; }
false
false
false
false
false
0
SetResolveCoincidentTopologyPolygonOffsetParameters( double factor, double units) { if (factor == vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFactor && units == vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetUnits ) { return; } vtkMapperGl...
false
false
false
false
false
0
pstdout_set_fanout(unsigned int fanout) { int rc, rv = -1; if (!(fanout >= PSTDOUT_FANOUT_MIN && fanout <= PSTDOUT_FANOUT_MAX)) { pstdout_errnum = PSTDOUT_ERR_PARAMETERS; return -1; } if ((rc = pthread_mutex_lock(&pstdout_launch_mutex))) { if (pstdout_debug_flags & PSTDOUT_DEBUG_ST...
false
false
false
false
false
0
go_color_selector_drag_data_get (GOSelector *selector) { GOColorSelectorState *state; GOColor color; int index; guint16 *data; state = go_selector_get_user_data (selector); data = g_new0 (guint16, 4); index = go_selector_get_active (selector, NULL); color = get_color (state->n_swatches, state->color_group, in...
false
false
false
false
false
0
extend_table(struct pstore_table *table, int input) { unsigned long ndx; for (ndx = 0; ndx < table->nr_columns; ndx++) { struct pstore_column *column = table->columns[ndx]; if (pstore_column_matches(column, column_ref)) { if (extend_column(column, input) < 0) return -1; } } return 0; }
false
false
false
false
false
0
mark_ident (struct cpp_reader *pfile ATTRIBUTE_UNUSED, hashnode h, const void *v ATTRIBUTE_UNUSED) { gt_ggc_m_9tree_node (HT_IDENT_TO_GCC_IDENT (h)); return 1; }
false
false
false
false
false
0
doRotate() { _ofile.clear(); _ofile.close(); // ignore unlink- and rename-errors. In case of failure the // original file is reopened std::string newfilename = mkfilename(_maxbackupindex); ::unlink(newfilename.c_str()); for (unsigned idx = _maxbackupindex; idx > 0; --idx)...
false
false
false
false
false
0
_wi_array_insert_item_at_index(wi_array_t *array, _wi_array_item_t *item, wi_uinteger_t index) { if(array->data_count >= array->items_count) _wi_array_grow(array, array->data_count + 1); memmove(array->items + index + 1, array->items + index, (array->data_count - index) * sizeof(_wi_array_item_t *)); arr...
false
false
false
false
false
0
nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip, int page) { int length = mtd->oobsize; int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad; int eccsize = chip->ecc.size; uint8_t *bufpoi = chip->oob_poi; int i, toread, sndrnd = 0, pos; chip->cmdfunc(mtd, NAND_CMD_READ0, c...
false
false
false
false
false
0
raw_eject(BlockDriverState *bs, int eject_flag) { BDRVRawState *s = bs->opaque; switch(s->type) { case FTYPE_CD: if (eject_flag) { if (ioctl (s->fd, CDROMEJECT, NULL) < 0) perror("CDROMEJECT"); } else { if (ioctl (s->fd, CDROMCLOSETRAY, NULL) < 0) ...
false
false
false
false
true
1
module_server() { int listen_sd; ///< Socket to listen to a client #if defined(_WIN32) && !defined(__CYGWIN32__) int sd; #endif /* prepare socket to listen */ if ((listen_sd = ready_as_server(module_port)) < 0) { fprintf(stderr, "Error: failed to bind socket\n"); return; } printf ("//////////...
false
false
false
false
false
0
find_free_size(const unsigned int size, skip_alloc_t *update_p) { int level_c, cmp; skip_alloc_t *slot_p, *found_p = NULL, *next_p; /* skip_free_max_level */ level_c = MAX_SKIP_LEVEL - 1; slot_p = skip_free_list; /* traverse list to smallest entry */ while (1) { /* next on we are loo...
false
false
false
false
true
1
e_wizard_init(void) { E_Manager *man; Eina_List *l; EINA_LIST_FOREACH(e_manager_list(), l, man) { E_Container *con; Eina_List *l2; EINA_LIST_FOREACH(man->containers, l2, con) { Eina_List *l3; E_Zone *zone; EINA_LIST_FOREACH(con->z...
false
false
false
false
false
0
sysfs_kf_seq_show(struct seq_file *sf, void *v) { struct kernfs_open_file *of = sf->private; struct kobject *kobj = of->kn->parent->priv; const struct sysfs_ops *ops = sysfs_file_ops(of->kn); ssize_t count; char *buf; /* acquire buffer and ensure that it's >= PAGE_SIZE and clear */ count = seq_get_buf(sf, &buf)...
false
false
false
false
false
0
mxf_probe(AVProbeData *p) { uint8_t *bufp = p->buf; uint8_t *end = p->buf + p->buf_size; if (p->buf_size < sizeof(mxf_header_partition_pack_key)) return 0; /* Must skip Run-In Sequence and search for MXF header partition pack key SMPTE 377M 5.5 */ end -= sizeof(mxf_header_partition_pack_ke...
false
false
false
false
false
0
to_utf8() const { if (!size()) { return byte_array(); } MiniIconv ic("UTF-8", "UTF-16"); if (!ic.is_valid()) { return byte_array(); } const value_type *me_data = data(); byte_array str(size()); char *str_data = &str[0]; size_t me_len_char = size() * 2; size_t str...
false
false
false
false
false
0
globus_libc_gethostbyname_r( char * hostname, struct hostent * result, char * buffer, int buflen, int * h_errnop) { struct hostent * hp = ...
false
false
false
false
false
0
hx509_ca_tbs_add_crl_dp_uri(hx509_context context, hx509_ca_tbs tbs, const char *uri, hx509_name issuername) { DistributionPoint dp; int ret; memset(&dp, 0, sizeof(dp)); dp.distributionPoint = ecalloc(1, sizeof(*dp.distributionPoint)); { DistributionPointName name; GeneralN...
false
false
false
false
false
0
nss_var_lookup_nss_cert_chain(apr_pool_t *p, CERTCertificate *cert, char *var) { char *result; CERTCertificateList *chain = NULL; int n; result = NULL; chain = CERT_CertChainFromCert(cert, certUsageSSLClient, PR_TRUE); if (!chain) return NULL; if (strspn(var, "0123456789") == str...
false
false
false
false
false
0
__ao2_global_obj_release(struct ao2_global_obj *holder, const char *tag, const char *file, int line, const char *func, const char *name) { if (!holder) { /* For sanity */ ast_log(LOG_ERROR, "Must be called with a global object!\n"); return; } if (__ast_rwlock_wrlock(file, line, func, &holder->lock, name)) { ...
false
false
false
false
false
0
jack_controller_add_slave_driver( struct jack_controller * controller_ptr, const char * driver_name) { jackctl_driver_t * driver; struct jack_controller_slave_driver * driver_ptr; size_t len_old; size_t len_new; len_old = strlen(controller_ptr->slave_drivers_vparam_value.str); len_new =...
false
false
false
false
false
0
ravb_set_settings(struct net_device *ndev, struct ethtool_cmd *ecmd) { struct ravb_private *priv = netdev_priv(ndev); unsigned long flags; int error; if (!priv->phydev) return -ENODEV; spin_lock_irqsave(&priv->lock, flags); /* Disable TX and RX */ ravb_rcv_snd_disable(ndev); error = phy_ethtool_sset(priv-...
false
false
false
false
false
0
mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, int ptys_size, int proto_mask, u8 local_port) { u32 in[MLX5_ST_SZ_DW(ptys_reg)]; memset(in, 0, sizeof(in)); MLX5_SET(ptys_reg, in, local_port, local_port); MLX5_SET(ptys_reg, in, proto_mask, proto_mask); return mlx5_core_access_reg(dev, in, sizeof(in...
false
false
false
false
false
0
serv_slave(int fd, int pid) { struct sockaddr_in to_addr, from_addr; int to_addr_len, from_addr_len; to_addr_len = sizeof(to_addr); memset(&to_addr, 0, sizeof(to_addr)); if (getsockname(fd, (struct sockaddr *) &to_addr, &to_addr_len) < 0) { log(LOG_ERR, pid, "getsockname failed %d:%s\n", errno, strerror(errno)...
false
false
false
false
false
0
minefield_view_render_svg_pattern (MinefieldView* self, cairo_t* cr, const gchar* filename) { cairo_pattern_t* result = NULL; cairo_surface_t* surface = NULL; cairo_t* _tmp0_ = NULL; cairo_surface_t* _tmp1_ = NULL; guint _tmp2_ = 0U; guint _tmp3_ = 0U; guint _tmp4_ = 0U; guint _tmp5_ = 0U; cairo_surface_t* _tm...
false
false
false
false
false
0
nrrdAxisInfoGet_va(const Nrrd *nrrd, int axInfo, ...) { void *buffer[NRRD_DIM_MAX], *ptr; _nrrdAxisInfoGetPtrs info; unsigned int ai, si; va_list ap; double svec[NRRD_DIM_MAX][NRRD_SPACE_DIM_MAX]; if (!( nrrd && AIR_IN_CL(1, nrrd->dim, NRRD_DIM_MAX) && AIR_IN_OP(nrrdAxisInfoUnknown, axInf...
false
false
false
false
true
1
LI2(V5) object V5; { VMB2 VMS2 VMV2 goto TTL; TTL:; {object V6; base[1]= (V5); vs_top=(vs_base=base+1)+1; (void) (*Lnk113)(); vs_top=sup; base[0]= vs_base[0]; vs_top=(vs_base=base+0)+1; (void) (*Lnk114)(); vs_top=sup; V6= vs_base[0]; if(!(type_of((V6))==t_cons||((V6))==Cnil)){ goto T35;} {register objec...
false
false
false
false
false
0
query_wc2(globus_rls_handle_t *h, char *method, char *pattern, globus_rls_pattern_t type, int *offset, int reslimit, globus_list_t **str2_list) { globus_result_t r; BUFFER b; char buf[BUFLEN*2]; char obuf[50]; char rbuf[50]; int otimeout; int loffset; RLSLIST *rlslist; if ((r = che...
false
false
false
false
false
0
xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx) { int i; const xmlChar *prefix; const xmlChar *href; int has_empty_ns; if(cur == NULL) { xmlC14NErrParam("searching namespaces stack (exc c14n)"); return (0); } /* * if t...
false
false
false
false
false
0
setup_write_iov(const struct Buffer *buffer, struct iovec *iov, size_t len) { size_t room; size_t start; size_t end; room = buffer->size - buffer->len; if (room == 0) /* trivial case: no room */ return 0; /* Allow caller to specify maxium length */ if (len) room = MIN(room,...
false
false
false
false
false
0
stp_sequence_get_bounds(const stp_sequence_t *sequence, double *low, double *high) { CHECK_SEQUENCE(sequence); *low = sequence->blo; *high = sequence->bhi; }
false
false
false
false
false
0
s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) { mp_int t; int res, pa, pb, ix, iy; mp_digit u; mp_word r; mp_digit tmpx, *tmpt, *tmpy; /* can we use the fast multiplier? */ if (((digs) < MP_WARRAY) && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 ...
false
false
false
false
false
0
invalidPointerError(const Token *tok, const std::string &func, const std::string &pointer_name) { reportError(tok, Severity::error, "invalidPointer", "Invalid pointer '" + pointer_name + "' after " + func + "()."); }
false
false
false
false
false
0
show_duration(FILE *f, duration_t duration, const char *pre, const char *post) { if (duration.seconds) fprintf(f, "%s%u:%02u min%s", pre, FRACTION(duration.seconds, 60), post); }
false
false
false
false
false
0
mono_class_setup_basic_field_info (MonoClass *class) { MonoClassField *field; MonoClass *gtd; MonoImage *image; int i, top; if (class->fields) return; gtd = class->generic_class ? mono_class_get_generic_type_definition (class) : NULL; image = class->image; top = class->field.count; if (class->generic_clas...
false
false
false
false
false
0
calcul_nbdeport_cyclesface(LST_EQUIPO lst_equipo) { int nbdeport = 0; ptype_list * liste; while (lst_equipo != NULL) { liste = lst_equipo->lst_visavis; while (liste != NULL) { if (existe_visavis(lst_equipo->index, liste->TYPE, lst_equipo)) { nbdeport++; } liste = liste->NEXT; } lst_equipo = l...
false
false
false
false
false
0
nsslowcert_OpenCertDB(NSSLOWCERTCertDBHandle *handle, PRBool readOnly, const char *appName, const char *prefix, NSSLOWCERTDBNameFunc namecb, void *cbarg, PRBool openVolatile) { int rv; certdb_InitDBLock(handle); handle->dbMon = PZ_NewMonitor(nssILockCertDB); PORT_Assert(handle->dbMon !=...
false
false
false
false
false
0
Stat( const char *pszFilename, VSIStatBufL *pStatBuf, int nFlags ) { CPLString osInArchiveSubDir; memset(pStatBuf, 0, sizeof(VSIStatBufL)); char* zipFilename = SplitFilename(pszFilename, osInArchiveSubDir, TRUE); if (zipFilename == NULL) return -1; { ...
false
false
false
false
false
0
exprInputCollation(Node *expr) { Oid coll; if (!expr) return InvalidOid; switch (nodeTag(expr)) { case T_Aggref: coll = ((Aggref *) expr)->inputcollid; break; case T_WindowFunc: coll = ((WindowFunc *) expr)->inputcollid; break; case T_FuncExpr: coll = ((FuncExpr *) expr)->inputcollid; ...
false
false
false
false
false
0
_tp_handle_channels_context_prepare_async ( TpHandleChannelsContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self)); /* This i...
false
false
false
false
false
0
GdipGetImageGraphicsContext (GpImage *image, GpGraphics **graphics) { GpGraphics *gfx; cairo_surface_t *surface; cairo_pattern_t *filter; if (!image || !graphics) return InvalidParameter; /* This function isn't allowed on metafiles - unless we're recording */ if (image->type == ImageTypeMetafile) { GpMetaf...
false
false
false
false
false
0
drv2667_init(struct drv2667_data *haptics) { int error; /* Set default haptic frequency to 195Hz on Page 1*/ haptics->frequency = 195; haptics->page = DRV2667_PAGE_1; error = regmap_register_patch(haptics->regmap, drv2667_init_regs, ARRAY_SIZE(drv2667_init_regs)); if (error) { dev_err(&hap...
false
false
false
false
false
0
coerce_argument_list (PACK_T ** r, NODE_T * p) { for (; p != NO_NODE; FORWARD (p)) { if (IS (p, ARGUMENT_LIST)) { coerce_argument_list (r, SUB (p)); } else if (IS (p, UNIT)) { SOID_T s; make_soid (&s, STRONG, MOID (*r), 0); coerce_unit (p, &s); FORWARD (*r); } else if (IS (p,...
false
false
false
false
false
0
nfsd4_init_pnfs(void) { int i; for (i = 0; i < DEVID_HASH_SIZE; i++) INIT_LIST_HEAD(&nfsd_devid_hash[i]); nfs4_layout_cache = kmem_cache_create("nfs4_layout", sizeof(struct nfs4_layout), 0, 0, NULL); if (!nfs4_layout_cache) return -ENOMEM; nfs4_layout_stateid_cache = kmem_cache_create("nfs4_layout_statei...
false
false
false
false
false
0
get_logfile_name(CMD_DATA *p_cmd, int current_nr, void *p_context) { DYN_DNS_CLIENT *p_self = (DYN_DNS_CLIENT *) p_context; if (p_self == NULL) return RC_INVALID_POINTER; if (sizeof(p_self->dbg.p_logfilename) < strlen(p_cmd->argv[current_nr])) return RC_DYNDNS_BUFFER_TOO_SMALL; strcpy(p_self->dbg.p_logfilen...
false
true
false
false
false
1