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 |
|---|---|---|---|---|---|---|
clear_area(int startx, int starty, int xsize, int ysize)
{
int x;
TRACE_LOG("Clearing area %d,%d / %d,%d\n", startx, starty, xsize, ysize);
while (ysize > 0)
{
x = xsize;
while (x > 0)
{
mvaddch(starty + ysize - 2, startx + x - 2, ' ');
x--;
}
ysize--;
}
} | false | false | false | false | false | 0 |
ReconstructDuList(Statement* head)
{
Statement* spt;
for (spt = head; spt != NULL; spt = spt->next) {
delete_def_use_list(spt->use_var_list);
delete_def_use_list(spt->def_var_list);
delete_def_use_list(spt->use_array_list);
delete_def_use_list(spt->def_array_list);
spt->def_var_list = NULL;
spt->use_var_... | false | false | false | false | false | 0 |
free_speaker(void)
{
if(Lengths)
free(Lengths);
if(!audio2fast && commento)
fclose(commento);
frase = NON_DECISA;
game_status = S_NON_INIZIATO;
fondolen = sound[FONDO]->Length;
fondobase = sound[FONDO]->SoundData;
if (audio2fast && comment_file)
free(comment_file);
... | false | false | false | false | false | 0 |
mlx4_register_device(struct mlx4_dev *dev)
{
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_interface *intf;
mutex_lock(&intf_mutex);
dev->persist->interface_state |= MLX4_INTERFACE_STATE_UP;
list_add_tail(&priv->dev_list, &dev_list);
list_for_each_entry(intf, &intf_list, list)
mlx4_add_device(intf, pri... | false | false | false | false | false | 0 |
Parse_Env_Var(void)
{
char *p = getenv("LINEDIT");
if (p == NULL)
return;
if (strstr(p, "gui=no") != NULL)
use_gui = 0;
if (strstr(p, "ansi=no") != NULL)
use_ansi = 0;
if ((p = strstr(p, "out=")) != NULL)
{
p += 4;
if (isdigit(*p))
fd_out = strtol(p, NULL, 10);
el... | true | true | false | false | true | 1 |
nilfs_superblock_sb_update_frequency_store(struct nilfs_superblock_attr *attr,
struct the_nilfs *nilfs,
const char *buf, size_t count)
{
unsigned val;
int err;
err = kstrtouint(skip_spaces(buf), 0, &val);
if (err) {
printk(KERN_ERR "NILFS: unable to convert string: err=%d\n",
err);
return ... | false | false | false | false | false | 0 |
r_HP_QP(jxr_image_t image, struct rbitstream*str)
{
unsigned q;
for (q = 0 ; q < image->num_hp_qps ; q += 1) {
unsigned idx;
int ch_mode = get_ch_mode(image, str);
DEBUG("HP_QP[%u] CH_MODE: %d ", q, ch_mode);
switch (ch_mode) {
case 0: /* UNIFORM */
... | false | false | false | false | false | 0 |
PylonGuardJustDied(Creature* pCreature)
{
for (uint8 i = 0; i < MAX_GENERATORS; ++i)
{
// Skip already activated generators
if (GetData(TYPE_PYLON_1 + i) == DONE)
{
continue;
}
// Only process generator where the npc is sorted in
if (m_sSortedGenerato... | false | false | false | false | false | 0 |
linda_ib_epb_wait ( struct linda *linda,
struct QIB_7220_ibsd_epb_transaction_reg *xact ) {
unsigned int i;
/* Discard first read to allow for signals crossing clock domains */
linda_readq ( linda, xact, QIB_7220_ibsd_epb_transaction_reg_offset );
for ( i = 0 ; i < LINDA_EPB_XACT_MAX_WAIT_US ; i++ ) {
li... | false | false | false | false | false | 0 |
median(const double *src, unsigned int len)
{
unsigned int i, j;
double tmp = 0.0;
double tempMedian;
double medianVal;
double* scratch = new double[ len ];//Vector < double > sortedX = Vector < double > ( size );
for ( i = 0; i < len; i++ )
{
scratch[i] = src[i];
}
for ( i = 0;... | false | false | false | false | false | 0 |
img_filename(const char *mapimgfile, enum imageformat format,
char *filename, size_t filename_len)
{
fc_assert_ret_val(imageformat_is_valid(format) , FALSE);
fc_snprintf(filename, filename_len, "%s.map.%s", mapimgfile,
imageformat_name(format));
return TRUE;
} | true | true | false | false | false | 1 |
restore(const KConfigGroup &config)
{
init(config);
d->initialized = true;
if (!d->pendingUrls.isEmpty()) {
setUrls(d->pendingUrls);
d->pendingUrls.clear();
}
} | false | false | false | false | false | 0 |
IterateFunctions(ObjectVisitor* v) {
for (int i = 0; i < kSubCacheCount; i++) {
subcaches[i]->IterateFunctions(v);
}
} | false | false | false | false | false | 0 |
surrender(int toNationRecno)
{
news_array.nation_surrender(nation_recno, toNationRecno);
//---- the king demote himself to General first ----//
if( king_unit_recno )
{
unit_array[king_unit_recno]->set_rank(RANK_GENERAL);
king_unit_recno = 0;
}
//------- if the player surrenders --------//
if( nation_re... | false | false | false | false | false | 0 |
sigar_net_interface_list_get(sigar_t *sigar,
sigar_net_interface_list_t *iflist)
{
int n, lastlen=0;
struct ifreq *ifr;
struct ifconf ifc;
int sock = socket(AF_INET, SOCK_DGRAM, 0);
if (sock < 0) {
return errno;
}
for (;;) {
if (!sigar->ifc... | false | true | false | false | true | 1 |
transport_from_tile(struct unit *punit, struct tile *ptile)
{
unit_list_iterate(ptile->units, ptransport) {
if (could_unit_load(punit, ptransport)) {
return ptransport;
}
} unit_list_iterate_end;
return NULL;
} | false | false | false | false | false | 0 |
SolveQuadratic( double* c, double* r, int* m )
{
if( ! c[0] )
{
if( c[1] )
{
r[0] = -c[2] / c[1];
m[0] = 1;
return 1;
}
else
{
if ( c[2] ) return 0;
else return -1;
}
}
double delta = c[1] * c[1] - 4. * c[0] * c[2];
if ( delta >= 0. )
{
... | false | false | false | false | false | 0 |
decodeData(unsigned char * data)
{
int byteCounter = 0;
int loopCounter = 0;
for(int i = 0; i < mHeight; i++)
{
for(int j = 0; j < mWidth; j++)
{
byteCounter = loopCounter / 8;
if (((data[byteCounter] >> (loopCounter % 8)) & 0x01) == 0x01)
{
... | false | false | false | false | false | 0 |
dispatch(Window win, XEvent &ev, bool parent) {
EventHandler *evhand = 0;
if (parent) {
EventHandlerMap::iterator it = m_parent.find(win);
if (it == m_parent.end())
return;
else
evhand = it->second;
} else {
win = getEventWindow(ev);
EventHandl... | false | false | false | false | false | 0 |
XbaeMatrixSetRowLabel(w, row, value)
Widget w;
int row;
String value;
{
XbaeMatrixWidget mw;
if (!XtIsSubclass(w, xbaeMatrixWidgetClass))
return;
mw = (XbaeMatrixWidget) w;
if (!mw->matrix.row_labels || !value)
{
XtAppWarningMsg(
XtWidgetToApplicationContext((Widget) m... | false | false | false | false | false | 0 |
buildTargetRenderState()
{
// Remove existing destination technique and passes
// in order to build it again from scratch.
if (mDstTechnique != NULL)
{
Material* mat = mSrcTechnique->getParent();
for (unsigned short i=0; i < mat->getNumTechniques(); ++i)
{
if (mat->g... | false | false | false | false | false | 0 |
OperandsComplete() const {
unsigned short NumOperands = TID->getNumOperands();
if (!TID->isVariadic() && getNumOperands()-NumImplicitOps >= NumOperands)
return true; // Broken: we have all the operands of this instruction!
return false;
} | false | false | false | false | false | 0 |
editor()
{
if( m_localFile )
return m_localFile->editor();
else
return Meta::TrackEditorPtr();
} | false | false | false | false | false | 0 |
PyParser_ParseStringObject(const char *s, PyObject *filename,
grammar *g, int start,
perrdetail *err_ret, int *flags)
{
struct tok_state *tok;
int exec_input = start == file_input;
if (initerr(err_ret, filename) < 0)
return NULL;
if (*flags... | false | false | false | false | false | 0 |
x509_crt_revoked( const x509_crt *crt, const x509_crl *crl )
{
const x509_crl_entry *cur = &crl->entry;
while( cur != NULL && cur->serial.len != 0 )
{
if( crt->serial.len == cur->serial.len &&
memcmp( crt->serial.p, cur->serial.p, crt->serial.len ) == 0 )
{
if( x509_... | false | false | false | false | false | 0 |
parse_reset(ReaderObj *self)
{
Py_XDECREF(self->fields);
self->fields = PyList_New(0);
if (self->fields == NULL)
return -1;
self->field_len = 0;
self->state = START_RECORD;
self->numeric_field = 0;
return 0;
} | false | false | false | false | false | 0 |
add(vector<Edge*> *edges,void* edgeSet)
{
for (size_t i=0; i<edges->size(); ++i)
{
Edge *edge=(*edges)[i];
add(edge,edgeSet);
}
} | false | false | false | false | false | 0 |
count_isoc_trbs_needed(struct xhci_hcd *xhci,
struct urb *urb, int i)
{
int num_trbs = 0;
u64 addr, td_len;
addr = (u64) (urb->transfer_dma + urb->iso_frame_desc[i].offset);
td_len = urb->iso_frame_desc[i].length;
num_trbs = DIV_ROUND_UP(td_len + (addr & (TRB_MAX_BUFF_SIZE - 1)),
TRB_MAX_BUFF_SIZE);
if (nu... | false | false | false | false | false | 0 |
maybe_adjust_types_for_deduction (unification_kind_t strict,
tree* parm,
tree* arg,
tree arg_expr)
{
int result = 0;
switch (strict)
{
case DEDUCE_CALL:
break;
case DEDUCE_CONV:
{
/* Swap PARM and ARG throughout the remainder of this
function; the handling is precise... | false | false | false | false | false | 0 |
ping_peer(struct drbd_device *device)
{
struct drbd_connection *connection = first_peer_device(device)->connection;
clear_bit(GOT_PING_ACK, &connection->flags);
request_ping(connection);
wait_event(connection->ping_wait,
test_bit(GOT_PING_ACK, &connection->flags) || device->state.conn < C_CONNECTED);
} | false | false | false | false | false | 0 |
toAscii(const FXString& s){
register FXint p=0;
FXString result;
FXwchar c;
while(p<s.length()){
c=s.wc(p);
if(0x80<=c){
result.append("\\u");
result.append(FXString::HEX[(c>>12)&15]);
result.append(FXString::HEX[(c>>8)&15]);
result.append(FXString::HEX[(c>>4)&15]);
c=FXStr... | false | false | false | false | false | 0 |
TabbingNextCellEnd(char *t, char **cell_end, char **next_cell)
/******************************************************************************
purpose: find the end of this tabbing cell
******************************************************************************/
{
char *s;
s = t;
while (s) {
... | false | false | false | false | false | 0 |
inf_gtk_chat_get_property(GObject* object,
guint prop_id,
GValue* value,
GParamSpec* pspec)
{
InfGtkChat* chat;
InfGtkChatPrivate* priv;
chat = INF_GTK_CHAT(object);
priv = INF_GTK_CHAT_PRIVATE(chat);
switch(prop_id)
{
case PR... | false | false | false | false | false | 0 |
match_init_copy(obj, orig)
VALUE obj, orig;
{
if (obj == orig) return obj;
if (!rb_obj_is_instance_of(orig, rb_obj_class(obj))) {
rb_raise(rb_eTypeError, "wrong argument class");
}
RMATCH(obj)->str = RMATCH(orig)->str;
re_free_registers(RMATCH(obj)->regs);
RMATCH(obj)->regs->allocated = 0;... | false | false | false | false | false | 0 |
s910_decompress (void* handle, struct ng_video_buf* out, struct ng_video_buf* in)
{
int row, col;
int val;
int bitpos;
unsigned char code;
unsigned char* addr;
int width;
int height;
unsigned char* inp;
unsigned char* outp;
unsigned char* inp_save;
struct S910Context* pContext;
if (!init_done)
return... | false | false | false | false | false | 0 |
GaussianSetHistogram(struct histogram_s *h, float mean, float sd)
{
int sc;
int hsize, idx;
int nbins;
float delta;
UnfitHistogram(h);
h->fit_type = HISTFIT_GAUSSIAN;
h->param[GAUSS_MEAN] = mean;
h->param[GAUSS_SD] = sd;
/* Calculate the expected values for the histogram.
*/
hs... | false | false | false | false | false | 0 |
bcast_sched_linear(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype) {
int peer, res;
/* send to all others */
if(rank == root) {
for (peer=0; peer<p;peer++) {
if(peer != root) {
/* send msg to peer */
res = NBC_Sched_send(buffer, false... | false | false | false | false | false | 0 |
init_store_cols (void)
{
int total_lines = lines_per_body * columns;
int chars_if_truncate = total_lines * (chars_per_column + 1);
free (line_vector);
/* FIXME: here's where it was allocated. */
line_vector = xmalloc ((total_lines + 1) * sizeof *line_vector);
free (end_vector);
end_vector = xmalloc (to... | false | false | false | false | false | 0 |
_e_gadcon_cb_dnd_leave(void *data, const char *type __UNUSED__, void *event __UNUSED__)
{
E_Gadcon *gc;
gc = data;
//INF("DND LEAVE");
/* If we exit the starting container hide the gadcon visual */
if (gc->drag_gcc->gadcon == gc) e_gadcon_client_hide(gc->drag_gcc);
/* Delete temporary object */
... | false | false | false | false | false | 0 |
GetVertices (Coord*& x, Coord*& y, int& n) {
Vertices* vertices = (Vertices*) GetGraphic();
Transformer t;
const Coord* origx, *origy;
n = vertices->GetOriginal(origx, origy);
ArrayDup(origx, origy, n, x, y);
vertices->TotalTransformation(t);
t.TransformList(x, y, n);
} | false | false | false | false | false | 0 |
aw_input(const char *title, const char *prompt, const char *default_input) {
// prompt user to enter a string
//
// title = title of window
// prompt = question
// default_input = default for answer (NULL -> "")
//
// result is NULL, if cancel was pressed
// otherwise res... | false | false | false | false | false | 0 |
hr222_set_hw_capture_level(struct pcxhr_mgr *mgr,
int level_l, int level_r, int level_mic)
{
/* program all input levels at the same time */
unsigned int data;
int i;
if (!mgr->capture_chips)
return -EINVAL; /* no PCX22 */
data = ((level_mic & 0xff) << 24); /* micro is mono, but apply */
data |= ((... | false | false | false | false | false | 0 |
xdr_gfs3_xattrop_rsp (XDR *xdrs, gfs3_xattrop_rsp *objp)
{
register int32_t *buf;
buf = NULL;
if (!xdr_int (xdrs, &objp->op_ret))
return FALSE;
if (!xdr_int (xdrs, &objp->op_errno))
return FALSE;
if (!xdr_bytes (xdrs, (char **)&objp->dict.dict_val, (u_int *) &objp->dict.dict_len, ~0))
return FA... | false | false | false | false | false | 0 |
loadProblem(const CoinPackedMatrix& matrix,
const double* collb,
const double* colub, const double* obj,
const double* rowlb,
const double* rowub)
{
const double inf = getInfinity();
int nrows = matrix.getNumRows();
// int ncols = matrix.getNumCols();
char * rowSense = new c... | false | false | false | false | false | 0 |
table_iter_next(HTableIterator iterator)
{
if (! iterator)
return 0;
if (iterator->before_start)
{
iterator->before_start = 0;
iterator->cur_field = iterator->table->fields;
}
else
{
if (iterator->cur_field)
iterator->cur_field = iterator->cur_field->... | false | false | false | false | false | 0 |
compile_script(const char *script)
{
FILE *f;
char fn[256], buf[256], *c;
int lineno = 0, x, err;
struct adsi_script *scr;
if (script[0] == '/')
ast_copy_string(fn, script, sizeof(fn));
else
snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, script);
if (!(f = fopen(fn, "r"))) {
ast_log(LOG_WAR... | false | false | false | false | false | 0 |
pc_delitem(struct map_session_data *sd, int n, int amount, int type, short dtype)
{
nullpo_retv(sd);
if(sd->status.inventory[n].nameid == 0 || amount <= 0 || sd->status.inventory[n].amount < amount || sd->inventory_data[n] == NULL)
return;
sd->status.inventory[n].amount -= amount;
sd->weight -= sd->inventory_da... | false | false | false | false | false | 0 |
rspi_rz_set_config_register(struct rspi_data *rspi, int access_size)
{
int spbr;
/* Sets output mode, MOSI signal, and (optionally) loopback */
rspi_write8(rspi, rspi->sppcr, RSPI_SPPCR);
/* Sets transfer bit rate */
spbr = DIV_ROUND_UP(clk_get_rate(rspi->clk),
2 * rspi->max_speed_hz) - 1;
rspi_write8(rs... | false | false | false | false | false | 0 |
GenerateGetFromCache(ZoneList<Expression*>* args) {
ASSERT_EQ(2, args->length());
ASSERT_NE(NULL, args->at(0)->AsLiteral());
int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value();
Handle<FixedArray> jsfunction_result_caches(
Top::global_context()->jsfunction_result_caches());
if (js... | false | false | false | false | false | 0 |
snd_pcm_route_convert(const snd_pcm_channel_area_t *dst_areas,
snd_pcm_uframes_t dst_offset,
const snd_pcm_channel_area_t *src_areas,
snd_pcm_uframes_t src_offset,
unsigned int src_channels,
unsigned int dst_channels,
snd_pcm_uframes_t frames,
snd_pcm_route_params_t *params)
{
... | false | false | false | false | false | 0 |
mt_state_free_null(mt_state_t **mts_ptr)
{
mt_state_t *mts = *mts_ptr;
if (mts != NULL) {
mt_state_check(mts);
WFREE(mts);
*mts_ptr = NULL;
}
} | false | false | false | false | false | 0 |
nextHasLccc() const {
U_ASSERT(state == CHECK_FWD && pos != length);
// The lowest code point with ccc!=0 is U+0300 which is CC 80 in UTF-8.
// CJK U+4000..U+DFFF except U+Axxx are also FCD-inert. (Lead bytes E4..ED except EA.)
UChar32 c = u8[pos];
if(c < 0xcc || (0xe4 <= c && c <= 0xed && c != 0xea... | false | false | false | false | false | 0 |
gretl_model_test_print_direct (const ModelTest *test, int heading, PRN *prn)
{
const char *tstr;
char buf[512];
set_alt_gettext_mode(prn);
if (rtf_format(prn)) {
pputs(prn, "\\par \\ql ");
}
if (heading) {
gretl_test_print_heading(test, prn);
}
gretl_test_print_h_0(test, heading, p... | false | false | false | false | false | 0 |
zxenc_pubkey_enc(zxid_conf* cf, struct zx_str* data, struct zx_xenc_EncryptedKey_s** ekp, X509* cert, char* idsuffix, zxid_entity* meta)
{
struct rsa_st* rsa_pkey;
char symkey[128/8];
struct zx_str symkey_ss;
struct zx_str* ss;
struct zx_str* b64;
struct zx_xenc_EncryptedKey_s* ek = zx_NEW_xenc_EncryptedKey... | false | false | false | false | false | 0 |
gitg_repository_exists (GitgRepository *repository)
{
g_return_val_if_fail (GITG_IS_REPOSITORY (repository), FALSE);
if (repository->priv->git_dir == NULL)
{
return FALSE;
}
return g_file_query_exists (repository->priv->git_dir, NULL) &&
g_file_query_exists (repository->priv->work_tree, NULL);
} | false | false | false | false | false | 0 |
libhydra_init()
{
private_hydra_t *this;
if (hydra)
{ /* already initialized, increase refcount */
this = (private_hydra_t*)hydra;
ref_get(&this->ref);
return !this->integrity_failed;
}
INIT(this,
.public = {
.attributes = attribute_manager_create(),
},
.ref = 1,
);
hydra = &this->public;
this... | false | false | false | false | false | 0 |
repaint_point (EMap *map, EMapPoint *point)
{
gdouble px, py;
if (!gtk_widget_is_drawable (GTK_WIDGET (map)))
return;
e_map_world_to_window (map, point->longitude, point->latitude, &px, &py);
gtk_widget_queue_draw_area (GTK_WIDGET (map),
(gint) px - 2, (gint) ... | false | false | false | false | false | 0 |
cdiEncodeTimeval(int date, int time, taxis_t *taxis)
{
double timevalue;
if ( taxis->type == TAXIS_ABSOLUTE )
{
if ( taxis->unit == TUNIT_YEAR )
{
int year, month, day;
cdiDecodeDate(date, &year, &month, &day);
timevalue = year;
}
else if ( taxis->unit == TUNIT_MONTH )
{
int year, m... | false | false | false | false | false | 0 |
kunify(k1,o1,k2,o2) /* Unify kind expr (k1,o1) with */
Kind k1,k2; /* (k2,o2) */
Int o1,o2; {
Tyvar *kyv1, *kyv2;
deRef(kyv1,k1,o1);
deRef(kyv2,k2,o2);
if (kyv1)
if (kyv2)
return kvarToVarBind(kyv1,kyv2); /* k1, k2 variables */
else
return kvarToTypeBind(kyv1,k2,o2); ... | false | false | false | false | false | 0 |
GetMathConstantNumber(int currentIndex)
{
if (strncmp(&this->Function[currentIndex], "iHat", 4) == 0)
{
return VTK_PARSER_IHAT;
}
if (strncmp(&this->Function[currentIndex], "jHat", 4) == 0)
{
return VTK_PARSER_JHAT;
}
if (strncmp(&this->Function[currentIndex], "kHat", 4) == 0)
{
re... | false | false | false | false | false | 0 |
button_release_cb (GocCanvas *canvas, GdkEventButton *event, G_GNUC_UNUSED gpointer data)
{
double x, y;
GocItem *item;
if (event->window != gtk_layout_get_bin_window (&canvas->base))
return TRUE;
x = (canvas->direction == GOC_DIRECTION_RTL)?
canvas->scroll_x1 + (canvas->width - event->x) / canvas->pixels_per... | false | false | false | false | false | 0 |
skill(int which) {
return _current_skills[which] ? _current_skills[which] : P_UNSKILLED;
} | false | false | false | false | false | 0 |
sv_selection_copy (SheetView *sv, WorkbookControl *wbc)
{
GnmRange const *sel;
g_return_val_if_fail (IS_SHEET_VIEW (sv), FALSE);
if (!(sel = selection_first_range (sv, GO_CMD_CONTEXT (wbc), _("Copy"))))
return FALSE;
gnm_app_clipboard_cut_copy (wbc, FALSE, sv, sel, TRUE);
return TRUE;
} | false | false | false | false | false | 0 |
load_modules(const char *name)
{
struct conf_sect_t *sect;
struct conf_option_t *opt;
char *fname;
char *path = MODULE_PATH;
char *ptr1, *ptr2;
struct module_t *m;
void *h;
sect = conf_get_section(name);
if (!sect) {
fprintf(stderr, "loader: section '%s' not found\n", name);
return -1;
}
fname = _mallo... | false | false | false | false | false | 0 |
skipToSeparator(char *pStart, int *pNest)
#else
char * skipToSeparator(pStart, pNest)
char *pStart;
int *pNest;
#endif
{
char * p = pStart;
for ( ; ; ) {
p = skipToSeparatorOrEqualSign(p, pNest);
if (*pNest != 0) return p;
if (*p == ',') return p;
if (*p == 0) return p;
p++;
}
} | false | false | false | false | false | 0 |
setDashes(FXuint dashoffset,const FXchar *dashpattern,FXuint dashlength){
register FXuint len,i;
for(i=len=0; i<dashlength; i++){
dashpat[i]=dashpattern[i];
len+=(FXuint)dashpattern[i];
}
dashlen=dashlength;
dashoff=dashoffset%len;
} | false | false | false | false | false | 0 |
align_pt_load_xml(gchar * pt_xml_filename, gchar **perror_buf, AmitkSpace *space) {
xmlDocPtr doc;
AmitkFiducialMark * new_pt;
AmitkPoint point;
xmlNodePtr nodes;
gchar * temp_string;
/* parse the xml file */
if ((doc = xmlParseFile(pt_xml_filename)) == NULL) {
amitk_append_str_with_newline(perror_... | false | false | false | false | false | 0 |
usb_dmac_chan_start_desc(struct usb_dmac_chan *chan)
{
struct virt_dma_desc *vd;
vd = vchan_next_desc(&chan->vc);
if (!vd) {
chan->desc = NULL;
return;
}
/*
* Remove this request from vc->desc_issued. Otherwise, this driver
* will get the previous value from vchan_next_desc() after a transfer
* was com... | false | false | false | false | false | 0 |
scn_init(char *addr)
{
int fd, opt, err;
union {
struct sockaddr s;
struct sockaddr_storage ss;
struct sockaddr_in s4;
struct sockaddr_in6 s6;
} l;
socklen_t slen;
fd = socket(ss.ss_family, SOCK_STREAM, IPPROTO_TCP);
if (fd < 0) {
log_error("%s %d: %s\n", __FUNCTION__, __LINE__, strerror(errno));
ret... | false | false | false | false | false | 0 |
getPeople() const
{
std::vector<Person*> people;
for (IdPersonMap::const_iterator P=m_members.begin(); P != m_members.end(); ++P)
{
if (P->second)
people.push_back(P->second);
}
return people;
} | false | false | false | false | false | 0 |
savefile_handle_unknown(CdlInterpreter interp, int argc, const char* argv[])
{
CYG_REPORT_FUNCNAME("CdlToplevel::savefile_handle_unknown");
CYG_REPORT_FUNCARG2XV(interp, argc);
CYG_PRECONDITION_CLASSC(interp);
CdlParse::report_error(interp, "", std::string("Unknown command `") + argv[1] + "'.");
... | false | false | false | false | false | 0 |
rl_signal_handler (sig)
int sig;
{
#if defined (HAVE_POSIX_SIGNALS)
sigset_t set;
#else /* !HAVE_POSIX_SIGNALS */
# if defined (HAVE_BSD_SIGNALS)
long omask;
# else /* !HAVE_BSD_SIGNALS */
sighandler_cxt dummy_cxt; /* needed for rl_set_sighandler call */
# endif /* !HAVE_BSD_SIGNALS */
#endif /* !HAVE_POS... | false | false | false | false | false | 0 |
bxt_ddi_vswing_sequence(struct drm_device *dev, u32 level,
enum port port, int type)
{
struct drm_i915_private *dev_priv = dev->dev_private;
const struct bxt_ddi_buf_trans *ddi_translations;
u32 n_entries, i;
uint32_t val;
if (type == INTEL_OUTPUT_EDP && dev_priv->edp_low_vswing) {
n_entries = ARRAY_SIZ... | false | false | false | false | false | 0 |
montecarlo_state_init(char *arg, struct board *b)
{
struct montecarlo *mc = calloc2(1, sizeof(struct montecarlo));
mc->debug_level = 1;
mc->gamelen = MC_GAMELEN;
if (arg) {
char *optspec, *next = arg;
while (*next) {
optspec = next;
next += strcspn(next, ",");
if (*next) { *next++ = 0; } else { *next... | false | false | false | false | false | 0 |
dht_bits_for (uint64_t num)
{
uint64_t bits = 0, ctrl = 1;
while (ctrl < num) {
ctrl *= 2;
bits ++;
}
return bits;
} | false | false | false | false | false | 0 |
DropExtraSpecial (edict_t * ent)
{
gitem_t *item;
if (ent->client->pers.weapon->typeNum == MP5_NUM
|| ent->client->pers.weapon->typeNum == M4_NUM
|| ent->client->pers.weapon->typeNum == M3_NUM
|| ent->client->pers.weapon->typeNum == HC_NUM
|| ent->client->pers.weapon->typeNum == SNIPER_NUM)
{
item = ent-... | false | false | false | false | false | 0 |
signal_cleanup(void)
{
t_signal **svec, *sig, *sig2;
int i;
while (sig = signal_usedlist)
{
signal_usedlist = sig->s_nextused;
if (!sig->s_isborrowed)
t_freebytes(sig->s_vec, sig->s_vecsize * sizeof (*sig->s_vec));
t_freebytes(sig, sizeof *sig);
}
for (i = 0; ... | false | false | false | false | false | 0 |
__repmgr_check_listener(env)
ENV *env;
{
DB_REP *db_rep;
REP *rep;
SITEINFO *sites;
db_timespec t;
int ret;
db_rep = env->rep_handle;
rep = db_rep->region;
ret = 0;
/*
* Only subordinate rep-aware process can take over listener role, so
* no need to check listener in listener process or rep unaware proc... | false | false | false | false | false | 0 |
make_references(hid_t loc_id)
{
herr_t ret = SUCCEED;
herr_t status;
/* add target objects */
status = gen_refered_objs(loc_id);
if (status == FAIL)
{
fprintf(stderr, "Failed to generate referenced object.\n");
ret = FAIL;
}
/* add object reference */
status = gen_... | false | false | false | false | false | 0 |
ap_mpm_rewrite_args(process_rec *process)
{
apr_array_header_t *mpm_new_argv;
apr_status_t rv;
apr_getopt_t *opt;
char optbuf[3];
const char *optarg;
mpm_new_argv = apr_array_make(process->pool, process->argc,
sizeof(const char **));
*(const char **)apr_arr... | true | true | true | false | false | 1 |
Separator_Draw( menuseparator_s *s )
{
if ( s->generic.name )
Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x, s->generic.y + s->generic.parent->y, s->generic.name );
} | false | false | false | false | false | 0 |
read_cache_pages(struct address_space *mapping, struct list_head *pages,
int (*filler)(void *, struct page *), void *data)
{
struct page *page;
int ret = 0;
while (!list_empty(pages)) {
page = list_to_page(pages);
list_del(&page->lru);
if (add_to_page_cache_lru(page, mapping, page->index,
mapping_gfp_c... | false | false | false | false | false | 0 |
pinconf_generic_dump_one(struct pinctrl_dev *pctldev,
struct seq_file *s, const char *gname,
unsigned pin,
const struct pin_config_item *items,
int nitems)
{
int i;
for (i = 0; i < nitems; i++) {
unsigned long config;
int ret;
/* We want to check out this parameter */
con... | false | false | false | false | false | 0 |
mpz_tdiv_qr(mpz_ptr q, mpz_ptr r, mpz_ptr z, mpz_ptr d)
{
int cmp;
int err;
if (d->l == 0) /* division by zero */
return SBN_INVAL;
if (z == d) {
err = mpz_set_ui(q, 1); /* a/a = 1 */
if (err != SBN_OK)
return err;
mpz_setzero(r); /* a%a = 0 */
return SBN_OK;
}
cmp = mpz_cmpabs(z, d);
if (cmp < 0) ... | false | false | false | false | false | 0 |
gettheta(sex_, LINK)
thetavalues **sex_;
struct LOC_readloci *LINK;
{
thetarray oldtheta;
long i;
thetavalues *WITH;
long FORLIM;
#if !PARALLEL
*sex_ = (thetavalues *)Malloc(sizeof(thetavalues));
for (i = 0; i < maxlocus; i++)
(*sex_)->theta[i] = 0.0;
#endif
nuneed = 7;
for(i = 2; i < mlocus; i++)
... | false | true | false | false | false | 1 |
smime_get_cert_info(const char* x509_cert_pem,
char** modulus, /* public key modulus */
char** fingerprint) /* finger print that identifies */
{
long serial = -1;
X509* x509 = NULL;
if (modulus) *modulus = NULL;
if (fingerprint) *fingerprint = NULL;
if (!(x509 = extract_certificate(x509_cert... | false | false | false | false | false | 0 |
Done(int restart, char *command)
{
cleanupDone=1;
#ifdef M4
if (m4_enable)
{
extern char *fvwm_file;
/* With m4 processing, a temporary file was created to hold the
processed file. Delete the file now because we don't need it
any more. It will be created again during restart. */
... | true | true | true | false | true | 1 |
camel_pointer_tracker_untrack (gpointer ptr)
{
g_return_if_fail (ptr != NULL);
G_LOCK (ptr_tracker);
if (!ptr_tracker)
g_printerr ("Pointer tracker not initialized, thus cannot remove %p\n", ptr);
else if (!g_hash_table_lookup (ptr_tracker, ptr))
g_printerr ("Pointer %p is not tracked\n", ptr);
else
g_hash... | false | false | false | false | false | 0 |
__GEOIP_PREPARE_TEREDO(geoipv6_t * v6)
{
int i;
if ((v6->s6_addr[0]) != 0x20) {
return;
}
if ((v6->s6_addr[1]) != 0x01) {
return;
}
if ((v6->s6_addr[2]) != 0x00) {
return;
}
if ((v6->s6_addr[3]) != 0x00) {
return;
}
for (i = 0; i < 12; i++) {
... | true | true | false | false | false | 1 |
t11_reset(void *param)
{
static const UINT16 initial_pc[] =
{
0xc000, 0x8000, 0x4000, 0x2000,
0x1000, 0x0000, 0xf600, 0xf400
};
struct t11_setup *setup = param;
int i;
/* reset the state */
memset(&t11, 0, sizeof(t11));
/* initial SP is 376 octal, or 0xfe */
SP = 0x00fe;
/* initial PC... | false | false | false | false | false | 0 |
ajMartGetAttributesRetry(AjPSeqin seqin, const AjPStr dataset)
{
AjPMartquery mq = NULL;
AjPStr orighost = NULL;
AjPStr origpath = NULL;
AjPStr schema = NULL;
ajuint origport = 0;
AjBool ret = ajFalse;
mq = ajMartGetMartqueryPtr(seqin);
if(!mq)
return ajFalse;
... | false | false | false | false | false | 0 |
gl_puts (buf)
char *buf;
{
int len;
if (buf)
{
len = strlen (buf);
write (1, buf, len);
}
} | false | false | false | false | false | 0 |
kook_NEW_asm(CTX ctx, kStmtExpr *stmt, int espidx)
{
kMethod *mtd = tkNN(stmt, 0)->mtd;
kclass_t cid = (tkNN(stmt, 1))->cid;
kClass *c = new_Type(ctx, cid);
CALL(ctx, COMPILER_API.NEW, 4, stmt, NN(espidx), c, mtd);
} | false | false | false | false | false | 0 |
rrule_parse_weekly_days (char *s,
struct icalrecurrencetype *recur,
char **error_message)
{
int i;
/* If we've already found an error, just return. */
if (*error_message)
return NULL;
for (i = 0; i < ICAL_BY_DAY_SIZE; i++) {
char *e = s;
int found_day, day;
found_day = -1;
fo... | false | false | false | false | false | 0 |
SerializeColumns(DataStructures::Table *in, RakNet::BitStream *out, DataStructures::List<int> &skipColumnIndices)
{
const DataStructures::List<DataStructures::Table::ColumnDescriptor> &columns=in->GetColumns();
out->Write((unsigned)columns.Size()-skipColumnIndices.Size());
unsigned i;
for (i=0; i<columns.Size(... | false | false | false | false | false | 0 |
create_access (tree expr, gimple stmt, bool write)
{
struct access *access;
HOST_WIDE_INT offset, size, max_size;
tree base = expr;
bool ptr, unscalarizable_region = false;
base = get_ref_base_and_extent (expr, &offset, &size, &max_size);
if (sra_mode == SRA_MODE_EARLY_IPA
&& TREE_CODE (base) == MEM... | false | false | false | false | false | 0 |
mailimap_body_ext_1part_1_parse(mailstream * fd, MMAPString * buffer,
size_t * indx,
struct mailimap_body_fld_dsp ** fld_dsp,
struct mailimap_body_fld_lang ** fld_lang,
clist ** body_ext_list,
size_t progr_rate,
progress_function * progr_fun)
{
size_t cur_token;
int r;
cur_token = * ind... | false | false | false | false | false | 0 |
i2c_read_le16(struct i2c_client *client)
{
u8 buf[2];
int status;
status = i2c_master_recv(client, buf, 2);
if (status < 0)
return status;
return (buf[1] << 8) | buf[0];
} | false | false | false | false | false | 0 |
draw_keys (int draw)
{
char s[20];
static char *key[4] =
{"UP", "DOWN", "LEFT", "RIGHT"};
static char *rkey[3] =
{"ACCELERATION", "ROTATE LEFT", "ROTATE RIGHT"};
if (!draw)
return;
nmenu = 2;
sprintf (s, "PLAYER:%i", player + 1);
DrawWhiteMaskedText ((int) (MAPWIDTH / 2 - 4 * strl... | true | true | false | false | false | 1 |
hns_dsaf_fix_mac_mode(struct hns_mac_cb *mac_cb)
{
enum dsaf_port_rate_mode mode;
struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev;
int mac_id = mac_cb->mac_id;
if (mac_cb->mac_type != HNAE_PORT_SERVICE)
return;
if (mac_cb->phy_if == PHY_INTERFACE_MODE_XGMII)
mode = DSAF_PORT_RATE_10000;
else
mode = DSAF_PO... | false | false | false | false | false | 0 |
This is an unofficial HuggingFace version of "Draper VDISC Dataset - Vulnerability Detection in Source Code" dataset from "Automated Vulnerability Detection in Source Code Using Deep Representation Learning".
Draper VDISC Dataset - Vulnerability Detection in Source Code
The dataset consists of the source code of 1.27 million functions mined from open source software, labeled by static analysis for potential vulnerabilities. For more details on the dataset and benchmark results, see https://arxiv.org/abs/1807.04320.
The data is provided in three HDF5 files corresponding to an 80:10:10 train/validate/test split, matching the splits used in our paper. The combined file size is roughly 1 GB. Each function's raw source code, starting from the function name, is stored as a variable-length UTF-8 string. Five binary 'vulnerability' labels are provided for each function, corresponding to the four most common CWEs in our data plus all others:
CWE-120 (3.7% of functions)
CWE-119 (1.9% of functions)
CWE-469 (0.95% of functions)
CWE-476 (0.21% of functions)
CWE-other (2.7% of functions)
Functions may have more than one detected CWE each.
Please cite our paper if you use this dataset in a publication: https://arxiv.org/abs/1807.04320
This project was sponsored by the Air Force Research Laboratory (AFRL) as part of the DARPA MUSE (https://www.darpa.mil/program/mining-and-understanding-software-enclaves) program.
About Draper (https://www.draper.com) - Draper is an independent, not-for-profit corporation, which means its primary commitment is to the success of customers' missions rather than to shareholders. For either government or private sector customers, Draper leverages its deep experience and innovative thinking to be an effective engineering research and development partner, designing solutions or objectively evaluating the ideas or products of others. Draper will partner with other organizations — from large for-profit prime contractors, to government agencies, to university researchers — in a variety of capacities. Services Draper provides range from concept development through delivered solution and lifecycle support. Draper's multidisciplinary teams of engineers and scientists can deliver useful solutions to even the most critical problems.
- Downloads last month
- 141