code
string
target
int64
Scan this code to detect any possible vulnerabilities. static int vhdx_parse_metadata(BlockDriverState *bs, BDRVVHDXState *s) { int ret = 0; uint8_t *buffer; int offset = 0; uint32_t i = 0; VHDXMetadataTableEntry md_entry; buffer = qemu_blockalign(bs, VHDX_METADATA_TABLE_MAX_SIZE); ret = ...
1
Scrutinize this code to detect security risks. static errno_t sssctl_restore(bool force_start, bool force_restart) { errno_t ret; if (!sssctl_start_sssd(force_start)) { return ERR_SSSD_NOT_RUNNING; } if (sssctl_backup_file_exists(SSS_BACKUP_USER_OVERRIDES)) { ret = sssctl_run_command(...
1
Check and analyze this code for any security issues. static int asn1_decode_se_info(sc_context_t *ctx, const u8 *obj, size_t objlen, sc_pkcs15_sec_env_info_t ***se, size_t *num, int depth) { struct sc_pkcs15_sec_env_info **ses; const unsigned char *ptr = obj; size_t idx, ptrlen = objlen; int ret; ses =...
0
Scan this code to detect any possible vulnerabilities. long keyctl_keyring_unlink(key_serial_t id, key_serial_t ringid) { key_ref_t keyring_ref, key_ref; struct key *keyring, *key; long ret; keyring_ref = lookup_user_key(ringid, 0, KEY_NEED_WRITE); if (IS_ERR(keyring_ref)) { ret = PTR_ERR(keyring_ref); goto ...
0
Examine this code to see if it is at risk of exploitation. int bnxt_re_create_srq(struct ib_srq *ib_srq, struct ib_srq_init_attr *srq_init_attr, struct ib_udata *udata) { struct ib_pd *ib_pd = ib_srq->pd; struct bnxt_re_pd *pd = container_of(ib_pd, struct bnxt_re_pd, ib_pd); struct bnxt_re_dev *rd...
1
Analyze this code to uncover any security loopholes. uint64_t dataSize() const { return reservable_ - data_; }
0
Investigate whether this code has any weaknesses. asmlinkage void __sched schedule(void) { struct task_struct *prev, *next; unsigned long *switch_count; struct rq *rq; int cpu; need_resched: preempt_disable(); cpu = smp_processor_id(); rq = cpu_rq(cpu); rcu_note_context_switch(cpu); prev = rq->curr; releas...
1
Test and validate this code for security flaws. NOEXPORT char *engine_default(const char *list) { if(current_engine<0) return "No engine was defined"; if(!ENGINE_set_default_string(engines[current_engine], list)) { sslerror("ENGINE_set_default_string"); return "Failed to set engine as d...
0
Scrutinize this code to detect security risks. tgs_build_reply(krb5_context context, krb5_kdc_configuration *config, KDC_REQ *req, KDC_REQ_BODY *b, hdb_entry_ex *krbtgt, krb5_enctype krbtgt_etype, const krb5_keyblock *replykey, int rk_is_subkey, krb5_ticket *ticket, krb5_data *reply, const char *fr...
1
Scrutinize this code to detect security risks. int security_msg_queue_msgctl(struct msg_queue *msq, int cmd) { return security_ops->msg_queue_msgctl(msq, cmd); }
0
Investigate whether this code has any weaknesses. MagickExport Image *ShadowImage(const Image *image,const double alpha, const double sigma,const ssize_t x_offset,const ssize_t y_offset, ExceptionInfo *exception) { #define ShadowImageTag "Shadow/Image" CacheView *image_view; ChannelType channel_mask...
0
Review and verify if this code is vulnerable. TEST_CASE("Simple syntax test", "[general]") { parser parser(R"( ROOT <- _ _ <- ' ' )"); bool ret = parser; REQUIRE(ret == true); }
1
Examine this code to see if it is at risk of exploitation. pam_sm_authenticate (pam_handle_t * pamh, int flags, int argc, const char **argv) { int retval, rc; const char *user = NULL; const char *password = NULL; char otp[MAX_TOKEN_ID_LEN + TOKEN_OTP_LEN + 1] = { 0 }; char otp_id[MAX_TOKEN_ID_LEN + 1]...
1
Scan this code to detect any possible vulnerabilities. MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, const AlphaChannelOption alpha_type,ExceptionInfo *exception) { CacheView *image_view; MagickBooleanType status; ssize_t y; assert(image != (Image *) NULL); if (image->deb...
1
Look into this code to determine if it is secure. TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); if (type == kGenericOptimized) { optimized_ops::Floor(GetTensorSh...
1
Analyze this code to uncover any security loopholes. static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen, PKCS7_RECIP_INFO *ri, EVP_PKEY *pkey) { EVP_PKEY_CTX *pctx = NULL; unsigned char *ek = NULL; size_t eklen; int ret = -1; pctx = EVP_PKEY_CTX_new(pke...
1
Investigate whether this code has any weaknesses. check_selfref (name, value, flags) const char *name; const char *value; int flags; { char *t; if (STREQ (name, value)) return 1; #if defined (ARRAY_VARS) if (valid_array_reference (value, 0)) { t = array_variable_name (value, (int *...
1
Investigate whether this code has any weaknesses. static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC) { size_t idex; void *vptr; image_info_value *info_value; image_info_data *info_data; image_info_...
1
Evaluate this code to identify possible vulnerabilities. DeepScanLineInputFile::DeepScanLineInputFile(InputPartData* part) { _data = new Data(part->numThreads); _data->_deleteStream=false; _data->_streamData = part->mutex; _data->memoryMapped = _data->_streamData->is->isMemoryMapped(); _data-...
1
Evaluate this code to identify possible vulnerabilities. krb5_error_code ipadb_get_pwd_policy(krb5_context kcontext, char *name, osa_policy_ent_t *policy) { struct ipadb_context *ipactx; char *esc_name = NULL; char *src_filter = NULL; krb5_error_code kerr; LDAPM...
0
Assess this code for potential security weaknesses. static zend_bool php_auto_globals_create_files(const char *name, uint name_len TSRMLS_DC) { zval *vars; if (PG(http_globals)[TRACK_VARS_FILES]) { vars = PG(http_globals)[TRACK_VARS_FILES]; } else { ALLOC_ZVAL(vars); array_init(vars); INIT_PZVAL(vars); P...
1
Audit this code for any potential security threats. void Compute(OpKernelContext* ctx) override { auto value = ctx->input(0); auto update = ctx->input(1); OP_REQUIRES( ctx, value.dims() == update.dims(), errors::InvalidArgument("value and update shape doesn't match: ", ...
1
Audit this code for any potential security threats. char *compose_path(ctrl_t *ctrl, char *path) { struct stat st; static char rpath[PATH_MAX]; char *name, *ptr; char dir[PATH_MAX] = { 0 }; strlcpy(dir, ctrl->cwd, sizeof(dir)); DBG("Compose path from cwd: %s, arg: %s", ctrl->cwd, path ?: ""); if (!path || !str...
1
Check and analyze this code for any security issues. Status ValidateInputTypeAndPlacement( EagerContext* ctx, EagerOperation* op, const core::RefCountPtr<KernelAndDevice>& kernel) { profiler::TraceMe activity("ValidateInputTypeAndPlacement", profiler::TraceMeLevel::kInfo); cons...
0
Scrutinize this code to detect security risks. BGD_DECLARE(gdImagePtr) gdImageCreateTrueColor (int sx, int sy) { int i; gdImagePtr im; if (overflow2(sx, sy)) { return NULL; } if (overflow2(sizeof (int *), sy)) { return 0; } if (overflow2(sizeof(int *), sx)) { return NULL; } im = (gdImage *) gdMalloc...
1
Check and analyze this code for any security issues. static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) { struct sock *sk = sock->sk; struct rose_sock *rose = rose_sk(sk); struct sockaddr_rose *addr = (struct sockaddr_rose *)uaddr; struct net_device *dev; ax25_address *source; ax25_u...
0
Examine this code to see if it is at risk of exploitation. updateDevice(const struct header * headers, time_t t) { struct device ** pp = &devlist; struct device * p = *pp; /* = devlist; */ while(p) { if( p->headers[HEADER_NT].l == headers[HEADER_NT].l && (0==memcmp(p->headers[HEADER_NT].p, headers[HEADER_NT...
1
Test and validate this code for security flaws. const VersionDef* versions() const override { return versions_; }
1
Review and verify if this code is vulnerable. p11_rpc_buffer_get_byte_value (p11_buffer *buffer, size_t *offset, void *value, CK_ULONG *value_length) { unsigned char val; if (!p11_rpc_buffer_get_byte (buffer, offset, &val)) return false; if (value) { CK_BYTE byte_value = val; m...
0
Test and validate this code for security flaws. */ static void mysql_prune_stmt_list(MYSQL *mysql) { LIST *element= mysql->stmts; LIST *pruned_list= 0; for (; element; element= element->next) { MYSQL_STMT *stmt= (MYSQL_STMT *) element->data; if (stmt->state != MYSQL_STMT_INIT_DONE) { stmt->m...
1
Evaluate this code to identify possible vulnerabilities. int selinux_netlbl_skbuff_getsid(struct sk_buff *skb, u16 family, u32 *type, u32 *sid) { int rc; struct netlbl_lsm_secattr secattr; if (!netlbl_enabled()) { *sid = SECSID_NULL; return 0; } netlbl_secattr_init(&secattr); rc = netlbl_skb...
0
Scan this code to detect any possible vulnerabilities. png_decompress_chunk(png_structrp png_ptr, png_uint_32 chunklength, png_uint_32 prefix_size, png_alloc_size_t *newlength /* must be initialized to the maximum! */, int terminate /*add a '\0' to the end of the uncompressed data*/) { /* TODO: implement d...
0
Evaluate this code to identify possible vulnerabilities. static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up) { struct v4l2_clip __user *kclips = kp->clips; struct v4l2_clip32 __user *uclips; u32 n = kp->clipcount; compat_caddr_t p; if (copy_to_user(&up->w, &kp->w, sizeof(kp->w))...
1
Scrutinize this code to detect security risks. static void t1_check_unusual_charstring(void) { char *p = strstr(t1_line_array, charstringname) + strlen(charstringname); int i; /*tex If no number follows |/CharStrings|, let's read the next line. */ if (sscanf(p, "%i", &i) != 1) { strcpy(t1_buf_a...
1
Look into this code to determine if it is secure. QUtil::string_to_int(char const* str) { errno = 0; long long_val = strtol(str, 0, 10); if (errno == ERANGE) { throw std::runtime_error( std::string("overflow/underflow converting ") + str + " to long integer"); } ...
0
Perform a security check on this code. PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) { long i; var_entries *var_hash = (*var_hashx)->first; #if VAR_ENTRIES_DBG fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif while (var...
1
Review and verify if this code is vulnerable. void Compute(OpKernelContext* ctx) override { Buffer* buf = nullptr; OP_REQUIRES_OK(ctx, GetBuffer(ctx, def(), &buf)); core::ScopedUnref scope(buf); buf->Clear(); }
0
Check and analyze this code for any security issues. static GF_Err gf_isom_svc_mvc_config_new(GF_ISOFile *the_file, u32 trackNumber, GF_AVCConfig *cfg, Bool is_mvc, char *URLname, char *URNname, u32 *outDescriptionIndex) { GF_TrackBox *trak; GF_Err e; u32 dataRefIndex; GF_SampleDescriptionBox *stsd; GF_MPEGVisual...
0
Analyze this code to uncover any security loopholes. ppm_load_read_header(FILE *fp, pnm_struct *img) { /* PPM Headers Variable Declaration */ gchar *ptr; //gchar *retval; gchar header[MAX_CHARS_IN_ROW]; gint maxval; int channel_count; /* Check the PPM file ...
1
Look into this code to determine if it is secure. static void chase_port(struct edgeport_port *port, unsigned long timeout, int flush) { int baud_rate; struct tty_struct *tty = tty_port_tty_get(&port->port->port); struct usb_serial *serial = port->port->serial; wait_queue_t wait; unsigned long flags; if...
1
Scan this code to detect any possible vulnerabilities. static void xen_netbk_idx_release(struct xen_netbk *netbk, u16 pending_idx) { struct xenvif *vif; struct pending_tx_info *pending_tx_info; pending_ring_idx_t index; /* Already complete? */ if (netbk->mmap_pages[pending_idx] == NULL) return; pending_tx_in...
1
Assess this code for potential security weaknesses. handle_client_state_waiting_for_data (DBusAuth *auth, DBusAuthCommand command, const DBusString *args) { _dbus_assert (auth->mech != NULL); switch (command) { case DBU...
0
Analyze this code to uncover any security loopholes. bool Item_func_interval::fix_length_and_dec() { uint rows= row->cols(); use_decimal_comparison= ((row->element_index(0)->result_type() == DECIMAL_RESULT) || (row->element_index(0)->result_type() == ...
0
Examine and determine whether this code contains vulnerabilities. static int brcmf_cfg80211_del_ap_iface(struct wiphy *wiphy, struct wireless_dev *wdev) { struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct net_device *ndev = wdev->netdev; struct brcmf_if *ifp = netdev_priv(ndev); int ret; in...
0
Review and verify if this code is vulnerable. nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_release_lockowner *rlockowner) { DECODE_HEAD; if (argp->minorversion >= 1) return nfserr_notsupp; READ_BUF(12); COPYMEM(&rlockowner->rl_clientid, sizeof(clientid_t)); rlockowner->rl_owner...
0
Scan this code to detect any possible vulnerabilities. int fd_cloexec(int fd, bool cloexec) { int oflags, nflags; oflags = fcntl(fd, F_GETFD, 0); if (oflags < 0) return -errno; if (cloexec) nflags = oflags | FD_CLOEXEC; else nflags = oflags & ~FD_CLOEXEC; if (nflags == oflags) return 0; if (fcntl(fd...
0
Scrutinize this code to detect security risks. bgp_capability_msg_parse (struct peer *peer, u_char *pnt, bgp_size_t length) { u_char *end; struct capability cap; u_char action; struct bgp *bgp; afi_t afi; safi_t safi; bgp = peer->bgp; end = pnt + length; while (pnt < end) { /* We need at ...
1
Check and analyze this code for any security issues. SPL_METHOD(DirectoryIterator, seek) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); zval retval; zend_long pos; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &pos) == FAILURE) { return; } if (intern->u.dir.index > pos) { /* we first ...
0
Audit this code for any potential security threats. static bool nested_vmx_exit_handled_io(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) { unsigned long exit_qualification; gpa_t bitmap, last_bitmap; unsigned int port; int size; u8 b; if (!nested_cpu_has(vmcs12, CPU_BASED_USE_IO_BITMAPS)) return ne...
0
Audit this code for any potential security threats. dump_digest(char *msg, u_char *digest, int len) { fprintf(stderr, "%s\n", msg); sshbuf_dump_data(digest, len, stderr); }
0
Inspect this code to see if it has any security flaws. l2tp_proxy_auth_type_print(netdissect_options *ndo, const u_char *dat) { const uint16_t *ptr = (const uint16_t *)dat; ND_PRINT((ndo, "%s", tok2str(l2tp_authentype2str, "AuthType-#%u", EXTRACT_16BITS(ptr)))); }
1
Check and analyze this code for any security issues. impl_permission_manager_test (EphyPermissionManager *manager, const char *host, const char *type) { g_return_val_if_fail (type != NULL && type[0] != '\0', EPHY_PERMISSION_DEFAULT); return (EphyPermissi...
0
Evaluate this code to identify possible vulnerabilities. SPL_METHOD(Array, current) { zval *object = getThis(); spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); zval **entry; HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); if (zend_parse_parameters_no...
1
Inspect this code to see if it has any security flaws. MagickExport int LocaleUppercase(const int c) { if (c < 0) return(c); #if defined(MAGICKCORE_LOCALE_SUPPORT) if (c_locale != (locale_t) NULL) return(toupper_l((int) ((unsigned char) c),c_locale)); #endif return(toupper((int) ((unsigned char) c))); }
1
Examine this code to see if it is at risk of exploitation. TEST_F(HttpConnectionManagerImplTest, ConnectLegacy) { TestScopedRuntime scoped_runtime; Runtime::LoaderSingleton::getExisting()->mergeValues( {{"envoy.reloadable_features.stop_faking_paths", "false"}}); setup(false, "envoy-custom-server", false);...
0
Review and verify if this code is vulnerable. int quicklistPushTail(quicklist *quicklist, void *value, size_t sz) { quicklistNode *orig_tail = quicklist->tail; if (likely( _quicklistNodeAllowInsert(quicklist->tail, quicklist->fill, sz))) { quicklist->tail->zl = ziplistPush(quick...
1
Scan this code to detect any possible vulnerabilities. GF_Err saiz_Size(GF_Box *s) { GF_SampleAuxiliaryInfoSizeBox *ptr = (GF_SampleAuxiliaryInfoSizeBox*)s; if (ptr->aux_info_type || ptr->aux_info_type_parameter) { ptr->flags |= 1; } if (ptr->flags & 1) ptr->size += 8; ptr->size += 5; if (ptr->default_sample_...
0
Examine this code to see if it is at risk of exploitation. void * calloc(size_t n, size_t lb) { if (lb && n > SIZE_MAX / lb) return NULL; # if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */ /* libpthread allocated some memory that is only pointed to by */ /* mmapped th...
1
Evaluate this code to identify possible vulnerabilities. read_unsigned64(const char *str, uint64_t *res, uint64_t min_val, uint64_t max_val, bool ignore_error) { return read_unsigned64_func(str, 10, res, min_val, max_val, ignore_error); }
0
Scan this code to detect any possible vulnerabilities. struct crypto_pcomp *crypto_alloc_pcomp(const char *alg_name, u32 type, u32 mask) { return crypto_alloc_tfm(alg_name, &crypto_pcomp_type, type, mask); }
0
Test and validate this code for security flaws. base64_flush(TScreen *screen) { Char x; TRACE(("base64_flush count %d, pad %d (%d)\n", screen->base64_count, screen->base64_pad, screen->base64_pad & 3)); switch (screen->base64_count) { case 0: break; case 2: x = CharOf(base64_code[sc...
0
Check and analyze this code for any security issues. static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb) { BlockRequest *blkreq; uint64_t sector; sector = ldq_p(&req->out->sector); trace_virtio_blk_handle_write(req, sector, req->qiov.size / 512); if (sector & req->dev->...
1
Analyze this code to uncover any security loopholes. CryptRsaDecrypt( TPM2B *dOut, // OUT: the decrypted data TPM2B *cIn, // IN: the data to decrypt OBJECT *key, // IN: the key to use for decryption TPMT_RSA_DECRYPT *scheme, // IN:...
1
Evaluate this code to identify possible vulnerabilities. TEST_F(HttpConnectionManagerImplTest, RequestTimeoutDisabledByDefault) { setup(false, ""); EXPECT_CALL(*codec_, dispatch(_)).WillOnce(Invoke([&](Buffer::Instance&) -> Http::Status { EXPECT_CALL(filter_callbacks_.connection_.dispatcher_, createTimer_).Ti...
0
Investigate whether this code has any weaknesses. SetForeWindow(wi) struct win *wi; { struct win *p; if (display == 0) { fore = wi; return; } p = Layer2Window(D_forecv->c_layer); SetCanvasWindow(D_forecv, wi); if (p) WindowChanged(p, 'u'); if (wi) WindowChanged(wi, 'u'); flaye...
0
Perform a security check on this code. check_entry_size_and_hooks(struct ip6t_entry *e, struct xt_table_info *newinfo, const unsigned char *base, const unsigned char *limit, const unsigned int *hook_entries, const unsigned int *underflows, unsigned int valid_hooks) { unsigned int h...
1
Investigate whether this code has any weaknesses. static int set_geometry(unsigned int cmd, struct floppy_struct *g, int drive, int type, struct block_device *bdev) { int cnt; /* sanity checking for parameters. */ if (g->sect <= 0 || g->head <= 0 || g->track <= 0 || g->track > UDP->tracks >> ST...
1
Inspect this code to see if it has any security flaws. long SSL_SESSION_get_time(const SSL_SESSION *s) { if (s == NULL) return (0); return (s->time); }
0
Evaluate this code to identify possible vulnerabilities. static void tx3g_print_char_offsets(FILE * trace, u32 start, u32 end, u32 *shift_offset, u32 so_count) { u32 i; if (shift_offset) { for (i=0; i<so_count; i++) { if (start>shift_offset[i]) { start --; break; } } for (i=0; i<so_count; i++) { ...
0
Inspect this code to see if it has any security flaws. long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, size_t len, unsigned int flags) { struct splice_desc sd = { .len = len, .total_len = len, .flags = flags, .pos = *ppos, .u.file = out, }; long ret; ret = splice_direc...
0
Perform a security check on this code. static const char *md_config_set_ca(cmd_parms *cmd, void *dc, const char *value) { md_srv_conf_t *sc = md_config_get(cmd->server); const char *err; (void)dc; if (!inside_md_section(cmd) && (err = ap_check_cmd_context(cmd, GLOBAL_ONLY))) { return err; ...
0
Inspect this code to see if it has any security flaws. _PUBLIC_ NTSTATUS ldap_decode(struct asn1_data *data, const struct ldap_control_handler *control_handlers, struct ldap_message *msg) { uint8_t tag; asn1_start_tag(data, ASN1_SEQUENCE(0)); asn1_read_Integer(data, &msg->messageid); if (!asn1_...
1
Check and analyze this code for any security issues. int vnc_zrle_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) { vs->zrle.type = VNC_ENCODING_ZRLE; return zrle_send_framebuffer_update(vs, x, y, w, h); }
1
Analyze this code to uncover any security loopholes. static int io_sq_offload_start(struct io_ring_ctx *ctx, struct io_uring_params *p) { int ret; if (ctx->flags & IORING_SETUP_SQPOLL) { ret = -EPERM; if (!capable(CAP_SYS_ADMIN)) goto err; ctx->sq_thread_idle = msecs_to_jiffies(p->sq_thread_idle...
1
Check and analyze this code for any security issues. GC_INNER char *GC_parse_map_entry(char *buf_ptr, ptr_t *start, ptr_t *end, char **prot, unsigned int *maj_dev, char **mapping_name) { unsigned char *start_start, *end_start, *maj_dev_start...
0
Evaluate this code to identify possible vulnerabilities. shell_gtk_embed_on_window_mapped (GtkWidget *object, ShellGtkEmbed *embed) { ShellGtkEmbedPrivate *priv = shell_gtk_embed_get_instance_private (embed); MetaDisplay *display = shell_global_get_display (shell_global_get ()...
1
Analyze this code to uncover any security loopholes. static struct pid *good_sigevent(sigevent_t * event) { struct task_struct *rtn = current->group_leader; if ((event->sigev_notify & SIGEV_THREAD_ID ) && (!(rtn = find_task_by_vpid(event->sigev_notify_thread_id)) || !same_thread_group(rtn, current) || (even...
1
Check and analyze this code for any security issues. compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct mpt_fw_xfer32 kfw32; struct mpt_fw_xfer kfw; MPT_ADAPTER *iocp = NULL; int iocnum, iocnumX; int nonblock = (filp->f_flags & O_NONBLOCK); int ret; if (copy_from_user(&...
0
Look into this code to determine if it is secure. cmp_addr_policies(smartlist_t *a, smartlist_t *b) { int r, i; int len_a = a ? smartlist_len(a) : 0; int len_b = b ? smartlist_len(b) : 0; for (i = 0; i < len_a && i < len_b; ++i) { if ((r = cmp_single_addr_policy(smartlist_get(a, i), smartlist_get(b, i))))...
1
Examine and determine whether this code contains vulnerabilities. static void ssl_reset_sock_state(pj_ssl_sock_t *ssock) { ossl_sock_t *ossock = (ossl_sock_t *)ssock; /** * Avoid calling SSL_shutdown() if handshake wasn't completed. * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an ...
1
Analyze this code to uncover any security loopholes. read_yin_leaflist(struct lys_module *module, struct lys_node *parent, struct lyxml_elem *yin, int options, struct unres_schema *unres) { struct ly_ctx *ctx = module->ctx; struct lys_node *retval; struct lys_node_leaflist *llist; str...
1
Analyze this code to uncover any security loopholes. static void bnx2x_reset_common(struct bnx2x *bp) { u32 val = 0x1400; /* reset_common */ REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, 0xd3ffff7f); if (CHIP_IS_E3(bp)) { val |= MISC_REGISTERS_RESET_REG_2_MSTAT0; val |= MISC_REGISTERS_R...
0
Audit this code for any potential security threats. sonmp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis, struct lldpd_port **newport) { const u_int8_t mcastaddr[] = SONMP_MULTICAST_ADDR; struct lldpd_chassis *chassis; struct lldpd_port *port...
1
Evaluate this code to identify possible vulnerabilities. static pj_status_t avi_get_frame(pjmedia_port *this_port, pjmedia_frame *frame) { struct avi_reader_port *fport = (struct avi_reader_port*)this_port; pj_status_t status = PJ_SUCCESS; pj_ssize_t size_read = 0, size_to_read = 0; pj_as...
1
Check and analyze this code for any security issues. int tls1_cbc_remove_padding(const SSL* s, SSL3_RECORD *rec, unsigned block_size, unsigned mac_size) { unsigned padding_length, good, to_check, i; const char has_explicit_iv = s->version >= TLS1_1_VERSION || s->version == DTLS1_VERSION; con...
1
Evaluate this code to identify possible vulnerabilities. static bool allowed_problem_dir(const char *dir_name) { //HACK HACK HACK! Disabled for now until we fix clients (abrt-gui) to not pass /home/user/.cache/abrt/spool #if 0 unsigned len = strlen(g_settings_dump_location); /* If doesn't start with "g_settin...
1
Inspect this code to see if it has any security flaws. nv_vreplace(cmdarg_T *cap) { if (VIsual_active) { cap->cmdchar = 'r'; cap->nchar = cap->extra_char; nv_replace(cap); // Do same as "r" in Visual mode for now } else if (!checkclearopq(cap->oap)) { if (!curbuf->b_p_ma) emsg(_(e_cannot_m...
0
Evaluate this code to identify possible vulnerabilities. void IRC_Analyzer::Done() { tcp::TCP_ApplicationAnalyzer::Done(); }
0
Check and analyze this code for any security issues. int jas_stream_gobble(jas_stream_t *stream, int n) { int m; if (n < 0) { jas_deprecated("negative count for jas_stream_gobble"); } m = n; for (m = n; m > 0; --m) { if (jas_stream_getc(stream) == EOF) { return n - m; } } return n; }
0
Analyze this code to uncover any security loopholes. static void lo_mkdir(fuse_req_t req, fuse_ino_t parent, const char *name, mode_t mode) { lo_mknod_symlink(req, parent, name, S_IFDIR | mode, 0, NULL); }
0
Look into this code to determine if it is secure. TEE_Result syscall_hash_update(unsigned long state, const void *chunk, size_t chunk_size) { TEE_Result res; struct tee_cryp_state *cs; struct tee_ta_session *sess; /* No data, but size provided isn't valid parameters. */ if (!chunk && chunk_size) return TEE_...
1
Review and verify if this code is vulnerable. static int descriptor_modify(struct ldb_module *module, struct ldb_request *req) { struct ldb_context *ldb = ldb_module_get_ctx(module); struct ldb_request *mod_req; struct ldb_message *msg; struct ldb_result *current_res, *parent_res; const struct ldb_val *old_sd = N...
1
Investigate whether this code has any weaknesses. SQLWCHAR* _single_string_alloc_and_expand( LPCSTR in ) { SQLWCHAR *chr; int len = 0; if ( !in ) { return in; } while ( in[ len ] != 0 ) { len ++; } chr = malloc( sizeof( SQLWCHAR ) * ( len + 1 )); len = 0; ...
1
Scrutinize this code to detect security risks. rb_iter_head_event(struct ring_buffer_iter *iter) { struct ring_buffer_event *event; struct buffer_page *iter_head_page = iter->head_page; unsigned long commit; unsigned length; if (iter->head != iter->next_event) return iter->event; /* * When the writer goes ...
0
Evaluate this code to identify possible vulnerabilities. formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form) { Buffer save; char *p; int spos, epos, rows, c_rows, pos, col = 0; Line *l; copyBuffer(&save, buf); gotoLine(buf, a->start.line); switch (form->type) { case FORM_TEXTA...
1
Audit this code for any potential security threats. static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */ { zval *id; xmlDoc *docp = NULL, *newdoc; dom_object *intern; dom_doc_propsptr doc_prop; char *source; int source_len, refcount, ret; long options = 0; htmlParserCtxtPtr ctxt; id =...
1
Test and validate this code for security flaws. static int cms_copy_content(BIO *out, BIO *in, unsigned int flags) { unsigned char buf[4096]; int r = 0, i; BIO *tmpout = NULL; if (out == NULL) tmpout = BIO_new(BIO_s_null()); else if (flags & CMS_TEXT) { tmpout = BIO_new(BIO_s_mem()); BIO_set_mem_eof_ret...
1
Scan this code to detect any possible vulnerabilities. void ElectronBrowserHandlerImpl::WebContentsDestroyed() { delete this; }
1
Investigate whether this code has any weaknesses. MagickExport MagickBooleanType ModulateImage(Image *image,const char *modulate, ExceptionInfo *exception) { #define ModulateImageTag "Modulate/Image" CacheView *image_view; ColorspaceType colorspace; const char *artifact; double percent_b...
0
Assess this code for potential security weaknesses. void PackLinuxElf64::unpack(OutputFile *fo) { if (e_phoff != sizeof(Elf64_Ehdr)) {// Phdrs not contiguous with Ehdr throwCantUnpack("bad e_phoff"); } unsigned const c_phnum = get_te16(&ehdri.e_phnum); upx_uint64_t old_data_off = 0; upx_uin...
1