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
clean_servername(char *host) { char* ch; /* * Check for "FRENCH " infection ;-) (actually this should * be replaced with routine to check the hostname syntax in * general). [ This check is still needed, even after the parse * is fixed, because someone can send "SERVER :foo bar " ]. * Also,...
false
false
false
false
false
0
strappc(string *s, char c) { int len = strlen(*s); renewarray(*s, len + 2); (*s)[len] = c; (*s)[len+1] = '\0'; }
false
false
false
true
false
1
eval (int x) const { std::vector<int>::reverse_iterator it; int val; val = 0; for (it = rep->data.rbegin (); it != rep->data.rend (); ++it) val = val * x + *it; return val; }
false
false
false
false
false
0
add_new_worklist_callback(struct widget *widget) { if (Main.event.button.button == SDL_BUTTON_LEFT) { struct widget *new_worklist_widget = NULL; struct widget *window = option_dialog->end_widget_list; struct global_worklist *pgwl = global_worklist_new(_("empty worklist")); struct ADVANCED_DLG *advance...
false
false
false
false
false
0
explain_buffer_errno_setvbuf(explain_string_buffer_t *sb, int errnum, FILE *fp, char *data, int mode, size_t size) { explain_explanation_t exp; if (errnum == 0) errnum = EINVAL; explain_explanation_init(&exp, errnum); explain_buffer_errno_setvbuf_system_call(&exp.system_call_sb, errnum, fp,...
false
false
false
false
false
0
take_cpu_down(void *_param) { struct take_cpu_down_param *param = _param; int err; /* Ensure this CPU doesn't handle any more interrupts. */ err = __cpu_disable(); if (err < 0) return err; cpu_notify(CPU_DYING | param->mod, param->hcpu); /* Give up timekeeping duties */ tick_handover_do_timer(); /* Park th...
false
false
false
false
false
0
drawnumber_key(void *z, t_floatarg fkey) { t_drawnumber *x = (t_drawnumber *)z; t_fielddesc *f = &x->x_value; int key = fkey; char sbuf[MAXPDSTRING]; t_atom at; if (!gpointer_check(&drawnumber_motion_gpointer, 0)) { post("drawnumber_motion: scalar disappeared"); return; }...
false
false
false
false
false
0
i40e_detect_recover_hung_queue(int q_idx, struct i40e_vsi *vsi) { struct i40e_ring *tx_ring = NULL; struct i40e_pf *pf; u32 head, val, tx_pending_hw; int i; pf = vsi->back; /* now that we have an index, find the tx_ring struct */ for (i = 0; i < vsi->num_queue_pairs; i++) { if (vsi->tx_rings[i] && vsi->tx_ri...
false
false
false
false
false
0
jp2_pclr_getdata(jp2_box_t *box, jas_stream_t *in) { jp2_pclr_t *pclr = &box->data.pclr; int lutsize; unsigned int i; unsigned int j; int_fast32_t x; pclr->lutdata = 0; if (jp2_getuint16(in, &pclr->numlutents) || jp2_getuint8(in, &pclr->numchans)) { return -1; } lutsize = pclr->numlutents * pclr->numcha...
false
false
false
false
false
0
openStream(fstream& fstr, const char *name, int mode) { fstr.open(name, (std::ios::openmode) mode); // if(!fstr) if(fstr.fail()) { std::cerr << "Could not open " << name << std::endl; return 0; } return 1; }
false
false
false
false
false
0
slurmdb_destroy_job_rec(void *object) { slurmdb_job_rec_t *job = (slurmdb_job_rec_t *)object; if (job) { xfree(job->account); xfree(job->blockid); xfree(job->cluster); xfree(job->derived_es); xfree(job->jobname); xfree(job->partition); xfree(job->nodes); if(job->steps) { list_destroy(job->steps); ...
false
false
false
false
false
0
inf_gtk_browser_view_progress_data_func(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter, gpointer user_data) { In...
false
false
false
false
false
0
get_fg_tile_info( int offs ) { int code,color,flags; code = nemesis_videoram1b[offs]; color = nemesis_videoram2b[offs]; flags = 0; if ( color & 0x80) flags |= TILE_FLIPX; if ( code & 0x0800) flags |= TILE_FLIPY; if ((~code & 0x2000) || ((code & 0xc000) == 0x4000)) flags |= TILE_IGNORE_TRANSPARENCY; ...
false
false
false
false
false
0
__createi(struct gfs2_inode *dip, const char *filename, unsigned int mode, uint32_t flags, int if_gfs1) { struct gfs2_sbd *sdp = dip->i_sbd; uint64_t bn; struct gfs2_inum inum; struct gfs2_buffer_head *bh; struct gfs2_inode *ip; int err = 0; int is_dir; gfs2_lookupi(dip, filename, strlen(filena...
false
false
false
false
false
0
current(void) const { int32_t pos = (int32_t)UTEXT_GETNATIVEINDEX(fText); return pos; }
false
false
false
true
false
1
pass2_no_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* This version performs no dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; hist3d histogram = cquantize->histogram; register JSAMPROW inptr, outptr; register histptr cachep; ...
false
false
false
false
false
0
srun_response(uint32_t job_id, uint32_t step_id) { struct job_record *job_ptr = find_job_record (job_id); time_t now = time(NULL); if (job_ptr == NULL) return; job_ptr->time_last_active = now; }
false
false
false
false
false
0
sge_error_has_quality(sge_error_class_t* thiz, int error_quality) { bool ret = false; DENTER(TOP_LAYER, "sge_error_has_quality"); if(thiz) { sge_error_t *et = (sge_error_t*)thiz->sge_error_handle; sge_error_message_t *elem = et->first; while(elem) { if(elem->error_quality == erro...
false
false
false
false
false
0
Evaluate( cmGeneratorExpressionContext *context, cmGeneratorExpressionDAGChecker *dagChecker) const { std::string identifier; { std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it = this->IdentifierChildr...
false
false
false
false
false
0
gst_rtcp_buffer_add_packet (GstBuffer * buffer, GstRTCPType type, GstRTCPPacket * packet) { guint len, size; guint8 *data; gboolean result; g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE); g_return_val_if_fail (type != GST_RTCP_TYPE_INVALID, FALSE); g_return_val_if_fail (packet != NULL, FALSE); ...
false
false
false
false
false
0
main_for_extract(void) { static char *items[] = { "one", "two", "three", }; int num_items = sizeof(items) / sizeof(items[0]); int num_repeats = 3; int i, j; char *p; List *list, *extracted; list = gwlist_create(); for (j = 0; j < num_repeats; ++j) for (i = 0; i < num_items; ++i) gwlist_append(lis...
false
false
false
false
false
0
require_role_or_attribute(int pass, unsigned char isattr) { char *id = queue_remove(id_queue); role_datum_t *role = NULL; int retval; if (pass == 2) { free(id); return 0; } if (id == NULL) { yyerror("no role name"); return -1; } if ((role = malloc(sizeof(*role))) == NULL) { free(id); yyerror("Out of...
false
false
false
false
false
0
CheckConvert(int &idno, int nindex, int indexarray[]) { int result; result=QCArray.CheckArray(idno, nindex, indexarray); if (result) return result; if (!QCArray.isscalar(idno)) insert(setindex, idno, nindex, indexarray); return 0; }
false
false
false
false
false
0
nemo_icon_view_merge_menus (NemoView *view) { NemoIconView *icon_view; GtkUIManager *ui_manager; GtkActionGroup *action_group; GtkAction *action; g_assert (NEMO_IS_ICON_VIEW (view)); NEMO_VIEW_CLASS (nemo_icon_view_parent_class)->merge_menus (view); icon_view = NEMO_ICON_VIEW (view); ui_manager = ne...
false
false
false
false
false
0
pack_exchange(int i, double *buf) { buf[0] = body[i]; buf[1] = displace[i][0]; buf[2] = displace[i][1]; buf[3] = displace[i][2]; if (!extended) return 4; int m = 4; buf[m++] = eflags[i]; for (int j = 0; j < orientflag; j++) buf[m++] = orient[i][j]; if (dorientflag) { buf[m++] = dorient[i][0];...
false
false
false
false
false
0
ST_Ticker (void) { static int largeammo = 1994; // means "n/a" // must redirect the pointer if the ready weapon has changed. if (weaponinfo[plyr->readyweapon].ammo == am_noammo) w_ready.num = &largeammo; else w_ready.num = &plyr->ammo[weaponinfo[plyr->readyweapon].ammo]; w_ready.d...
false
false
false
false
false
0
ginPageGetLinkItup(Buffer buf) { IndexTuple itup, nitup; Page page = BufferGetPage(buf); itup = getRightMostTuple(page); nitup = GinFormInteriorTuple(itup, page, BufferGetBlockNumber(buf)); return nitup; }
false
false
false
false
false
0
AbDumpAmlFile ( char *File1Path, char *File2Path) { char *FileBuffer; FILE *FileOutHandle; UINT32 FileSize = 0; /* Get the entire AML file, validate header */ FileBuffer = AbGetFile (File1Path, &F...
false
false
false
false
true
1
attribute_dup (CK_ATTRIBUTE_PTR attr) { CK_ATTRIBUTE_PTR copy; g_assert (attr); copy = g_slice_new (CK_ATTRIBUTE); copy->ulValueLen = attr->ulValueLen; copy->pValue = g_memdup (attr->pValue, copy->ulValueLen); copy->type = attr->type; return copy; }
false
false
false
false
false
0
detab(char str[], int len) { int i, j; for (i = 0; str[i] != '\0'; i++) { if (str[i] == '\t') { if ((len + 1) + (TABSIZE - 1) > MAXSIZE) { printf("Error: Buffer is too small\n"); break; } /* Shift array to make room */ for (j = len - 1; j > i ; j--) { str[j + (TABSIZE - 1)] = str[j]; } ...
false
false
false
false
false
0
L18() {register object *base=vs_base; register object *sup=base+VM18; VC18 vs_check; {register object V74; V74=(base[0]); vs_top=sup; goto TTL; TTL:; if(!(type_of((V74))==t_cons)){ goto T273;} if(!((CMPcar((V74)))==(((object)VV[17])))){ goto T273;} if(!((STREF(object,CMPcadr((V74)),8))==(((object)VV[27])))){...
false
false
false
false
false
0
visitAShr(BinaryOperator &I) { if (Value *V = SimplifyAShrInst(I.getOperand(0), I.getOperand(1), I.isExact(), TD)) return ReplaceInstUsesWith(I, V); if (Instruction *R = commonShiftTransforms(I)) return R; Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); if (C...
false
false
false
false
false
0
gdk_pixbuf_get_option (GdkPixbuf *pixbuf, const gchar *key) { gchar **options; gint i; g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); g_return_val_if_fail (key != NULL, NULL); options = g_object_get_qdata (G_OBJECT (pixbuf), ...
false
false
false
false
false
0
_pmcraid_fire_command(struct pmcraid_cmd *cmd) { struct pmcraid_instance *pinstance = cmd->drv_inst; unsigned long lock_flags; /* Add this command block to pending cmd pool. We do this prior to * writting IOARCB to ioarrin because IOA might complete the command * by the time we are about to add it to the list. ...
false
false
false
false
false
0
addToFocusList(MSWidget *pWidget_) { if (_traversalList.indexOf((unsigned long)pWidget_,0)==_traversalList.length()) { _traversalList.append(pWidget_); } }
false
false
false
false
false
0
rndis_filter_open_device(struct rndis_device *dev) { int ret; if (dev->state != RNDIS_DEV_INITIALIZED) return 0; ret = rndis_filter_set_packet_filter(dev, NDIS_PACKET_TYPE_BROADCAST | NDIS_PACKET_TYPE_ALL_MULTICAST | NDIS_PACKET_TYPE_DIRECTED); if (ret == 0) dev->state = RNDIS_DEV_DATAINITIA...
false
false
false
false
false
0
tool_matrix_getInter2D(float *lambda, float a[2], float b[2], float A[2], float B[2]) { float denom; denom = (b[0] - a[0]) * (B[1] - A[1]) - (b[1] - a[1]) * (B[0] - A[0]); if (denom == 0.f) return FALSE; *lambda = (A[0] - a[0]) * (B[1] - A[1]) - (A[1] - a[1]) * (B[0] - A[0]); *lambda /= denom; /* ...
false
false
false
false
false
0
sst_hsw_device_set_config(struct sst_hsw *hsw, enum sst_hsw_device_id dev, enum sst_hsw_device_mclk mclk, enum sst_hsw_device_mode mode, u32 clock_divider) { struct sst_hsw_ipc_device_config_req config; u32 header; int ret; trace_ipc_request("set device config", dev); hsw->dx_dev = config.ssp_interface = dev; ...
false
false
false
false
false
0
axpyin(Integer& res, const Integer& a, const Integer& x) { if (isZero(a) || isZero(x)) return res; mpz_addmul( (mpz_ptr)&res.gmp_rep, (mpz_srcptr)&a.gmp_rep, (mpz_srcptr)&x.gmp_rep); return res; }
false
false
false
false
false
0
get_request_sink_pad (GnlOperation * operation) { GstPad *pad = NULL; GList *templates; if (!operation->element) return NULL; templates = gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (operation->element)); for (; templates; templates = g_list_next (templates)) { GstPadTempla...
false
false
false
false
false
0
ofps_oog(ofps *s, double *p) { int e, di = s->di; double ss, oog = 0.0; for (ss = 0.0, e = 0; e < di; e++) { if (p[e] < (s->imin[e])) { double tt = s->imin[e] - p[e]; if (tt > oog) oog = tt; } else if (p[e] > (s->imax[e])) { double tt = p[e] - s->imax[e]; if (tt > oog) oog = tt; } ss += p[e]; ...
false
false
false
false
false
0
tty_chmod(struct pine *ps, int mode, int func) { char *tty_name; int new_mode; struct stat sbuf; static int saved_mode = -1; /* if no problem figuring out tty's name & mode? */ if((((tty_name = (char *) ttyname(STDIN_FD)) != NULL && fstat(STDIN_FD, &sbuf) == 0) || ((tty_name = (char *) ...
false
false
false
false
false
0
isNoArgument(const SymbolDatabase* symbolDatabase, unsigned int varid) { const Variable* var = symbolDatabase->getVariableFromVarId(varid); return var && !var->isArgument(); }
false
false
false
false
false
0
initialize( const char *module_doc ) { PyObject *module_ptr = new ExtensionModuleBasePtr( this ); Py_InitModule4 ( const_cast<char *>( module_name.c_str() ), // name method_table.table(), // methods const_cast<char *>( module_doc ), // docs module_ptr, ...
false
false
false
false
false
0
ExportIPTC_Array ( const SXMPMeta & xmp, IPTC_Manager * iptc, const char * xmpNS, const char * xmpProp, XMP_Uns8 id ) { std::string value; XMP_OptionBits xmpFlags; bool found = xmp.GetProperty ( xmpNS, xmpProp, 0, &xmpFlags ); if ( ! found ) { iptc->DeleteDataSet ( id ); return; } if ( ! XMP_Pr...
false
false
false
false
false
0
sys_basename(char *result, const char *filename) { // FIXME: use is_path_delim const char *slash1 = strrchr(filename, '/'); const char *slash2 = strrchr(filename, '\\'); const char *slash = (slash1 > slash2) ? slash1 : slash2; if (slash) { int l = strlen(filename); ht_strlcpy(result, slash+1, l-(slash-filename...
false
false
false
false
false
0
block_info_new(Block *block, int id, block_kind kind, proc_kind proc, int acc_tp, acc_state acc_st, int iter, Boolean certain_iter, Layer_info *layer_info, Boolean is_closed, List *sb_info_list, Boolean certain_length, Boolean cer...
false
false
false
false
false
0
egg_recent_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { EggRecentModel *model = EGG_RECENT_MODEL (object); switch (prop_id) { case PROP_MIME_FILTERS: model->priv->mime_filter_values = (GSList *)g_value_get_pointer (value); bre...
false
false
false
false
false
0
brcms_c_dpc(struct brcms_c_info *wlc, bool bounded) { u32 macintstatus; struct brcms_hardware *wlc_hw = wlc->hw; struct bcma_device *core = wlc_hw->d11core; if (brcms_deviceremoved(wlc)) { brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit, __func__); brcms_down(wlc->wl); return false; } /* grab a...
false
false
false
false
false
0
MarkReachedNts(Node *p) { while (p != NULL) { if (p->typ == Node::nt && !((*visited)[p->sym->n])) { // new nt reached visited->Set(p->sym->n, true); MarkReachedNts(p->sym->graph); } else if (p->typ == Node::alt || p->typ == Node::iter || p->typ == Node::opt) { MarkReachedNts(p->sub); if (p->typ == Node...
false
false
false
false
false
0
fconn_break (qconn) struct sconnection *qconn; { boolean (*pfbreak) P((struct sconnection *)); pfbreak = qconn->qcmds->pfbreak; if (pfbreak == NULL) return TRUE; DEBUG_MESSAGE0 (DEBUG_PORT, "fconn_break: Sending break character"); return (*pfbreak) (qconn); }
false
false
false
false
false
0
PrintAsnOid PARAMS((f,v, indent), FILE* f _AND_ AsnOid* v _AND_ unsigned short int indent) { unsigned short int firstArcNum; unsigned long int arcNum; int i; fprintf(f,"{"); /* un-munge first two arc numbers */ for (arcNum = 0, i=0; (i < v->octetLen) && (v->octs[i] & 0x80);i++) arcNum ...
false
false
false
false
false
0
bq24190_battery_set_property(struct power_supply *psy, enum power_supply_property psp, const union power_supply_propval *val) { struct bq24190_dev_info *bdi = power_supply_get_drvdata(psy); int ret; dev_dbg(bdi->dev, "prop: %d\n", psp); pm_runtime_put_sync(bdi->dev); switch (psp) { case POWER_SUPPLY_PROP_O...
false
false
false
false
false
0
fill_in_extended_info(Track *track, gint32 total, gint32 num) { gint ipod_id = 0; ExtraTrackData *etr; struct track_extended_info *sei = NULL; g_return_if_fail (track); etr = track->userdata; g_return_if_fail (etr); if (extendedinfohash && track->id) { /* copy id to gint value -- n...
false
false
false
false
false
0
F_mpz_fdiv_q(F_mpz_t f, const F_mpz_t g, const F_mpz_t h) { F_mpz c1 = *g; F_mpz c2 = *h; if (!COEFF_IS_MPZ(c1)) // g is small { if (!COEFF_IS_MPZ(c2)) // h is also small { F_mpz q = c1 / c2; // compute C quotient F_mpz r = c1 - c2*q; // compute remainder if ((c2 > 0L) && (r < 0L)) q--;...
false
false
false
false
false
0
addNewItems(const KUrl& directoryUrl, const KFileItemList& items) { // TODO: make this faster - test if we have a filter at all first // DF: was this profiled? The matchesFoo() functions should be fast, w/o filters... // Of course if there is no filter and we can do a range-insertion instead of a loop, that might...
false
false
false
false
false
0
ssl3_SendFinished(sslSocket *ss, PRInt32 flags) { ssl3CipherSpec *cwSpec; PRBool isTLS; PRBool isServer = ss->sec.isServer; SECStatus rv; SSL3Sender sender = isServer ? sender_server : sender_client; SSL3Hashes hashes; TLSFinished tlsFinished; SSL_T...
false
false
false
false
false
0
env_init(gchar **envp) { g_assert(base_env == NULL); int i; for(i=0; envp[i]; i++) { base_env = g_slist_prepend(base_env, envp[i]); } #define ADD_GENV(name, value) \ base_env = g_slist_prepend(base_env, g_strdup_printf("AD_"name"=%s", value)) ADD_GENV("HOSTSFILE" , cfg->hostsfile); ...
false
false
false
false
false
0
gst_dccp_client_src_start (GstBaseSrc * bsrc) { GstDCCPClientSrc *src = GST_DCCP_CLIENT_SRC (bsrc); if (src->sock_fd == DCCP_DEFAULT_SOCK_FD) { gchar *ip = NULL; /* look up name if we need to */ if (!(ip = gst_dccp_host_to_ip (GST_ELEMENT (src), src->host))) { GST_ERROR_OBJECT (src, "cannot reso...
false
false
false
false
false
0
MatchOrInsertSemicolon(JSContext *cx, JSTokenStream *ts) { JSTokenType tt; ts->flags |= TSF_OPERAND; tt = js_PeekTokenSameLine(cx, ts); ts->flags &= ~TSF_OPERAND; if (tt == TOK_ERROR) return JS_FALSE; if (tt != TOK_EOF && tt != TOK_EOL && tt != TOK_SEMI && tt != TOK_RC) { js_Rep...
false
false
false
false
false
0
restart( const QList<KCard*> & cards ) { lastdeal = false; QList<KCard*> cardList = cards; for ( int r = 0; r < 4; ++r ) { for ( int column = 0; column < 8; ++column ) { QPointF initPos = stack[column]->pos() - QPointF( 0, 2 * deck()->cardHeight() ); addCardForD...
false
false
false
false
false
0
ddf_store_matrix_as_vectors(char* p, int n, const ergo_real* matrix, size_t sizeInBytes) { long nvalues = ddf_get_nvalues_symm_matrix(n, matrix); if(sizeInBytes != nvalues*(sizeof(ergo_real)+2*sizeof(int))) return -1; int* rowind = (int*)p; int* colind = &rowind[nvalues]; ergo_real* values = (ergo_real*)(...
false
false
false
false
false
0
VvhVbhTreatModel() { vpnmod_list *VpnModel; vpnport_list *VpnPort; vpngen_list *VpnGen; vbmod_list *ScanModel; vbpor_list *ScanPort; vbgen_list *ScanGen; vexexpr *Expr; vexexpr *Data; unsigned char Base; unsigned char Dir; for ( ScanModel = VvhVbhFigure->BEMOD; ...
false
false
false
false
false
0
generate_resource_params(resource_t * rsc, pe_working_set_t * data_set) { GHashTable *params = NULL; GHashTable *meta = NULL; GHashTable *combined = NULL; GHashTableIter iter; if (!rsc) { crm_err("Resource does not exist in config"); return NULL; } params = g_hash_t...
false
false
false
false
false
0
it_pronoun(int item, rbool ind_form) /* Return the correct pronoun to go with item; ind_form is 1 if we want the object form, 0 if we want the subject form */ { if (it_plur(item)) return (ind_form ? ext_code[wthem] : ext_code[wthey]); if (tcreat(item)) switch (creature[item-first_creat].gender) { ...
false
false
false
false
false
0
gethostname_fallback (krb5_context context, krb5_addresses *res) { krb5_error_code ret; char hostname[MaxHostNameLen]; struct hostent *hostent; if (gethostname (hostname, sizeof(hostname))) { ret = errno; krb5_set_error_message(context, ret, "gethostname: %s", strerror(ret)); return ret; } h...
false
false
false
false
false
0
create_ipc_directory(const char *sock_path, struct ntb_error **error) { struct ntb_buffer buffer; int sock_path_len = strlen(sock_path); bool res; ntb_buffer_init(&buffer); while (sock_path_len > 0 && sock_path[sock_path_len - 1] != '/') soc...
false
false
false
false
false
0
gfarm_config_set_default_ports(void) { if (gfarm_metadb_server_name == NULL) gflog_fatal(GFARM_MSG_1000013, "metadb_serverhost isn't specified in " GFARM_CONFIG " file"); if (gfarm_metadb_server_portname != NULL) { int p = strtol(gfarm_metadb_server_portname, NULL, 0); struct servent *sp = getse...
false
false
false
false
false
0
test_resolve ( const char *base_uri_string, const char *relative_uri_string, const char *resolved_uri_string ) { struct uri *base_uri = NULL; struct uri *relative_uri = NULL; struct uri *resolved_uri = NULL; char buf[URI_MAX_LEN]; size_t len; int rc; /* Parse URIs */ base_uri = parse_uri ( base_uri_s...
false
false
false
false
false
0
get_callchain_buffers(void) { int err = 0; int count; mutex_lock(&callchain_mutex); count = atomic_inc_return(&nr_callchain_events); if (WARN_ON_ONCE(count < 1)) { err = -EINVAL; goto exit; } if (count > 1) { /* If the allocation failed, give up */ if (!callchain_cpus_entries) err = -ENOMEM; goto...
false
false
false
false
false
0
DVDFileStatVOBPath( dvd_reader_t *dvd, int title, int menu, dvd_stat_t *statbuf ) { char filename[ MAX_UDF_FILE_NAME_LEN ]; char *full_path = NULL; struct stat fileinfo; off_t tot_size; off_t parts_size[ 9 ]; int nr_parts = 0; int n; if( title == 0 ) sprintf( filename...
false
false
false
false
false
0
getPSFilter(int psLevel, const char *indent) { GooString *s; if (psLevel < 2) { return NULL; } if (!(s = str->getPSFilter(psLevel, indent))) { return NULL; } s->append(indent)->append("<< >> /DCTDecode filter\n"); return s; }
false
false
false
false
false
0
md_write(void *ptr, int len) { char *p=ptr; int r, tot=0; while(len>0) { if((r=write(md_out_fd, p, len))<0) if(errno==EINTR) continue; else return r; if(!r) return tot; tot+=r; p+=r; len-=r; } return tot; }
false
false
false
false
false
0
e2_task_tempname (const gchar *localpath) { struct stat dest_sb; E2_ERR_DECLARE #ifdef E2_VFS VPATH data = { localpath, NULL }; if (e2_fs_lstat (&data, &dest_sb E2_ERR_PTR()) && E2_ERR_IS (ENOENT)) #else if (e2_fs_lstat (localpath, &dest_sb E2_ERR_PTR()) && E2_ERR_IS (ENOENT)) #endif { E2_ERR_CLEAR return (g...
false
false
false
false
false
0
endDisplay() { const Length &spaceAfter = spaceAfterStack_.back(); if (spaceAfter > topMargin_) topMargin_ = spaceAfter; spaceAfterStack_.resize(spaceAfterStack_.size() - 1); }
false
false
false
false
false
0
read_words(wistream& is) { while(!is.eof()) { wstring w; getline(is,w); w=StringUtils::tolower(w); if (w.length()>0) { words.insert(w); new_word_register(w); } } n_set=words.size(); wcerr<<L"# words: "<<n_set<<L"\n"; }
false
false
false
false
false
0
print_ls_partial_affine_c( __isl_take isl_printer *p, __isl_keep isl_local_space *ls, isl_int *c, unsigned len) { int i; int first; for (i = 0, first = 1; i < len; ++i) { int flip = 0; if (isl_int_is_zero(c[i])) continue; if (!first) { if (isl_int_is_neg(c[i])) { flip = 1; isl_int_neg(c[i], c[...
false
false
false
false
false
0
city_report_dialog_popdown(void) { if (pCityRep) { popdown_window_group_dialog(pCityRep->pBeginWidgetList, pCityRep->pEndWidgetList); FC_FREE(pCityRep->pScroll); FC_FREE(pCityRep); enable_and_redraw_find_city_button(); flush_dirty(); } }
false
false
false
false
false
0
net80211_prepare_probe ( struct net80211_device *dev, int band, int active ) { assert ( netdev_is_open ( dev->netdev ) ); if ( active && ( band & NET80211_BAND_BIT_5GHZ ) ) { DBGC ( dev, "802.11 %p cannot perform active scanning on " "5GHz band\n", dev ); return -EINVAL_ACTIVE_SCAN; } if ( ba...
false
false
false
false
false
0
binary_nd(op, arg1, arg2) nodeptr op; nodeptr arg1; nodeptr arg2; { register nodeptr t; struct implement *impl; /* * Find the data base entry for the operator. */ impl = optab[Val0(op)].binary; if (impl == NULL) nfatal(op, "binary operator not implemented", optab[Val0(op)].tok.t_word); ...
false
false
false
false
false
0
snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) { struct snd_card *card = chip->card; struct snd_kcontrol *kcontrol; unsigned int idx; int err, addr; strcpy(card->mixername, "SAA7134 Mixer"); for (idx = 0; idx < ARRAY_SIZE(snd_saa7134_volume_controls); idx++) { kcontrol = snd_ctl_new1(&snd_saa7134_volum...
false
false
false
false
false
0
SaveFlags ( Obj flags ) { UInt i, len, *ptr; SaveSubObj(TRUES_FLAGS(flags)); SaveSubObj(HASH_FLAGS(flags)); SaveSubObj(ADDR_OBJ(flags)[2]); /* length, as an object */ SaveSubObj(AND_CACHE_FLAGS(flags)); len = NRB_FLAGS(flags); ptr = BLOCKS_FLAGS(flags); for ( i = 1; ...
false
false
false
false
false
0
g_tls_connection_gnutls_handshake (GTlsConnection *conn, GCancellable *cancellable, GError **error) { GTlsConnectionGnutls *gnutls = G_TLS_CONNECTION_GNUTLS (conn); GTask *task; gboolean success; GError *my_error = NULL; task = g_task_new (conn, cancellable, NULL, NULL); begin_...
false
false
false
false
false
0
ssl3_SendCertificateStatus(sslSocket *ss) { SECStatus rv; int len = 0; SECItemArray *statusToSend = NULL; SSL3KEAType certIndex; SSL_TRC(3, ("%d: SSL3[%d]: send certificate status handshake", SSL_GETPID(), ss->fd)); PORT_Assert( ss->opt.noLocks || ssl_HaveXmitBufLock(ss)); PORT_Assert( s...
false
false
false
false
false
0
skipMatrix(FILE *f) { InitBits(f); if (getBits(f, 1)) getBits(f, getBits(f, 5) * 2); if (getBits(f, 1)) getBits(f, getBits(f, 5) * 2); getBits(f, getBits(f, 5) * 2); }
false
false
false
false
false
0
find_diff_func(const char *func_name, size_t namelen) { size_t idx; for( idx = 0; idx < lengthof(statgrab_test_funcs); ++idx ) { if( NULL == statgrab_test_funcs[idx].diff_name ) continue; if( 0 == strncmp( func_name, statgrab_test_funcs[idx].diff_name, namelen ) ) /* XXX memcmp? */ break; } return idx; ...
false
false
false
false
false
0
checkDuplicateBranch() { // This is inconclusive since in practice most warnings are noise: // * There can be unfixed low-priority todos. The code is fine as it // is but it could be possible to enhance it. Writing a warning // here is noise since the code is fine (see cppcheck, abiword, ..) // ...
false
false
false
false
false
0
send_level_command(JCR *jcr) { BSOCK *fd = jcr->file_bsock; const char *accurate = jcr->accurate?"accurate_":""; const char *not_accurate = ""; const char *rerunning = jcr->rerunning?" rerunning ":" "; /* * Send Level command to File daemon */ switch (jcr->getJobLevel()) { case L_BASE: ...
false
false
false
false
false
0
get_authorized_cred(struct hdr_field* _f, struct hdr_field** _h) { if (_f && _f->parsed) { *_h = ((auth_body_t*)(_f->parsed))->authorized; } else { *_h = 0; } return 0; }
false
false
false
false
false
0
recurse_chdir (char *path) { /* use if the chdir() directory might not exist anymore */ int s; s = chdir (path); if (s == -1) { char *npath = dirname (path); if (strcmp (npath, ".") == 0) return; else recurse_chdir (npath); } return; }
false
false
false
false
true
1
memcg_update_list_lru(struct list_lru *lru, int old_size, int new_size) { int i; if (!list_lru_memcg_aware(lru)) return 0; for_each_node(i) { if (memcg_update_list_lru_node(&lru->node[i], old_size, new_size)) goto fail; } return 0; fail: for (i = i - 1; i >= 0; i--) { if (!lru->node[i]...
false
false
false
false
false
0
FindHeader(Buffer *bufs, const char *header, char **start, char **end) { Buffer b; int size; char *str_base; char *str; int headerlen = strlen(header); if (bufs==NULL) { if (start) *start=NULL; return RET_ARTICLE_BAD; } b = bufs[0]; size = bufferSize(b); str_base = ...
false
false
false
false
false
0
set_do_address(asn1_ctx_t* actx, gboolean do_address) { p1_address_ctx_t* ctx; if (actx->subtree.tree_ctx == NULL) { actx->subtree.tree_ctx = wmem_new0(wmem_packet_scope(), p1_address_ctx_t); } ctx = (p1_address_ctx_t*)actx->subtree.tree_ctx; ctx->do_address = do_address; }
false
false
false
false
false
0
verify_loop_structure (loops, flags) struct loops *loops; int flags; { int *sizes, i, j; basic_block *bbs, bb; struct loop *loop; int err = 0; /* Check sizes. */ sizes = xcalloc (loops->num, sizeof (int)); sizes[0] = 2; FOR_EACH_BB (bb) for (loop = bb->loop_father; loop; loop = loop->ou...
false
false
false
false
false
0
gst_audio_resample_query (GstPad * pad, GstQuery * query) { GstAudioResample *resample = GST_AUDIO_RESAMPLE (gst_pad_get_parent (pad)); GstBaseTransform *trans; gboolean res = TRUE; if (G_UNLIKELY (resample == NULL)) return FALSE; trans = GST_BASE_TRANSFORM (resample); switch (GST_QUERY_TYPE (query)) ...
false
false
false
false
false
0
string_concat(register PyStringObject *a, register PyObject *bb) { register Py_ssize_t size; register PyStringObject *op; if (!PyString_Check(bb)) { #ifdef Py_USING_UNICODE if (PyUnicode_Check(bb)) return PyUnicode_Concat((PyObject *)a, bb); #endif if (PyByteArray_Check(bb)) ...
false
false
false
false
true
1
pop_symboltable(string name) { Symbol *h; Stack p; if (!stack) { if (! has_error) fprintf(stderr, "%d: too many end tags\n", yylineno); has_error = true; return; } /* Remove entries from symbol table chain until last mark */ while (symtable != stack->frame) { h = symtable; symtable = sy...
false
false
false
false
false
0
evt_rcmd_clicked(GtkWidget *wid, gpointer user) { P_Buttons *page = user; ButtonRow *brw = NULL; gint width = 8; if(page->button != NULL) { brw = g_object_get_data(G_OBJECT(page->button), "row"); width = btn_buttonrow_get_width(brw); } switch(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(wid), "index"))) { ...
false
false
false
false
false
0
encodeLatin1Character(boost::uint32_t ucsCharacter) { std::string text; text.push_back(static_cast<unsigned char>(ucsCharacter)); return text; }
false
false
false
false
false
0
tg3_phy_init(struct tg3 *tp) { struct phy_device *phydev; if (tp->phy_flags & TG3_PHYFLG_IS_CONNECTED) return 0; /* Bring the PHY back to a known state. */ tg3_bmcr_reset(tp); phydev = tp->mdio_bus->phy_map[tp->phy_addr]; /* Attach the MAC to the PHY. */ phydev = phy_connect(tp->dev, dev_name(&phydev->dev)...
false
false
false
false
false
0