project
stringclasses 791
values | commit_id
stringlengths 6
81
| CVE ID
stringlengths 13
16
| CWE ID
stringclasses 127
values | func
stringlengths 5
484k
| vul
int8 0
1
|
---|---|---|---|---|---|
radare2 | e9ce0d64faf19fa4e9c260250fbdf25e3c11e152 | NOT_APPLICABLE | NOT_APPLICABLE | R_API int r_bin_java_resolve_cp_idx_print_summary(RBinJavaObj *BIN_OBJ, int idx) {
RBinJavaCPTypeObj *item = NULL;
if (BIN_OBJ && BIN_OBJ->cp_count < 1) {
return false;
}
item = (RBinJavaCPTypeObj *) r_bin_java_get_item_from_bin_cp_list (BIN_OBJ, idx);
if (item) {
((RBinJavaCPTypeMetas *)
item->metas->type_info)->
allocs->print_summary (item);
} else {
eprintf ("Error: Invalid CP Object.\n");
}
return item ? true : false;
} | 0 |
ImageMagick6 | 5caef6e97f3f575cf7bea497865a4c1e624b8010 | NOT_APPLICABLE | NOT_APPLICABLE | static MagickBooleanType WriteMATImage(const ImageInfo *image_info,Image *image)
{
char
MATLAB_HDR[0x80];
ExceptionInfo
*exception;
MagickBooleanType
status;
MagickOffsetType
scene;
size_t
imageListLength;
struct tm
utc_time;
time_t
current_time;
/*
Open output image file.
*/
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickCoreSignature);
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),"enter MAT");
status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
if (status == MagickFalse)
return(MagickFalse);
image->depth=8;
current_time=GetMagickTime();
GetMagickUTCtime(¤t_time,&utc_time);
(void) memset(MATLAB_HDR,' ',MagickMin(sizeof(MATLAB_HDR),124));
FormatLocaleString(MATLAB_HDR,sizeof(MATLAB_HDR),
"MATLAB 5.0 MAT-file, Platform: %s, Created on: %s %s %2d %2d:%2d:%2d %d",
OsDesc,DayOfWTab[utc_time.tm_wday],MonthsTab[utc_time.tm_mon],
utc_time.tm_mday,utc_time.tm_hour,utc_time.tm_min,
utc_time.tm_sec,utc_time.tm_year+1900);
MATLAB_HDR[0x7C]=0;
MATLAB_HDR[0x7D]=1;
MATLAB_HDR[0x7E]='I';
MATLAB_HDR[0x7F]='M';
(void) WriteBlob(image,sizeof(MATLAB_HDR),(unsigned char *) MATLAB_HDR);
scene=0;
imageListLength=GetImageListLength(image);
do
{
char
padding;
MagickBooleanType
is_gray;
QuantumInfo
*quantum_info;
size_t
data_size;
unsigned char
*pixels;
unsigned int
z;
(void) TransformImageColorspace(image,sRGBColorspace);
is_gray=SetImageGray(image,&image->exception);
z=(is_gray != MagickFalse) ? 0 : 3;
/*
Store MAT header.
*/
data_size=image->rows*image->columns;
if (is_gray == MagickFalse)
data_size*=3;
padding=((unsigned char)(data_size-1) & 0x7) ^ 0x7;
(void) WriteBlobLSBLong(image,miMATRIX);
(void) WriteBlobLSBLong(image,(unsigned int) data_size+padding+
((is_gray != MagickFalse) ? 48 : 56));
(void) WriteBlobLSBLong(image,0x6); /* 0x88 */
(void) WriteBlobLSBLong(image,0x8); /* 0x8C */
(void) WriteBlobLSBLong(image,0x6); /* 0x90 */
(void) WriteBlobLSBLong(image,0);
(void) WriteBlobLSBLong(image,0x5); /* 0x98 */
(void) WriteBlobLSBLong(image,(is_gray != MagickFalse) ? 0x8 : 0xC); /* 0x9C - DimFlag */
(void) WriteBlobLSBLong(image,(unsigned int) image->rows); /* x: 0xA0 */
(void) WriteBlobLSBLong(image,(unsigned int) image->columns); /* y: 0xA4 */
if (is_gray == MagickFalse)
{
(void) WriteBlobLSBLong(image,3); /* z: 0xA8 */
(void) WriteBlobLSBLong(image,0);
}
(void) WriteBlobLSBShort(image,1); /* 0xB0 */
(void) WriteBlobLSBShort(image,1); /* 0xB2 */
(void) WriteBlobLSBLong(image,'M'); /* 0xB4 */
(void) WriteBlobLSBLong(image,0x2); /* 0xB8 */
(void) WriteBlobLSBLong(image,(unsigned int) data_size); /* 0xBC */
/*
Store image data.
*/
exception=(&image->exception);
quantum_info=AcquireQuantumInfo(image_info,image);
if (quantum_info == (QuantumInfo *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
pixels=GetQuantumPixels(quantum_info);
do
{
const PixelPacket
*p;
ssize_t
y;
for (y=0; y < (ssize_t) image->columns; y++)
{
size_t
length;
p=GetVirtualPixels(image,y,0,1,image->rows,&image->exception);
if (p == (const PixelPacket *) NULL)
break;
length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
z2qtype[z],pixels,exception);
if (length != image->columns)
break;
if (WriteBlob(image,image->rows,pixels) != image->rows)
break;
}
if (y < (ssize_t) image->columns)
break;
if (!SyncAuthenticPixels(image,exception))
break;
} while (z-- >= 2);
while (padding-- > 0)
(void) WriteBlobByte(image,0);
quantum_info=DestroyQuantumInfo(quantum_info);
if (GetNextImageInList(image) == (Image *) NULL)
break;
image=SyncNextImageInList(image);
status=SetImageProgress(image,SaveImagesTag,scene++,imageListLength);
if (status == MagickFalse)
break;
} while (image_info->adjoin != MagickFalse);
(void) CloseBlob(image);
return(status);
} | 0 |
linux | a5598bd9c087dc0efc250a5221e5d0e6f584ee88 | NOT_APPLICABLE | NOT_APPLICABLE | static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock,
struct sk_buff *skb, u8 flags)
{
struct iucv_sock *iucv = iucv_sk(sock);
struct af_iucv_trans_hdr *phs_hdr;
struct sk_buff *nskb;
int err, confirm_recv = 0;
memset(skb->head, 0, ETH_HLEN);
phs_hdr = (struct af_iucv_trans_hdr *)skb_push(skb,
sizeof(struct af_iucv_trans_hdr));
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
skb_push(skb, ETH_HLEN);
skb_reset_mac_header(skb);
memset(phs_hdr, 0, sizeof(struct af_iucv_trans_hdr));
phs_hdr->magic = ETH_P_AF_IUCV;
phs_hdr->version = 1;
phs_hdr->flags = flags;
if (flags == AF_IUCV_FLAG_SYN)
phs_hdr->window = iucv->msglimit;
else if ((flags == AF_IUCV_FLAG_WIN) || !flags) {
confirm_recv = atomic_read(&iucv->msg_recv);
phs_hdr->window = confirm_recv;
if (confirm_recv)
phs_hdr->flags = phs_hdr->flags | AF_IUCV_FLAG_WIN;
}
memcpy(phs_hdr->destUserID, iucv->dst_user_id, 8);
memcpy(phs_hdr->destAppName, iucv->dst_name, 8);
memcpy(phs_hdr->srcUserID, iucv->src_user_id, 8);
memcpy(phs_hdr->srcAppName, iucv->src_name, 8);
ASCEBC(phs_hdr->destUserID, sizeof(phs_hdr->destUserID));
ASCEBC(phs_hdr->destAppName, sizeof(phs_hdr->destAppName));
ASCEBC(phs_hdr->srcUserID, sizeof(phs_hdr->srcUserID));
ASCEBC(phs_hdr->srcAppName, sizeof(phs_hdr->srcAppName));
if (imsg)
memcpy(&phs_hdr->iucv_hdr, imsg, sizeof(struct iucv_message));
skb->dev = iucv->hs_dev;
if (!skb->dev)
return -ENODEV;
if (!(skb->dev->flags & IFF_UP) || !netif_carrier_ok(skb->dev))
return -ENETDOWN;
if (skb->len > skb->dev->mtu) {
if (sock->sk_type == SOCK_SEQPACKET)
return -EMSGSIZE;
else
skb_trim(skb, skb->dev->mtu);
}
skb->protocol = ETH_P_AF_IUCV;
nskb = skb_clone(skb, GFP_ATOMIC);
if (!nskb)
return -ENOMEM;
skb_queue_tail(&iucv->send_skb_q, nskb);
err = dev_queue_xmit(skb);
if (net_xmit_eval(err)) {
skb_unlink(nskb, &iucv->send_skb_q);
kfree_skb(nskb);
} else {
atomic_sub(confirm_recv, &iucv->msg_recv);
WARN_ON(atomic_read(&iucv->msg_recv) < 0);
}
return net_xmit_eval(err);
}
| 0 |
ImageMagick | 256825d4eb33dc301496710d15cf5a7ae924088b | NOT_APPLICABLE | NOT_APPLICABLE | static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset,
const int whence,void *user_data)
{
PhotoshopProfile
*profile;
profile=(PhotoshopProfile *) user_data;
switch (whence)
{
case SEEK_SET:
default:
{
if (offset < 0)
return(-1);
profile->offset=offset;
break;
}
case SEEK_CUR:
{
if ((profile->offset+offset) < 0)
return(-1);
profile->offset+=offset;
break;
}
case SEEK_END:
{
if (((MagickOffsetType) profile->length+offset) < 0)
return(-1);
profile->offset=profile->length+offset;
break;
}
}
return(profile->offset);
}
| 0 |
jasper | 4a59cfaf9ab3d48fca4a15c0d2674bf7138e3d1a | NOT_APPLICABLE | NOT_APPLICABLE | void jpc_ns_invlift_col(jpc_fix_t *a, int numrows, int stride,
int parity)
{
jpc_fix_t *lptr;
jpc_fix_t *hptr;
register jpc_fix_t *lptr2;
register jpc_fix_t *hptr2;
register int n;
int llen;
llen = (numrows + 1 - parity) >> 1;
if (numrows > 1) {
/* Apply the scaling step. */
#if defined(WT_DOSCALE)
lptr = &a[0];
n = llen;
while (n-- > 0) {
lptr2 = lptr;
lptr2[0] = jpc_fix_mul(lptr2[0], jpc_dbltofix(1.0 / LGAIN));
++lptr2;
lptr += stride;
}
hptr = &a[llen * stride];
n = numrows - llen;
while (n-- > 0) {
hptr2 = hptr;
hptr2[0] = jpc_fix_mul(hptr2[0], jpc_dbltofix(1.0 / HGAIN));
++hptr2;
hptr += stride;
}
#endif
/* Apply the first lifting step. */
lptr = &a[0];
hptr = &a[llen * stride];
if (!parity) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
DELTA), hptr2[0]));
++lptr2;
++hptr2;
lptr += stride;
}
n = llen - (!parity) - (parity != (numrows & 1));
while (n-- > 0) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(DELTA),
jpc_fix_add(hptr2[0], hptr2[stride])));
++lptr2;
++hptr2;
lptr += stride;
hptr += stride;
}
if (parity != (numrows & 1)) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
DELTA), hptr2[0]));
++lptr2;
++hptr2;
}
/* Apply the second lifting step. */
lptr = &a[0];
hptr = &a[llen * stride];
if (parity) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
GAMMA), lptr2[0]));
++hptr2;
++lptr2;
hptr += stride;
}
n = numrows - llen - parity - (parity == (numrows & 1));
while (n-- > 0) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(GAMMA),
jpc_fix_add(lptr2[0], lptr2[stride])));
++lptr2;
++hptr2;
hptr += stride;
lptr += stride;
}
if (parity == (numrows & 1)) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
GAMMA), lptr2[0]));
++lptr2;
++hptr2;
}
/* Apply the third lifting step. */
lptr = &a[0];
hptr = &a[llen * stride];
if (!parity) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
hptr2[0]));
++lptr2;
++hptr2;
lptr += stride;
}
n = llen - (!parity) - (parity != (numrows & 1));
while (n-- > 0) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(BETA),
jpc_fix_add(hptr2[0], hptr2[stride])));
++lptr2;
++hptr2;
lptr += stride;
hptr += stride;
}
if (parity != (numrows & 1)) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(lptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 * BETA),
hptr2[0]));
++lptr2;
++hptr2;
}
/* Apply the fourth lifting step. */
lptr = &a[0];
hptr = &a[llen * stride];
if (parity) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
ALPHA), lptr2[0]));
++hptr2;
++lptr2;
hptr += stride;
}
n = numrows - llen - parity - (parity == (numrows & 1));
while (n-- > 0) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(ALPHA),
jpc_fix_add(lptr2[0], lptr2[stride])));
++lptr2;
++hptr2;
hptr += stride;
lptr += stride;
}
if (parity == (numrows & 1)) {
lptr2 = lptr;
hptr2 = hptr;
jpc_fix_minuseq(hptr2[0], jpc_fix_mul(jpc_dbltofix(2.0 *
ALPHA), lptr2[0]));
++lptr2;
++hptr2;
}
} else {
#if defined(WT_LENONE)
if (parity) {
lptr2 = &a[0];
lptr2[0] = jpc_fix_asr(lptr2[0], 1);
++lptr2;
}
#endif
}
}
| 0 |
Chrome | b15c87071f906301bccc824ce013966ca93998c7 | NOT_APPLICABLE | NOT_APPLICABLE | void WtsSessionProcessDelegate::Core::InitializeJobCompleted(
scoped_ptr<ScopedHandle> job) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
DCHECK(!job_.IsValid());
job_ = job->Pass();
}
| 0 |
linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | NOT_APPLICABLE | NOT_APPLICABLE | static int ftrace_pid_add(int p)
{
struct pid *pid;
struct ftrace_pid *fpid;
int ret = -EINVAL;
mutex_lock(&ftrace_lock);
if (!p)
pid = ftrace_swapper_pid;
else
pid = find_get_pid(p);
if (!pid)
goto out;
ret = 0;
list_for_each_entry(fpid, &ftrace_pids, list)
if (fpid->pid == pid)
goto out_put;
ret = -ENOMEM;
fpid = kmalloc(sizeof(*fpid), GFP_KERNEL);
if (!fpid)
goto out_put;
list_add(&fpid->list, &ftrace_pids);
fpid->pid = pid;
set_ftrace_pid_task(pid);
ftrace_update_pid_func();
ftrace_startup_enable(0);
mutex_unlock(&ftrace_lock);
return 0;
out_put:
if (pid != ftrace_swapper_pid)
put_pid(pid);
out:
mutex_unlock(&ftrace_lock);
return ret;
}
| 0 |
vte | 58bc3a942f198a1a8788553ca72c19d7c1702b74 | NOT_APPLICABLE | NOT_APPLICABLE | vte_sequence_handler_mr (VteTerminal *terminal, GValueArray *params)
{
terminal->pvt->screen->defaults.attr.reverse = 1;
} | 0 |
ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | NOT_APPLICABLE | NOT_APPLICABLE | void Magick::Image::thumbnail(const Geometry &geometry_)
{
MagickCore::Image
*newImage;
size_t
height=rows(),
width=columns();
ssize_t
x=0,
y=0;
ParseMetaGeometry(static_cast<std::string>(geometry_).c_str(),&x,&y,&width,
&height);
GetPPException;
newImage=ThumbnailImage(constImage(),width,height,exceptionInfo);
replaceImage(newImage);
ThrowImageException;
} | 0 |
gerbv | 319a8af890e4d0a5c38e6d08f510da8eefc42537 | NOT_APPLICABLE | NOT_APPLICABLE | callbacks_show_selection_on_invisible (GtkMenuItem *menuitem, gpointer user_data)
{
mainProject->show_invisible_selection = GTK_CHECK_MENU_ITEM(menuitem)->active;
render_refresh_rendered_image_on_screen();
} | 0 |
raptor | a676f235309a59d4aa78eeffd2574ae5d341fcb0 | NOT_APPLICABLE | NOT_APPLICABLE | raptor_object_options_get_option(raptor_object_options* options,
raptor_option option,
char** string_p, int* integer_p)
{
if(!raptor_option_is_valid_for_area(option, options->area))
return 1;
if(raptor_option_value_is_numeric(option)) {
/* numeric options */
int value = options->options[(int)option].integer;
if(integer_p)
*integer_p = value;
} else {
/* non-numeric options */
char* string = options->options[(int)option].string;
if(string_p)
*string_p = string;
}
return 0;
}
| 0 |
linux | 77da160530dd1dc94f6ae15a981f24e5f0021e84 | NOT_APPLICABLE | NOT_APPLICABLE | void blk_register_region(dev_t devt, unsigned long range, struct module *module,
struct kobject *(*probe)(dev_t, int *, void *),
int (*lock)(dev_t, void *), void *data)
{
kobj_map(bdev_map, devt, range, module, probe, lock, data);
}
| 0 |
linux | bd97120fc3d1a11f3124c7c9ba1d91f51829eb85 | NOT_APPLICABLE | NOT_APPLICABLE | static int vhost_update_avail_event(struct vhost_virtqueue *vq, u16 avail_event)
{
if (__put_user(vq->avail_idx, vhost_avail_event(vq)))
return -EFAULT;
if (unlikely(vq->log_used)) {
void __user *used;
/* Make sure the event is seen before log. */
smp_wmb();
/* Log avail event write */
used = vhost_avail_event(vq);
log_write(vq->log_base, vq->log_addr +
(used - (void __user *)vq->used),
sizeof *vhost_avail_event(vq));
if (vq->log_ctx)
eventfd_signal(vq->log_ctx, 1);
}
return 0;
}
| 0 |
Chrome | 401d30ef93030afbf7e81e53a11b68fc36194502 | NOT_APPLICABLE | NOT_APPLICABLE | void Document::dispose()
{
ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun);
m_docType = 0;
m_focusedElement = 0;
m_hoverNode = 0;
m_activeElement = 0;
m_titleElement = 0;
m_documentElement = 0;
m_contextFeatures = ContextFeatures::defaultSwitch();
m_userActionElements.documentDidRemoveLastRef();
m_associatedFormControls.clear();
detachParser();
m_registrationContext.clear();
if (m_import) {
m_import->wasDetachedFromDocument();
m_import = 0;
}
destroyTreeScopeData();
removeDetachedChildren();
m_formController.clear();
m_markers->detach();
m_cssCanvasElements.clear();
if (m_scriptedAnimationController)
m_scriptedAnimationController->clearDocumentPointer();
m_scriptedAnimationController.clear();
if (svgExtensions())
accessSVGExtensions()->pauseAnimations();
m_lifecyle.advanceTo(DocumentLifecycle::Disposed);
lifecycleNotifier()->notifyDocumentWasDisposed();
}
| 0 |
Android | 89913d7df36dbeb458ce165856bd6505a2ec647d | NOT_APPLICABLE | NOT_APPLICABLE | OMX_ERRORTYPE omx_video::empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
OMX_ERRORTYPE ret1 = OMX_ErrorNone;
unsigned int nBufferIndex ;
DEBUG_PRINT_LOW("ETB: buffer = %p, buffer->pBuffer[%p]", buffer, buffer->pBuffer);
if (m_state == OMX_StateInvalid) {
DEBUG_PRINT_ERROR("ERROR: Empty this buffer in Invalid State");
return OMX_ErrorInvalidState;
}
if (buffer == NULL || (buffer->nSize != sizeof(OMX_BUFFERHEADERTYPE))) {
DEBUG_PRINT_ERROR("ERROR: omx_video::etb--> buffer is null or buffer size is invalid");
return OMX_ErrorBadParameter;
}
if (buffer->nVersion.nVersion != OMX_SPEC_VERSION) {
DEBUG_PRINT_ERROR("ERROR: omx_video::etb--> OMX Version Invalid");
return OMX_ErrorVersionMismatch;
}
if (buffer->nInputPortIndex != (OMX_U32)PORT_INDEX_IN) {
DEBUG_PRINT_ERROR("ERROR: Bad port index to call empty_this_buffer");
return OMX_ErrorBadPortIndex;
}
if (!m_sInPortDef.bEnabled) {
DEBUG_PRINT_ERROR("ERROR: Cannot call empty_this_buffer while I/P port is disabled");
return OMX_ErrorIncorrectStateOperation;
}
nBufferIndex = buffer - ((!meta_mode_enable)?m_inp_mem_ptr:meta_buffer_hdr);
if (nBufferIndex > m_sInPortDef.nBufferCountActual ) {
DEBUG_PRINT_ERROR("ERROR: ETB: Invalid buffer index[%d]", nBufferIndex);
return OMX_ErrorBadParameter;
}
m_etb_count++;
DEBUG_PRINT_LOW("DBG: i/p nTimestamp = %u", (unsigned)buffer->nTimeStamp);
post_event ((unsigned long)hComp,(unsigned long)buffer,m_input_msg_id);
return OMX_ErrorNone;
}
| 0 |
linux | b799207e1e1816b09e7a5920fbb2d5fcf6edd681 | NOT_APPLICABLE | NOT_APPLICABLE | static void __clear_all_pkt_pointers(struct bpf_verifier_env *env,
struct bpf_func_state *state)
{
struct bpf_reg_state *regs = state->regs, *reg;
int i;
for (i = 0; i < MAX_BPF_REG; i++)
if (reg_is_pkt_pointer_any(®s[i]))
mark_reg_unknown(env, regs, i);
for (i = 0; i < state->allocated_stack / BPF_REG_SIZE; i++) {
if (state->stack[i].slot_type[0] != STACK_SPILL)
continue;
reg = &state->stack[i].spilled_ptr;
if (reg_is_pkt_pointer_any(reg))
__mark_reg_unknown(reg);
}
}
| 0 |
nautilus | 1630f53481f445ada0a455e9979236d31a8d3bb0 | NOT_APPLICABLE | NOT_APPLICABLE | remove_callback_link_keep_data (NautilusDirectory *directory,
GList *link)
{
ReadyCallback *callback;
callback = link->data;
directory->details->call_when_ready_list = g_list_remove_link
(directory->details->call_when_ready_list, link);
request_counter_remove_request (directory->details->call_when_ready_counters,
callback->request);
g_list_free_1 (link);
}
| 0 |
radare2 | e9ce0d64faf19fa4e9c260250fbdf25e3c11e152 | NOT_APPLICABLE | NOT_APPLICABLE | R_API void r_bin_add_import(RBinJavaObj *bin, RBinJavaCPTypeObj *obj, const char *type) {
RBinImport *imp = R_NEW0 (RBinImport);
char *class_name = r_bin_java_get_name_from_bin_cp_list (bin, obj->info.cp_method.class_idx);
char *name = r_bin_java_get_name_from_bin_cp_list (bin, obj->info.cp_method.name_and_type_idx);
char *descriptor = r_bin_java_get_desc_from_bin_cp_list (bin, obj->info.cp_method.name_and_type_idx);
class_name = class_name ? class_name : strdup ("INVALID CLASS NAME INDEX");
name = name ? name : strdup ("InvalidNameIndex");
descriptor = descriptor ? descriptor : strdup ("INVALID DESCRIPTOR INDEX");
imp->classname = class_name;
imp->name = name;
imp->bind = r_str_const ("NONE");
imp->type = r_str_const (type);
imp->descriptor = descriptor;
imp->ordinal = obj->idx;
r_list_append (bin->imports_list, imp);
} | 0 |
Chrome | c442b3eda2f1fdd4d1d4864c34c43cbaf223acae | NOT_APPLICABLE | NOT_APPLICABLE | BrowserInit::LaunchWithProfile::LaunchWithProfile(
const FilePath& cur_dir,
const CommandLine& command_line,
IsFirstRun is_first_run)
: cur_dir_(cur_dir),
command_line_(command_line),
profile_(NULL),
browser_init_(NULL),
is_first_run_(is_first_run == IS_FIRST_RUN) {
}
| 0 |
kvm | 8b3c3104c3f4f706e99365c3e0d2aa61b95f969f | NOT_APPLICABLE | NOT_APPLICABLE | void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
struct kvm_memory_slot *slot)
{
kvm_mmu_invalidate_zap_all_pages(kvm);
} | 0 |
linux | b66c5984017533316fd1951770302649baf1aa33 | NOT_APPLICABLE | NOT_APPLICABLE | static struct inode *bm_get_inode(struct super_block *sb, int mode)
{
struct inode * inode = new_inode(sb);
if (inode) {
inode->i_ino = get_next_ino();
inode->i_mode = mode;
inode->i_atime = inode->i_mtime = inode->i_ctime =
current_fs_time(inode->i_sb);
}
return inode;
}
| 0 |
tcmu-runner | e2d953050766ac538615a811c64b34358614edce | NOT_APPLICABLE | NOT_APPLICABLE | static int dbus_handler_handle_cmd(struct tcmu_device *dev,
struct tcmulib_cmd *cmd)
{
abort();
}
| 0 |
linux | d0de4dc584ec6aa3b26fffea320a8457827768fc | NOT_APPLICABLE | NOT_APPLICABLE | static bool inotify_should_send_event(struct fsnotify_group *group, struct inode *inode,
struct fsnotify_mark *inode_mark,
struct fsnotify_mark *vfsmount_mark,
__u32 mask, void *data, int data_type)
{
if ((inode_mark->mask & FS_EXCL_UNLINK) &&
(data_type == FSNOTIFY_EVENT_PATH)) {
struct path *path = data;
if (d_unlinked(path->dentry))
return false;
}
return true;
}
| 0 |
date | 8f2d7a0c7e52cea8333824bd527822e5449ed83d | NOT_APPLICABLE | NOT_APPLICABLE | decode_day(VALUE d, VALUE *jd, VALUE *df, VALUE *sf)
{
VALUE f;
*jd = div_day(d, &f);
*df = div_df(f, &f);
*sf = sec_to_ns(f);
} | 0 |
Chrome | 12c876ae82355de6285bf0879023f1d1f1822ecf | NOT_APPLICABLE | NOT_APPLICABLE | void MediaStreamManager::AddLogMessageOnIOThread(const std::string& message) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
for (const auto& callback : log_callbacks_)
callback.second.Run(message);
}
| 0 |
tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | NOT_APPLICABLE | NOT_APPLICABLE | bool IsSupported(const NodeDef* node) const override {
return IsAnyMatMul(*node) && !IsInPreserveSet(*node);
} | 0 |
linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | NOT_APPLICABLE | NOT_APPLICABLE | static int selinux_kernel_module_request(char *kmod_name)
{
struct common_audit_data ad;
ad.type = LSM_AUDIT_DATA_KMOD;
ad.u.kmod_name = kmod_name;
return avc_has_perm(&selinux_state,
current_sid(), SECINITSID_KERNEL, SECCLASS_SYSTEM,
SYSTEM__MODULE_REQUEST, &ad);
} | 0 |
liblouis | fb2bfce4ed49ac4656a8f7e5b5526e4838da1dde | NOT_APPLICABLE | NOT_APPLICABLE | _lou_getTablePath() {
char searchPath[MAXSTRING];
char *path;
char *cp;
cp = searchPath;
path = getenv("LOUIS_TABLEPATH");
if (path != NULL && path[0] != '\0') cp += sprintf(cp, ",%s", path);
path = lou_getDataPath();
if (path != NULL && path[0] != '\0')
cp += sprintf(cp, ",%s%c%s%c%s", path, DIR_SEP, "liblouis", DIR_SEP, "tables");
#ifdef _WIN32
path = lou_getProgramPath();
if (path != NULL) {
if (path[0] != '\0')
cp += sprintf(cp, ",%s%s", path, "\\share\\liblouis\\tables");
free(path);
}
#else
cp += sprintf(cp, ",%s", TABLESDIR);
#endif
if (searchPath[0] != '\0')
return strdup(&searchPath[1]);
else
return strdup(".");
} | 0 |
linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | NOT_APPLICABLE | NOT_APPLICABLE | nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
int flags, struct nameidata *nd)
{
struct path path = {
.mnt = nd->path.mnt,
.dentry = dentry,
};
struct nfs4_state *state;
struct rpc_cred *cred;
fmode_t fmode = flags & (FMODE_READ | FMODE_WRITE);
int status = 0;
cred = rpc_lookup_cred();
if (IS_ERR(cred)) {
status = PTR_ERR(cred);
goto out;
}
state = nfs4_do_open(dir, &path, fmode, flags, sattr, cred);
d_drop(dentry);
if (IS_ERR(state)) {
status = PTR_ERR(state);
goto out_putcred;
}
d_add(dentry, igrab(state->inode));
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
if (flags & O_EXCL) {
struct nfs_fattr fattr;
status = nfs4_do_setattr(state->inode, cred, &fattr, sattr, state);
if (status == 0)
nfs_setattr_update_inode(state->inode, sattr);
nfs_post_op_update_inode(state->inode, &fattr);
}
if (status == 0 && (nd->flags & LOOKUP_OPEN) != 0)
status = nfs4_intent_set_file(nd, &path, state, fmode);
else
nfs4_close_sync(&path, state, fmode);
out_putcred:
put_rpccred(cred);
out:
return status;
}
| 0 |
git | f82a97eb9197c1e3768e72648f37ce0ca3233734 | NOT_APPLICABLE | NOT_APPLICABLE | static enum protocol get_protocol(const char *name)
{
if (!strcmp(name, "ssh"))
return PROTO_SSH;
if (!strcmp(name, "git"))
return PROTO_GIT;
if (!strcmp(name, "git+ssh")) /* deprecated - do not use */
return PROTO_SSH;
if (!strcmp(name, "ssh+git")) /* deprecated - do not use */
return PROTO_SSH;
if (!strcmp(name, "file"))
return PROTO_FILE;
die("I don't handle protocol '%s'", name);
} | 0 |
dcmtk | beaf5a5c24101daeeafa48c375120b16197c9e95 | NOT_APPLICABLE | NOT_APPLICABLE | DUL_BLOCKOPTIONS DcmSCP::getConnectionBlockingMode() const
{
return m_cfg->getConnectionBlockingMode();
} | 0 |
ImageMagick | 76f94fa2d9ae5d96e15929b6b6ce0c866fc44c69 | NOT_APPLICABLE | NOT_APPLICABLE | MagickPrivate VirtualPixelMethod SetPixelCacheVirtualMethod(Image *image,
const VirtualPixelMethod virtual_pixel_method,ExceptionInfo *exception)
{
CacheInfo
*magick_restrict cache_info;
VirtualPixelMethod
method;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(image->cache != (Cache) NULL);
cache_info=(CacheInfo *) image->cache;
assert(cache_info->signature == MagickCoreSignature);
method=cache_info->virtual_pixel_method;
cache_info->virtual_pixel_method=virtual_pixel_method;
if ((image->columns != 0) && (image->rows != 0))
switch (virtual_pixel_method)
{
case BackgroundVirtualPixelMethod:
{
if ((image->background_color.alpha_trait != UndefinedPixelTrait) &&
(image->alpha_trait == UndefinedPixelTrait))
(void) SetCacheAlphaChannel(image,OpaqueAlpha,exception);
if ((IsPixelInfoGray(&image->background_color) == MagickFalse) &&
(IsGrayColorspace(image->colorspace) != MagickFalse))
(void) SetImageColorspace(image,sRGBColorspace,exception);
break;
}
case TransparentVirtualPixelMethod:
{
if (image->alpha_trait == UndefinedPixelTrait)
(void) SetCacheAlphaChannel(image,OpaqueAlpha,exception);
break;
}
default:
break;
}
return(method);
} | 0 |
Chrome | ec14f31eca3a51f665432973552ee575635132b3 | NOT_APPLICABLE | NOT_APPLICABLE | Eina_Bool ewk_view_history_enable_get(const Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
return static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList())->enabled();
}
| 0 |
php-src | e5c95234d87fcb8f6b7569a96a89d1e1544749a6 | NOT_APPLICABLE | NOT_APPLICABLE | PHP_METHOD(Phar, getMetadata)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (Z_TYPE(phar_obj->archive->metadata) != IS_UNDEF) {
if (phar_obj->archive->is_persistent) {
char *buf = estrndup((char *) Z_PTR(phar_obj->archive->metadata), phar_obj->archive->metadata_len);
/* assume success, we would have failed before */
phar_parse_metadata(&buf, return_value, phar_obj->archive->metadata_len);
efree(buf);
} else {
ZVAL_COPY(return_value, &phar_obj->archive->metadata);
}
}
} | 0 |
linux | f2fcfcd670257236ebf2088bbdf26f6a8ef459fe | NOT_APPLICABLE | NOT_APPLICABLE | static void l2cap_sock_destruct(struct sock *sk)
{
BT_DBG("sk %p", sk);
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
}
| 0 |
linux | b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f | NOT_APPLICABLE | NOT_APPLICABLE | static void print_fatal_signal(int signr)
{
struct pt_regs *regs = signal_pt_regs();
printk(KERN_INFO "%s/%d: potentially unexpected fatal signal %d.\n",
current->comm, task_pid_nr(current), signr);
#if defined(__i386__) && !defined(__arch_um__)
printk(KERN_INFO "code at %08lx: ", regs->ip);
{
int i;
for (i = 0; i < 16; i++) {
unsigned char insn;
if (get_user(insn, (unsigned char *)(regs->ip + i)))
break;
printk(KERN_CONT "%02x ", insn);
}
}
printk(KERN_CONT "\n");
#endif
preempt_disable();
show_regs(regs);
preempt_enable();
}
| 0 |
tor | a0ef3cf0880e3cd343977b3fcbd0a2e7572f0cb4 | NOT_APPLICABLE | NOT_APPLICABLE | get_voter(const networkstatus_t *vote)
{
tor_assert(vote);
tor_assert(vote->type == NS_TYPE_VOTE);
tor_assert(vote->voters);
tor_assert(smartlist_len(vote->voters) == 1);
return smartlist_get(vote->voters, 0);
} | 0 |
haproxy-1.4 | dc80672211e085c211f1fc47e15cfe57ab587d38 | NOT_APPLICABLE | NOT_APPLICABLE | int apply_filter_to_req_line(struct session *t, struct buffer *req, struct hdr_exp *exp)
{
char term;
char *cur_ptr, *cur_end;
int done;
struct http_txn *txn = &t->txn;
int len, delta;
if (unlikely(txn->flags & (TX_CLDENY | TX_CLTARPIT)))
return 1;
else if (unlikely(txn->flags & TX_CLALLOW) &&
(exp->action == ACT_ALLOW ||
exp->action == ACT_DENY ||
exp->action == ACT_TARPIT))
return 0;
else if (exp->action == ACT_REMOVE)
return 0;
done = 0;
cur_ptr = txn->req.sol;
cur_end = cur_ptr + txn->req.sl.rq.l;
/* Now we have the request line between cur_ptr and cur_end */
/* The annoying part is that pattern matching needs
* that we modify the contents to null-terminate all
* strings before testing them.
*/
term = *cur_end;
*cur_end = '\0';
if (regexec(exp->preg, cur_ptr, MAX_MATCH, pmatch, 0) == 0) {
switch (exp->action) {
case ACT_SETBE:
/* It is not possible to jump a second time.
* FIXME: should we return an HTTP/500 here so that
* the admin knows there's a problem ?
*/
if (t->be != t->fe)
break;
/* Swithing Proxy */
session_set_backend(t, (struct proxy *)exp->replace);
done = 1;
break;
case ACT_ALLOW:
txn->flags |= TX_CLALLOW;
done = 1;
break;
case ACT_DENY:
txn->flags |= TX_CLDENY;
t->be->counters.denied_req++;
if (t->listener->counters)
t->listener->counters->denied_req++;
done = 1;
break;
case ACT_TARPIT:
txn->flags |= TX_CLTARPIT;
t->be->counters.denied_req++;
if (t->listener->counters)
t->listener->counters->denied_req++;
done = 1;
break;
case ACT_REPLACE:
*cur_end = term; /* restore the string terminator */
len = exp_replace(trash, cur_ptr, exp->replace, pmatch);
delta = buffer_replace2(req, cur_ptr, cur_end, trash, len);
/* FIXME: if the user adds a newline in the replacement, the
* index will not be recalculated for now, and the new line
* will not be counted as a new header.
*/
http_msg_move_end(&txn->req, delta);
cur_end += delta;
cur_end = (char *)http_parse_reqline(&txn->req, req->data,
HTTP_MSG_RQMETH,
cur_ptr, cur_end + 1,
NULL, NULL);
if (unlikely(!cur_end))
return -1;
/* we have a full request and we know that we have either a CR
* or an LF at <ptr>.
*/
txn->meth = find_http_meth(cur_ptr, txn->req.sl.rq.m_l);
hdr_idx_set_start(&txn->hdr_idx, txn->req.sl.rq.l, *cur_end == '\r');
/* there is no point trying this regex on headers */
return 1;
}
}
*cur_end = term; /* restore the string terminator */
return done;
} | 0 |
linux | e4f3aa2e1e67bb48dfbaaf1cad59013d5a5bc276 | NOT_APPLICABLE | NOT_APPLICABLE | static int cdrom_get_next_writable(struct cdrom_device_info *cdi,
long *next_writable)
{
disc_information di;
track_information ti;
__u16 last_track;
int ret, ti_size;
if (!CDROM_CAN(CDC_GENERIC_PACKET))
goto use_last_written;
ret = cdrom_get_disc_info(cdi, &di);
if (ret < 0 || ret < offsetof(typeof(di), last_track_lsb)
+ sizeof(di.last_track_lsb))
goto use_last_written;
/* if unit didn't return msb, it's zeroed by cdrom_get_disc_info */
last_track = (di.last_track_msb << 8) | di.last_track_lsb;
ti_size = cdrom_get_track_info(cdi, last_track, 1, &ti);
if (ti_size < 0 || ti_size < offsetof(typeof(ti), track_start))
goto use_last_written;
/* if this track is blank, try the previous. */
if (ti.blank) {
if (last_track == 1)
goto use_last_written;
last_track--;
ti_size = cdrom_get_track_info(cdi, last_track, 1, &ti);
if (ti_size < 0)
goto use_last_written;
}
/* if next recordable address field is valid, use it. */
if (ti.nwa_v && ti_size >= offsetof(typeof(ti), next_writable)
+ sizeof(ti.next_writable)) {
*next_writable = be32_to_cpu(ti.next_writable);
return 0;
}
use_last_written:
ret = cdrom_get_last_written(cdi, next_writable);
if (ret) {
*next_writable = 0;
return ret;
} else {
*next_writable += 7;
return 0;
}
}
| 0 |
ImageMagick | db1ffb6cf44bcfe5c4d5fcf9d9109ded5617387f | NOT_APPLICABLE | NOT_APPLICABLE | static inline void AssociateAlphaPixel(const CubeInfo *cube_info,
const PixelPacket *pixel,DoublePixelPacket *alpha_pixel)
{
MagickRealType
alpha;
alpha_pixel->index=0;
if ((cube_info->associate_alpha == MagickFalse) ||
(pixel->opacity == OpaqueOpacity))
{
alpha_pixel->red=(MagickRealType) GetPixelRed(pixel);
alpha_pixel->green=(MagickRealType) GetPixelGreen(pixel);
alpha_pixel->blue=(MagickRealType) GetPixelBlue(pixel);
alpha_pixel->opacity=(MagickRealType) GetPixelOpacity(pixel);
return;
}
alpha=(MagickRealType) (QuantumScale*(QuantumRange-GetPixelOpacity(pixel)));
alpha_pixel->red=alpha*GetPixelRed(pixel);
alpha_pixel->green=alpha*GetPixelGreen(pixel);
alpha_pixel->blue=alpha*GetPixelBlue(pixel);
alpha_pixel->opacity=(MagickRealType) GetPixelOpacity(pixel);
}
| 0 |
Chrome | a4150b688a754d3d10d2ca385155b1c95d77d6ae | NOT_APPLICABLE | NOT_APPLICABLE | void GLES2DecoderImpl::DoSetReadbackBufferShadowAllocationINTERNAL(
GLuint buffer_id,
GLuint shm_id,
GLuint shm_offset,
GLuint size) {
static const char kFunctionName[] = "glSetBufferShadowAllocationINTERNAL";
scoped_refptr<Buffer> buffer = buffer_manager()->GetBuffer(buffer_id);
if (!buffer) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, kFunctionName, "unknown buffer");
return;
}
if (static_cast<GLsizeiptr>(size) != buffer->size()) {
MarkContextLost(error::kGuilty);
group_->LoseContexts(error::kUnknown);
return;
}
scoped_refptr<gpu::Buffer> shm = GetSharedMemoryBuffer(shm_id);
buffer->SetReadbackShadowAllocation(shm, shm_offset);
writes_submitted_but_not_completed_.insert(buffer);
}
| 0 |
rdesktop | 766ebcf6f23ccfe8323ac10242ae6e127d4505d2 | NOT_APPLICABLE | NOT_APPLICABLE | rdp_out_bitmap_caps(STREAM s)
{
out_uint16_le(s, RDP_CAPSET_BITMAP);
out_uint16_le(s, RDP_CAPLEN_BITMAP);
out_uint16_le(s, g_server_depth); /* Preferred colour depth */
out_uint16_le(s, 1); /* Receive 1 BPP */
out_uint16_le(s, 1); /* Receive 4 BPP */
out_uint16_le(s, 1); /* Receive 8 BPP */
out_uint16_le(s, 800); /* Desktop width */
out_uint16_le(s, 600); /* Desktop height */
out_uint16(s, 0); /* Pad */
out_uint16(s, 1); /* Allow resize */
out_uint16_le(s, g_bitmap_compression ? 1 : 0); /* Support compression */
out_uint16(s, 0); /* Unknown */
out_uint16_le(s, 1); /* Unknown */
out_uint16(s, 0); /* Pad */
} | 0 |
libxml2 | 0bcd05c5cd83dec3406c8f68b769b1d610c72f76 | NOT_APPLICABLE | NOT_APPLICABLE | xmlCheckVersion(int version) {
int myversion = (int) LIBXML_VERSION;
xmlInitParser();
if ((myversion / 10000) != (version / 10000)) {
xmlGenericError(xmlGenericErrorContext,
"Fatal: program compiled against libxml %d using libxml %d\n",
(version / 10000), (myversion / 10000));
fprintf(stderr,
"Fatal: program compiled against libxml %d using libxml %d\n",
(version / 10000), (myversion / 10000));
}
if ((myversion / 100) < (version / 100)) {
xmlGenericError(xmlGenericErrorContext,
"Warning: program compiled against libxml %d using older %d\n",
(version / 100), (myversion / 100));
}
} | 0 |
xserver | 8a59e3b7dbb30532a7c3769c555e00d7c4301170 | NOT_APPLICABLE | NOT_APPLICABLE | OsVendorFatalError(const char *f, va_list args)
{
#ifdef VENDORSUPPORT
ErrorFSigSafe("\nPlease refer to your Operating System Vendor support "
"pages\nat %s for support on this crash.\n", VENDORSUPPORT);
#else
ErrorFSigSafe("\nPlease consult the " XVENDORNAME " support \n\t at "
__VENDORDWEBSUPPORT__ "\n for help. \n");
#endif
if (xf86LogFile && xf86LogFileWasOpened)
ErrorFSigSafe("Please also check the log file at \"%s\" for additional "
"information.\n", xf86LogFile);
ErrorFSigSafe("\n");
} | 0 |
linux | 1f1ea6c2d9d8c0be9ec56454b05315273b5de8ce | NOT_APPLICABLE | NOT_APPLICABLE | static size_t max_response_pages(struct nfs_server *server)
{
u32 max_resp_sz = server->nfs_client->cl_session->fc_attrs.max_resp_sz;
return nfs_page_array_len(0, max_resp_sz);
} | 0 |
poppler | 7b2d314a61fd0e12f47c62996cb49ec0d1ba747a | NOT_APPLICABLE | NOT_APPLICABLE | void GfxImageColorMap::getGray(Guchar *x, GfxGray *gray) {
GfxColor color;
int i;
if (colorSpace2) {
for (i = 0; i < nComps2; ++i) {
color.c[i] = lookup[i][x[0]];
}
colorSpace2->getGray(&color, gray);
} else {
for (i = 0; i < nComps; ++i) {
color.c[i] = lookup[i][x[i]];
}
colorSpace->getGray(&color, gray);
}
}
| 0 |
linux | a5598bd9c087dc0efc250a5221e5d0e6f584ee88 | NOT_APPLICABLE | NOT_APPLICABLE | static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio)
{
struct sock *sk;
struct iucv_sock *iucv;
sk = sk_alloc(&init_net, PF_IUCV, prio, &iucv_proto);
if (!sk)
return NULL;
iucv = iucv_sk(sk);
sock_init_data(sock, sk);
INIT_LIST_HEAD(&iucv->accept_q);
spin_lock_init(&iucv->accept_q_lock);
skb_queue_head_init(&iucv->send_skb_q);
INIT_LIST_HEAD(&iucv->message_q.list);
spin_lock_init(&iucv->message_q.lock);
skb_queue_head_init(&iucv->backlog_skb_q);
iucv->send_tag = 0;
atomic_set(&iucv->pendings, 0);
iucv->flags = 0;
iucv->msglimit = 0;
atomic_set(&iucv->msg_sent, 0);
atomic_set(&iucv->msg_recv, 0);
iucv->path = NULL;
iucv->sk_txnotify = afiucv_hs_callback_txnotify;
memset(&iucv->src_user_id , 0, 32);
if (pr_iucv)
iucv->transport = AF_IUCV_TRANS_IUCV;
else
iucv->transport = AF_IUCV_TRANS_HIPER;
sk->sk_destruct = iucv_sock_destruct;
sk->sk_sndtimeo = IUCV_CONN_TIMEOUT;
sk->sk_allocation = GFP_DMA;
sock_reset_flag(sk, SOCK_ZAPPED);
sk->sk_protocol = proto;
sk->sk_state = IUCV_OPEN;
iucv_sock_link(&iucv_sk_list, sk);
return sk;
}
| 0 |
libvirt | a4947e8f63c3e6b7b067b444f3d6cf674c0d7f36 | NOT_APPLICABLE | NOT_APPLICABLE | nwfilterConnectListAllNWFilters(virConnectPtr conn,
virNWFilterPtr **nwfilters,
unsigned int flags)
{
int ret;
virCheckFlags(0, -1);
if (virConnectListAllNWFiltersEnsureACL(conn) < 0)
return -1;
nwfilterDriverLock();
ret = virNWFilterObjListExport(conn, driver->nwfilters, nwfilters,
virConnectListAllNWFiltersCheckACL);
nwfilterDriverUnlock();
return ret;
} | 0 |
ioq3 | d2b1d124d4055c2fcbe5126863487c52fd58cca1 | CVE-2017-11721 | CWE-119 | static void send(node_t *node, node_t *child, byte *fout) {
if (node->parent) {
send(node->parent, node, fout);
}
if (child) {
if (node->right == child) {
add_bit(1, fout);
} else {
add_bit(0, fout);
}
}
}
| 1 |
linux-2.6 | ccec6e2c4a74adf76ed4e2478091a311b1806212 | NOT_APPLICABLE | NOT_APPLICABLE | static ssize_t snd_mem_proc_write(struct file *file, const char __user * buffer,
size_t count, loff_t * ppos)
{
char buf[128];
char *token, *p;
if (count > sizeof(buf) - 1)
return -EINVAL;
if (copy_from_user(buf, buffer, count))
return -EFAULT;
buf[count] = '\0';
p = buf;
token = gettoken(&p);
if (! token || *token == '#')
return count;
if (strcmp(token, "add") == 0) {
char *endp;
int vendor, device, size, buffers;
long mask;
int i, alloced;
struct pci_dev *pci;
if ((token = gettoken(&p)) == NULL ||
(vendor = simple_strtol(token, NULL, 0)) <= 0 ||
(token = gettoken(&p)) == NULL ||
(device = simple_strtol(token, NULL, 0)) <= 0 ||
(token = gettoken(&p)) == NULL ||
(mask = simple_strtol(token, NULL, 0)) < 0 ||
(token = gettoken(&p)) == NULL ||
(size = memparse(token, &endp)) < 64*1024 ||
size > 16*1024*1024 /* too big */ ||
(token = gettoken(&p)) == NULL ||
(buffers = simple_strtol(token, NULL, 0)) <= 0 ||
buffers > 4) {
printk(KERN_ERR "snd-page-alloc: invalid proc write format\n");
return count;
}
vendor &= 0xffff;
device &= 0xffff;
alloced = 0;
pci = NULL;
while ((pci = pci_get_device(vendor, device, pci)) != NULL) {
if (mask > 0 && mask < 0xffffffff) {
if (pci_set_dma_mask(pci, mask) < 0 ||
pci_set_consistent_dma_mask(pci, mask) < 0) {
printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", mask, vendor, device);
return count;
}
}
for (i = 0; i < buffers; i++) {
struct snd_dma_buffer dmab;
memset(&dmab, 0, sizeof(dmab));
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
size, &dmab) < 0) {
printk(KERN_ERR "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", size);
pci_dev_put(pci);
return count;
}
snd_dma_reserve_buf(&dmab, snd_dma_pci_buf_id(pci));
}
alloced++;
}
if (! alloced) {
for (i = 0; i < buffers; i++) {
struct snd_dma_buffer dmab;
memset(&dmab, 0, sizeof(dmab));
/* FIXME: We can allocate only in ZONE_DMA
* without a device pointer!
*/
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, NULL,
size, &dmab) < 0) {
printk(KERN_ERR "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", size);
break;
}
snd_dma_reserve_buf(&dmab, (unsigned int)((vendor << 16) | device));
}
}
} else if (strcmp(token, "erase") == 0)
/* FIXME: need for releasing each buffer chunk? */
free_all_reserved_pages();
else
printk(KERN_ERR "snd-page-alloc: invalid proc cmd\n");
return count;
} | 0 |
gnome-settings-daemon | be513b3c7d80d0b7013d79ce46d7eeca929705cc | NOT_APPLICABLE | NOT_APPLICABLE | print_countdown_text (TimeoutDialog *timeout)
{
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (timeout->dialog),
ngettext ("The display will be reset to its previous configuration in %d second",
"The display will be reset to its previous configuration in %d seconds",
timeout->countdown),
timeout->countdown);
} | 0 |
linux | 86acdca1b63e6890540fa19495cfc708beff3d8b | NOT_APPLICABLE | NOT_APPLICABLE | static ssize_t mem_read(struct file * file, char __user * buf,
size_t count, loff_t *ppos)
{
struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode);
char *page;
unsigned long src = *ppos;
int ret = -ESRCH;
struct mm_struct *mm;
if (!task)
goto out_no_task;
if (check_mem_permission(task))
goto out;
ret = -ENOMEM;
page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
goto out;
ret = 0;
mm = get_task_mm(task);
if (!mm)
goto out_free;
ret = -EIO;
if (file->private_data != (void*)((long)current->self_exec_id))
goto out_put;
ret = 0;
while (count > 0) {
int this_len, retval;
this_len = (count > PAGE_SIZE) ? PAGE_SIZE : count;
retval = access_process_vm(task, src, page, this_len, 0);
if (!retval || check_mem_permission(task)) {
if (!ret)
ret = -EIO;
break;
}
if (copy_to_user(buf, page, retval)) {
ret = -EFAULT;
break;
}
ret += retval;
src += retval;
buf += retval;
count -= retval;
}
*ppos = src;
out_put:
mmput(mm);
out_free:
free_page((unsigned long) page);
out:
put_task_struct(task);
out_no_task:
return ret;
}
| 0 |
Chrome | 8262245d384be025f13e2a5b3a03b7e5c98374ce | NOT_APPLICABLE | NOT_APPLICABLE | ChromeContentBrowserClient::GetCryptoPasswordDelegate(
const GURL& url) {
return browser::NewCryptoModuleBlockingDialogDelegate(
browser::kCryptoModulePasswordKeygen, url.host());
}
| 0 |
qemu | 3251bdcf1c67427d964517053c3d185b46e618e8 | NOT_APPLICABLE | NOT_APPLICABLE | static bool cmd_cfa_erase_sectors(IDEState *s, uint8_t cmd)
{
/* WIN_SECURITY_FREEZE_LOCK has the same ID as CFA_WEAR_LEVEL and is
* required for Windows 8 to work with AHCI */
if (cmd == CFA_WEAR_LEVEL) {
s->nsector = 0;
}
if (cmd == CFA_ERASE_SECTORS) {
s->media_changed = 1;
}
return true;
}
| 0 |
ghostscript | c501a58f8d5650c8ba21d447c0d6f07eafcb0f15 | NOT_APPLICABLE | NOT_APPLICABLE | static TT_F26Dot6 Norm( TT_F26Dot6 X, TT_F26Dot6 Y )
{
Int64 T1, T2;
MUL_64( X, X, T1 );
MUL_64( Y, Y, T2 );
ADD_64( T1, T2, T1 );
return (TT_F26Dot6)SQRT_64( T1 );
}
| 0 |
tensorflow | 8ee24e7949a203d234489f9da2c5bf45a7d5157d | NOT_APPLICABLE | NOT_APPLICABLE | inline int32_t Dims(int i) const {
TFLITE_DCHECK_GE(i, 0);
TFLITE_DCHECK_LT(i, size_);
return size_ > kMaxSmallSize ? dims_pointer_[i] : dims_[i];
} | 0 |
jasper | d42b2388f7f8e0332c846675133acea151fc557a | NOT_APPLICABLE | NOT_APPLICABLE | static int jas_iccputtime(jas_stream_t *out, jas_icctime_t *time)
{
jas_iccputuint16(out, time->year);
jas_iccputuint16(out, time->month);
jas_iccputuint16(out, time->day);
jas_iccputuint16(out, time->hour);
jas_iccputuint16(out, time->min);
jas_iccputuint16(out, time->sec);
return 0;
}
| 0 |
Android | 03a53d1c7765eeb3af0bc34c3dff02ada1953fbf | NOT_APPLICABLE | NOT_APPLICABLE | void InputDispatcher::KeyEntry::recycle() {
releaseInjectionState();
dispatchInProgress = false;
syntheticRepeat = false;
interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_UNKNOWN;
interceptKeyWakeupTime = 0;
}
| 0 |
httpd | 643f0fcf3b8ab09a68f0ecd2aa37aafeda3e63ef | NOT_APPLICABLE | NOT_APPLICABLE | static int lua_apr_date_parse_rfc(lua_State *L)
{
const char *input;
apr_time_t result;
luaL_checktype(L, 1, LUA_TSTRING);
input = lua_tostring(L, 1);
result = apr_date_parse_rfc(input);
if (result == 0)
return 0;
lua_pushnumber(L, (lua_Number)(result / APR_USEC_PER_SEC));
return 1;
}
| 0 |
linux | c3e2219216c92919a6bd1711f340f5faa98695e6 | NOT_APPLICABLE | NOT_APPLICABLE | static ssize_t queue_max_integrity_segments_show(struct request_queue *q, char *page)
{
return queue_var_show(q->limits.max_integrity_segments, (page));
} | 0 |
Chrome | befb46ae3385fa13975521e9a2281e35805b339e | NOT_APPLICABLE | NOT_APPLICABLE | void FrameLoader::open(CachedFrameBase& cachedFrame)
{
m_isComplete = false;
m_didCallImplicitClose = true;
KURL url = cachedFrame.url();
if (url.protocolInHTTPFamily() && !url.host().isEmpty() && url.path().isEmpty())
url.setPath("/");
m_URL = url;
m_workingURL = url;
started();
clear(true, true, cachedFrame.isMainFrame());
Document* document = cachedFrame.document();
ASSERT(document);
document->setInPageCache(false);
m_needsClear = true;
m_isComplete = false;
m_didCallImplicitClose = false;
m_outgoingReferrer = url.string();
FrameView* view = cachedFrame.view();
ASSERT(view);
view->setWasScrolledByUser(false);
if (m_frame->view())
view->setFrameRect(m_frame->view()->frameRect());
m_frame->setView(view);
m_frame->setDocument(document);
m_frame->setDOMWindow(cachedFrame.domWindow());
m_frame->domWindow()->setURL(document->url());
m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
m_decoder = document->decoder();
updateFirstPartyForCookies();
cachedFrame.restore();
}
| 0 |
php | 124fb22a13fafa3648e4e15b4f207c7096d8155e | NOT_APPLICABLE | NOT_APPLICABLE | PHP_FUNCTION(curl_setopt)
{
zval *zid, *zvalue;
zend_long options;
php_curl *ch;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &zid, &options, &zvalue) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (options <= 0 && options != CURLOPT_SAFE_UPLOAD) {
php_error_docref(NULL, E_WARNING, "Invalid curl configuration option");
RETURN_FALSE;
}
if (_php_curl_setopt(ch, options, zvalue) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
}
| 0 |
Chrome | 0660e08731fd42076d7242068e9eaed1482b14d5 | NOT_APPLICABLE | NOT_APPLICABLE | bool IsValidStateForWindowsCreateFunction(
const windows::Create::Params::CreateData* create_data) {
if (!create_data)
return true;
bool has_bound = create_data->left || create_data->top ||
create_data->width || create_data->height;
switch (create_data->state) {
case windows::WINDOW_STATE_MINIMIZED:
return !(create_data->focused && *create_data->focused) && !has_bound;
case windows::WINDOW_STATE_MAXIMIZED:
case windows::WINDOW_STATE_FULLSCREEN:
case windows::WINDOW_STATE_LOCKED_FULLSCREEN:
return !(create_data->focused && !*create_data->focused) && !has_bound;
case windows::WINDOW_STATE_NORMAL:
case windows::WINDOW_STATE_DOCKED:
case windows::WINDOW_STATE_NONE:
return true;
}
NOTREACHED();
return true;
}
| 0 |
php-src | 20ce2fe8e3c211a42fee05a461a5881be9a8790e?w=1 | NOT_APPLICABLE | NOT_APPLICABLE | PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER)
{
var_entries *orig_var_entries = (*var_hash)->last;
zend_long orig_used_slots = orig_var_entries ? orig_var_entries->used_slots : 0;
int result;
result = php_var_unserialize_internal(UNSERIALIZE_PASSTHRU);
if (!result) {
/* If the unserialization failed, mark all elements that have been added to var_hash
* as NULL. This will forbid their use by other unserialize() calls in the same
* unserialization context. */
var_entries *e = orig_var_entries;
zend_long s = orig_used_slots;
while (e) {
for (; s < e->used_slots; s++) {
e->data[s] = NULL;
}
e = e->next;
s = 0;
}
}
return result;
}
| 0 |
linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | NOT_APPLICABLE | NOT_APPLICABLE | static inline void scrub_stripe_index_and_offset(u64 logical, u64 map_type,
u64 *raid_map,
u64 mapped_length,
int nstripes, int mirror,
int *stripe_index,
u64 *stripe_offset)
{
int i;
if (map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
/* RAID5/6 */
for (i = 0; i < nstripes; i++) {
if (raid_map[i] == RAID6_Q_STRIPE ||
raid_map[i] == RAID5_P_STRIPE)
continue;
if (logical >= raid_map[i] &&
logical < raid_map[i] + mapped_length)
break;
}
*stripe_index = i;
*stripe_offset = logical - raid_map[i];
} else {
/* The other RAID type */
*stripe_index = mirror;
*stripe_offset = 0;
}
} | 0 |
linux | 49d31c2f389acfe83417083e1208422b4091cd9e | NOT_APPLICABLE | NOT_APPLICABLE | static enum d_walk_ret detach_and_collect(void *_data, struct dentry *dentry)
{
struct detach_data *data = _data;
if (d_mountpoint(dentry)) {
__dget_dlock(dentry);
data->mountpoint = dentry;
return D_WALK_QUIT;
}
return select_collect(&data->select, dentry);
}
| 0 |
Chrome | 2f19869af13bbfdcfd682a55c0d2c61c6e102475 | NOT_APPLICABLE | NOT_APPLICABLE | base::string16 AuthenticatorBlePowerOnManualSheetModel::GetStepDescription()
const {
return l10n_util::GetStringUTF16(
IDS_WEBAUTHN_BLUETOOTH_POWER_ON_MANUAL_DESCRIPTION);
}
| 0 |
LibRaw | d1975cb0e055d2bfe58c9d845c9a3e57c346a2f9 | NOT_APPLICABLE | NOT_APPLICABLE | void LibRaw::fixupArri()
{
struct alist_t
{
const char *a_model;
const char *a_software;
ushort a_width,a_height;
int a_black;
unsigned a_filters;
float a_aspect;
}
alist[] =
{
{"ALEXA65", "Alexa65 XT", 6560 ,3100, 256,0x49494949,1.f},
{"ALEXALF", "Alexa LF Plus W", 3840 ,2160, 256,0x49494949,1.0f },
{"ALEXALF", "Alexa LF Plus W", 4448 ,1856, 256,0x49494949,0.75f },
{"ALEXALF", "Alexa LF Plus W", 4448 ,3096, 256,0x49494949,1.f },
{"ALEXA", "Alexa Plus 4:3 SXT", 2880 ,1620, 256,0x61616161,.75f},
{"ALEXA", "Alexa Plus 4:3 SXT", 3168 ,1782, 256,0x61616161,0.75f},
{"ALEXA", "Alexa Plus 4:3 SXT", 3424 ,2202, 256,0x61616161,1.f},
{"ALEXA", "Alexa Plus 4:3 SXT", 2592 ,2160, 256,0x61616161,1.12f},
{"ALEXA", "Alexa Plus 4:3 XT", 2592 ,2160, 256,0x61616161,1.12f},
{"ALEXA", "Alexa Plus 4:3 XT", 2880 ,2160, 256,0x61616161,1.f},
{"ALEXA", "Alexa Plus 4:3 XT", 2880 ,1620, 256,0x61616161,0.75f},
{"ALEXA", "Alexa Plus 4:3 XT", 3424 ,2202, 256,0x61616161,1.f},
};
for(int i = 0; i < sizeof(alist)/sizeof(alist[0]); i++)
if(!strncasecmp(model,alist[i].a_model,strlen(alist[i].a_model)) && software
&& !strncasecmp(software,alist[i].a_software,strlen(alist[i].a_software))
&& width == alist[i].a_width && height == alist[i].a_height)
{
filters = alist[i].a_filters;
black = alist[i].a_black;
pixel_aspect = alist[i].a_aspect;
strcpy(model,software);
software[0]=0;
return;
}
} | 0 |
samba | 63d98ed90466295d0e946f79868d3d7aad6e7589 | NOT_APPLICABLE | NOT_APPLICABLE | _PUBLIC_ bool file_save(const char *fname, const void *packet, size_t length)
{
return file_save_mode(fname, packet, length, 0644);
} | 0 |
linux | b4487b93545214a9db8cbf32e86411677b0cca21 | NOT_APPLICABLE | NOT_APPLICABLE | static void nfs4_xdr_enc_setclientid(struct rpc_rqst *req,
struct xdr_stream *xdr,
const void *data)
{
const struct nfs4_setclientid *sc = data;
struct compound_hdr hdr = {
.nops = 0,
};
encode_compound_hdr(xdr, req, &hdr);
encode_setclientid(xdr, sc, &hdr);
encode_nops(&hdr);
} | 0 |
nasm | 3144e84add8b152cc7a71e44617ce6f21daa4ba3 | NOT_APPLICABLE | NOT_APPLICABLE | static Token *expand_mmac_params_range(MMacro *mac, Token *tline, Token ***last)
{
Token *t = tline, **tt, *tm, *head;
char *pos;
int fst, lst, j, i;
pos = strchr(tline->text, ':');
nasm_assert(pos);
lst = atoi(pos + 1);
fst = atoi(tline->text + 1);
/*
* only macros params are accounted so
* if someone passes %0 -- we reject such
* value(s)
*/
if (lst == 0 || fst == 0)
goto err;
/* the values should be sane */
if ((fst > (int)mac->nparam || fst < (-(int)mac->nparam)) ||
(lst > (int)mac->nparam || lst < (-(int)mac->nparam)))
goto err;
fst = fst < 0 ? fst + (int)mac->nparam + 1: fst;
lst = lst < 0 ? lst + (int)mac->nparam + 1: lst;
/* counted from zero */
fst--, lst--;
/*
* It will be at least one token. Note we
* need to scan params until separator, otherwise
* only first token will be passed.
*/
tm = mac->params[(fst + mac->rotate) % mac->nparam];
head = new_Token(NULL, tm->type, tm->text, 0);
tt = &head->next, tm = tm->next;
while (tok_isnt_(tm, ",")) {
t = new_Token(NULL, tm->type, tm->text, 0);
*tt = t, tt = &t->next, tm = tm->next;
}
if (fst < lst) {
for (i = fst + 1; i <= lst; i++) {
t = new_Token(NULL, TOK_OTHER, ",", 0);
*tt = t, tt = &t->next;
j = (i + mac->rotate) % mac->nparam;
tm = mac->params[j];
while (tok_isnt_(tm, ",")) {
t = new_Token(NULL, tm->type, tm->text, 0);
*tt = t, tt = &t->next, tm = tm->next;
}
}
} else {
for (i = fst - 1; i >= lst; i--) {
t = new_Token(NULL, TOK_OTHER, ",", 0);
*tt = t, tt = &t->next;
j = (i + mac->rotate) % mac->nparam;
tm = mac->params[j];
while (tok_isnt_(tm, ",")) {
t = new_Token(NULL, tm->type, tm->text, 0);
*tt = t, tt = &t->next, tm = tm->next;
}
}
}
*last = tt;
return head;
err:
nasm_error(ERR_NONFATAL, "`%%{%s}': macro parameters out of range",
&tline->text[1]);
return tline;
} | 0 |
Chrome | a7d715ae5b654d1f98669fd979a00282a7229044 | NOT_APPLICABLE | NOT_APPLICABLE | WebContentsImpl::GetRootBrowserAccessibilityManager() {
RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>(
ShowingInterstitialPage() ? GetInterstitialPage()->GetMainFrame()
: GetMainFrame());
return rfh ? rfh->browser_accessibility_manager() : nullptr;
}
| 0 |
OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | NOT_APPLICABLE | NOT_APPLICABLE | int sc_pkcs15emu_sc_hsm_get_public_key(struct sc_context *ctx, sc_cvc_t *cvc, struct sc_pkcs15_pubkey *pubkey)
{
if (cvc->publicPoint && cvc->publicPointlen) {
return sc_pkcs15emu_sc_hsm_get_ec_public_key(ctx, cvc, pubkey);
} else {
return sc_pkcs15emu_sc_hsm_get_rsa_public_key(ctx, cvc, pubkey);
}
} | 0 |
samba | 6093b2d815a00a577036fa001b47d7fc5514ad2c | NOT_APPLICABLE | NOT_APPLICABLE | static bool torture_winbind_struct_ping(struct torture_context *torture)
{
struct timeval tv = timeval_current();
int timelimit = torture_setting_int(torture, "timelimit", 5);
uint32_t total = 0;
torture_comment(torture,
"Running WINBINDD_PING (struct based) for %d seconds\n",
timelimit);
while (timeval_elapsed(&tv) < timelimit) {
DO_STRUCT_REQ_REP(WINBINDD_PING, NULL, NULL);
total++;
}
torture_comment(torture,
"%u (%.1f/s) WINBINDD_PING (struct based)\n",
total, total / timeval_elapsed(&tv));
return true;
} | 0 |
php-src | b7fa67742cd8d2b0ca0c0273b157f6ffee9ad6e2 | NOT_APPLICABLE | NOT_APPLICABLE | static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
long index;
HashTable *ht;
if (check_inherited && intern->fptr_offset_set) {
if (!offset) {
ALLOC_INIT_ZVAL(offset);
} else {
SEPARATE_ARG_IF_REF(offset);
}
zend_call_method_with_2_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_set, "offsetSet", NULL, offset, value);
zval_ptr_dtor(&offset);
return;
}
if (!offset) {
ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (ht->nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
}
Z_ADDREF_P(value);
zend_hash_next_index_insert(ht, (void**)&value, sizeof(void*), NULL);
return;
}
switch(Z_TYPE_P(offset)) {
case IS_STRING:
ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (ht->nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
}
Z_ADDREF_P(value);
zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
return;
case IS_DOUBLE:
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (ht->nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
}
if (offset->type == IS_DOUBLE) {
index = (long)Z_DVAL_P(offset);
} else {
index = Z_LVAL_P(offset);
}
Z_ADDREF_P(value);
zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), NULL);
return;
case IS_NULL:
ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
if (ht->nApplyCount > 0) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
return;
}
Z_ADDREF_P(value);
zend_hash_next_index_insert(ht, (void**)&value, sizeof(void*), NULL);
return;
default:
zend_error(E_WARNING, "Illegal offset type");
return;
}
} /* }}} */ | 0 |
ghostscript | 0edd3d6c634a577db261615a9dc2719bca7f6e01 | NOT_APPLICABLE | NOT_APPLICABLE | znoaccess(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
check_op(1);
if (r_has_type(op, t_dictionary)) {
ref *aop = dict_access_ref(op);
/* CPSI throws invalidaccess when seting noaccess to a readonly dictionary (CET 13-13-6) : */
if (!r_has_attrs(aop, a_write)) {
if (!r_has_attrs(aop, a_read) && !r_has_attrs(aop, a_execute)) {
/* Already noaccess - do nothing (CET 24-09-1). */
return 0;
}
return_error(gs_error_invalidaccess);
}
/* Don't allow removing read access to permanent dictionaries. */
if (dict_is_permanent_on_dstack(op))
return_error(gs_error_invalidaccess);
}
return access_check(i_ctx_p, 0, true);
}
| 0 |
exiv2 | c72d16f4c402a8acc2dfe06fe3d58bf6cf99069e | NOT_APPLICABLE | NOT_APPLICABLE | XmpData::iterator XmpData::end()
{
return xmpMetadata_.end();
} | 0 |
mruby | faa4eaf6803bd11669bc324b4c34e7162286bfa3 | NOT_APPLICABLE | NOT_APPLICABLE | mrb_define_class_method(mrb_state *mrb, struct RClass *c, const char *name, mrb_func_t func, mrb_aspec aspec)
{
mrb_define_singleton_method(mrb, (struct RObject*)c, name, func, aspec);
}
| 0 |
curl | 8c7ee9083d0d719d0a77ab20d9cc2ae84eeea7f3 | NOT_APPLICABLE | NOT_APPLICABLE | static curl_off_t vms_realfilesize(const char *name,
const struct_stat *stat_buf)
{
char buffer[8192];
curl_off_t count;
int ret_stat;
FILE * file;
/* !checksrc! disable FOPENMODE 1 */
file = fopen(name, "r"); /* VMS */
if(!file) {
return 0;
}
count = 0;
ret_stat = 1;
while(ret_stat > 0) {
ret_stat = fread(buffer, 1, sizeof(buffer), file);
if(ret_stat)
count += ret_stat;
}
fclose(file);
return count;
} | 0 |
pacemaker | 84ac07c | NOT_APPLICABLE | NOT_APPLICABLE | hash2metafield(gpointer key, gpointer value, gpointer user_data)
{
char *crm_name = NULL;
if (key == NULL || value == NULL) {
return;
} else if (((char *)key)[0] == '#') {
return;
} else if (strstr(key, ":")) {
return;
}
crm_name = crm_meta_name(key);
hash2field(crm_name, value, user_data);
free(crm_name);
}
| 0 |
server | 2e7891080667c59ac80f788eef4d59d447595772 | NOT_APPLICABLE | NOT_APPLICABLE | Item_hex_string(THD *thd): Item_hex_constant(thd) {} | 0 |
Chrome | 116d0963cadfbf55ef2ec3d13781987c4d80517a | CVE-2012-2891 | CWE-200 | void ChromeMockRenderThread::OnUpdatePrintSettings(
int document_cookie,
const base::DictionaryValue& job_settings,
PrintMsg_PrintPages_Params* params) {
std::string dummy_string;
int margins_type = 0;
if (!job_settings.GetBoolean(printing::kSettingLandscape, NULL) ||
!job_settings.GetBoolean(printing::kSettingCollate, NULL) ||
!job_settings.GetInteger(printing::kSettingColor, NULL) ||
!job_settings.GetBoolean(printing::kSettingPrintToPDF, NULL) ||
!job_settings.GetBoolean(printing::kIsFirstRequest, NULL) ||
!job_settings.GetString(printing::kSettingDeviceName, &dummy_string) ||
!job_settings.GetInteger(printing::kSettingDuplexMode, NULL) ||
!job_settings.GetInteger(printing::kSettingCopies, NULL) ||
!job_settings.GetString(printing::kPreviewUIAddr, &dummy_string) ||
!job_settings.GetInteger(printing::kPreviewRequestID, NULL) ||
!job_settings.GetInteger(printing::kSettingMarginsType, &margins_type)) {
return;
}
if (printer_.get()) {
const ListValue* page_range_array;
printing::PageRanges new_ranges;
if (job_settings.GetList(printing::kSettingPageRange, &page_range_array)) {
for (size_t index = 0; index < page_range_array->GetSize(); ++index) {
const base::DictionaryValue* dict;
if (!page_range_array->GetDictionary(index, &dict))
continue;
printing::PageRange range;
if (!dict->GetInteger(printing::kSettingPageRangeFrom, &range.from) ||
!dict->GetInteger(printing::kSettingPageRangeTo, &range.to)) {
continue;
}
range.from--;
range.to--;
new_ranges.push_back(range);
}
}
std::vector<int> pages(printing::PageRange::GetPages(new_ranges));
printer_->UpdateSettings(document_cookie, params, pages, margins_type);
}
}
| 1 |
CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | NOT_APPLICABLE | NOT_APPLICABLE | **/
CImg<T>& operator=(const char *const expression) {
const unsigned int omode = cimg::exception_mode();
cimg::exception_mode(0);
try {
_fill(expression,true,true,0,0,"operator=",0);
} catch (CImgException&) {
cimg::exception_mode(omode);
load(expression);
}
cimg::exception_mode(omode);
return *this; | 0 |
ImageMagick | aecd0ada163a4d6c769cec178955d5f3e9316f2f | NOT_APPLICABLE | NOT_APPLICABLE | MagickExport Image *GetImageMask(const Image *image,const PixelMask type,
ExceptionInfo *exception)
{
CacheView
*mask_view,
*image_view;
Image
*mask_image;
MagickBooleanType
status;
ssize_t
y;
/*
Get image mask.
*/
assert(image != (Image *) NULL);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(image->signature == MagickCoreSignature);
mask_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
if (mask_image == (Image *) NULL)
return((Image *) NULL);
status=MagickTrue;
mask_image->alpha_trait=UndefinedPixelTrait;
(void) SetImageColorspace(mask_image,GRAYColorspace,exception);
mask_image->read_mask=MagickFalse;
image_view=AcquireVirtualCacheView(image,exception);
mask_view=AcquireAuthenticCacheView(mask_image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
{
register const Quantum
*magick_restrict p;
register Quantum
*magick_restrict q;
register ssize_t
x;
if (status == MagickFalse)
continue;
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
q=GetCacheViewAuthenticPixels(mask_view,0,y,mask_image->columns,1,
exception);
if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
{
status=MagickFalse;
continue;
}
for (x=0; x < (ssize_t) image->columns; x++)
{
switch (type)
{
case WritePixelMask:
{
SetPixelGray(mask_image,GetPixelWriteMask(image,p),q);
break;
}
default:
{
SetPixelGray(mask_image,GetPixelReadMask(image,p),q);
break;
}
}
p+=GetPixelChannels(image);
q+=GetPixelChannels(mask_image);
}
if (SyncCacheViewAuthenticPixels(mask_view,exception) == MagickFalse)
status=MagickFalse;
}
mask_view=DestroyCacheView(mask_view);
image_view=DestroyCacheView(image_view);
if (status == MagickFalse)
mask_image=DestroyImage(mask_image);
return(mask_image);
}
| 0 |
openvpn | 1394192b210cb3c6624a7419bcf3ff966742e79b | NOT_APPLICABLE | NOT_APPLICABLE | ReturnLastError(HANDLE pipe, LPCWSTR func)
{
ReturnError(pipe, GetLastError(), func, 1, &exit_event);
}
| 0 |
gpac | 0a85029d694f992f3631e2f249e4999daee15cbf | NOT_APPLICABLE | NOT_APPLICABLE | GF_Err av1c_box_size(GF_Box *s) {
u32 i;
GF_AV1ConfigurationBox *ptr = (GF_AV1ConfigurationBox *)s;
if (!ptr->config) {
ptr->size = 0;
return GF_BAD_PARAM;
}
ptr->size += 4;
for (i = 0; i < gf_list_count(ptr->config->obu_array); ++i) {
GF_AV1_OBUArrayEntry *a = gf_list_get(ptr->config->obu_array, i);
ptr->size += a->obu_length;
}
return GF_OK;
} | 0 |
linux | 124d3b7041f9a0ca7c43a6293e1cae4576c32fd5 | NOT_APPLICABLE | NOT_APPLICABLE | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,
int tag, unsigned int nr_pages, struct page **pages)
{
unsigned int i;
unsigned int ret;
read_lock_irq(&mapping->tree_lock);
ret = radix_tree_gang_lookup_tag(&mapping->page_tree,
(void **)pages, *index, nr_pages, tag);
for (i = 0; i < ret; i++)
page_cache_get(pages[i]);
if (ret)
*index = pages[ret - 1]->index + 1;
read_unlock_irq(&mapping->tree_lock);
return ret;
}
| 0 |
ntopng | 01f47e04fd7c8d54399c9e465f823f0017069f8f | NOT_APPLICABLE | NOT_APPLICABLE | void lua_push_nil_table_entry(lua_State *L, const char *key) {
if(L) {
lua_pushstring(L, key);
lua_pushnil(L);
lua_settable(L, -3);
}
} | 0 |
tcpdump | aa5c6b710dfd8020d2c908d6b3bd41f1da719b3b | NOT_APPLICABLE | NOT_APPLICABLE | ldp_print(netdissect_options *ndo,
register const u_char *pptr, register u_int len)
{
u_int processed;
while (len > (sizeof(struct ldp_common_header) + sizeof(struct ldp_msg_header))) {
processed = ldp_pdu_print(ndo, pptr);
if (processed == 0)
return;
if (len < processed) {
ND_PRINT((ndo, " [remaining length %u < %u]", len, processed));
ND_PRINT((ndo, "%s", istr));
break;
}
len -= processed;
pptr += processed;
}
}
| 0 |
Chrome | a4150b688a754d3d10d2ca385155b1c95d77d6ae | NOT_APPLICABLE | NOT_APPLICABLE | void GLES2Implementation::DeleteRenderbuffersHelper(
GLsizei n,
const GLuint* renderbuffers) {
if (!GetIdHandler(SharedIdNamespaces::kRenderbuffers)
->FreeIds(this, n, renderbuffers,
&GLES2Implementation::DeleteRenderbuffersStub)) {
SetGLError(GL_INVALID_VALUE, "glDeleteRenderbuffers",
"id not created by this context.");
return;
}
for (GLsizei ii = 0; ii < n; ++ii) {
if (renderbuffers[ii] == bound_renderbuffer_) {
bound_renderbuffer_ = 0;
}
}
}
| 0 |
ImageMagick | 7b1cf5784b5bcd85aa9293ecf56769f68c037231 | NOT_APPLICABLE | NOT_APPLICABLE | MagickExport Image *TrimImage(const Image *image,ExceptionInfo *exception)
{
RectangleInfo
geometry;
assert(image != (const Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
geometry=GetImageBoundingBox(image,exception);
if ((geometry.width == 0) || (geometry.height == 0))
{
Image
*crop_image;
crop_image=CloneImage(image,1,1,MagickTrue,exception);
if (crop_image == (Image *) NULL)
return((Image *) NULL);
crop_image->background_color.alpha=(Quantum) TransparentAlpha;
crop_image->alpha_trait=BlendPixelTrait;
(void) SetImageBackgroundColor(crop_image,exception);
crop_image->page=image->page;
crop_image->page.x=(-1);
crop_image->page.y=(-1);
return(crop_image);
}
geometry.x+=image->page.x;
geometry.y+=image->page.y;
return(CropImage(image,&geometry,exception));
}
| 0 |
Chrome | e34e01b1b0987e418bc22e3ef1cf2e4ecaead264 | NOT_APPLICABLE | NOT_APPLICABLE | bool RendererSchedulerImpl::ShouldPrioritizeInputEvent(
const blink::WebInputEvent& web_input_event) {
if ((web_input_event.GetType() == blink::WebInputEvent::kMouseDown ||
web_input_event.GetType() == blink::WebInputEvent::kMouseMove) &&
(web_input_event.GetModifiers() &
blink::WebInputEvent::kLeftButtonDown)) {
return true;
}
if (blink::WebInputEvent::IsMouseEventType(web_input_event.GetType()) ||
blink::WebInputEvent::IsKeyboardEventType(web_input_event.GetType())) {
return false;
}
return true;
}
| 0 |
ImageMagick | 0417cea1b6d72f90bd4f1f573f91e42a8ba66a89 | NOT_APPLICABLE | NOT_APPLICABLE | MagickExport QuantizeInfo *DestroyQuantizeInfo(QuantizeInfo *quantize_info)
{
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(quantize_info != (QuantizeInfo *) NULL);
assert(quantize_info->signature == MagickCoreSignature);
quantize_info->signature=(~MagickCoreSignature);
quantize_info=(QuantizeInfo *) RelinquishMagickMemory(quantize_info);
return(quantize_info);
} | 0 |
savannah | 29c759284e305ec428703c9a5831d0b1fc3497ef | NOT_APPLICABLE | NOT_APPLICABLE | Ins_NEG( FT_Long* args )
{
args[0] = NEG_LONG( args[0] );
}
| 0 |
ImageMagick | 6ad5fc3c9b652eec27fc0b1a0817159f8547d5d9 | NOT_APPLICABLE | NOT_APPLICABLE | WandExport void DrawPolygon(DrawingWand *wand,
const size_t number_coordinates,const PointInfo *coordinates)
{
assert(wand != (DrawingWand *) NULL);
assert(wand->signature == MagickWandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
MVGAppendPointsCommand(wand,"polygon",number_coordinates,coordinates);
} | 0 |
libass | aa54e0b59200a994d50a346b5d7ac818ebcf2d4b | NOT_APPLICABLE | NOT_APPLICABLE | void ass_shaper_set_base_direction(ASS_Shaper *shaper, FriBidiParType dir)
{
shaper->base_direction = dir;
}
| 0 |
Chrome | a261ea1c56ef16fc0fc4af1e440feb302d577716 | CVE-2018-6123 | CWE-416 | FileReaderLoader::FileReaderLoader(ReadType read_type,
FileReaderLoaderClient* client)
: read_type_(read_type),
client_(client),
handle_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC),
binding_(this) {}
| 1 |
sysstat | a5c8abd4a481ee6e27a3acf00e6d9b0f023e20ed | NOT_APPLICABLE | NOT_APPLICABLE | void guess_sa_name(char *sa_dir, struct tm *rectime, int *sa_name)
{
char filename[MAX_FILE_LEN];
struct stat sb;
time_t sa_mtime;
long nsec;
/* Use saDD by default */
*sa_name = 0;
/* Look for saYYYYMMDD */
snprintf(filename, MAX_FILE_LEN,
"%s/sa%04d%02d%02d", sa_dir,
rectime->tm_year + 1900,
rectime->tm_mon + 1,
rectime->tm_mday);
filename[MAX_FILE_LEN - 1] = '\0';
if (stat(filename, &sb) < 0)
/* Cannot find or access saYYYYMMDD, so use saDD */
return;
sa_mtime = sb.st_mtime;
nsec = sb.st_mtim.tv_nsec;
/* Look for saDD */
snprintf(filename, MAX_FILE_LEN,
"%s/sa%02d", sa_dir,
rectime->tm_mday);
filename[MAX_FILE_LEN - 1] = '\0';
if (stat(filename, &sb) < 0) {
/* Cannot find or access saDD, so use saYYYYMMDD */
*sa_name = 1;
return;
}
if ((sa_mtime > sb.st_mtime) ||
((sa_mtime == sb.st_mtime) && (nsec > sb.st_mtim.tv_nsec))) {
/* saYYYYMMDD is more recent than saDD, so use it */
*sa_name = 1;
}
} | 0 |
Chrome | 9c90f2cec381a0460e3879eb8efd14bac4488dbe | NOT_APPLICABLE | NOT_APPLICABLE | void ClientControlledShellSurface::CommitPendingScale() {
if (pending_scale_ != scale_) {
gfx::Transform transform;
DCHECK_NE(pending_scale_, 0.0);
transform.Scale(1.0 / pending_scale_, 1.0 / pending_scale_);
host_window()->SetTransform(transform);
scale_ = pending_scale_;
}
}
| 0 |
qemu | 898ae90a44551d25b8e956fd87372d303c82fe68 | NOT_APPLICABLE | NOT_APPLICABLE | static int proxy_fsync(FsContext *ctx, int fid_type,
V9fsFidOpenState *fs, int datasync)
{
int fd;
if (fid_type == P9_FID_DIR) {
fd = dirfd(fs->dir.stream);
} else {
fd = fs->fd;
}
if (datasync) {
return qemu_fdatasync(fd);
} else {
return fsync(fd);
}
}
| 0 |
Subsets and Splits