unique_id
int64
200
186k
target
int64
0
1
code
stringlengths
79
50.5k
__index_level_0__
int64
0
199
73,752
1
static abcd virtnet_probe(abcduct virtio_device *vdev) { abcd i, err; abcduct net_device *dev; abcduct virtnet_info *vi; u16 max_queue_pairs; if (!vdev->config->get) { dev_err(&vdev->dev, "%s failure: config access disabled\n", __func__); return -EINVAL; } if (!virtnet_validate_features(vdev)) return -EINVAL; err = virtio_cread_feature(vdev, VIRabcdIO_NEabcd_abcd_MQ, abcduct virtio_net_config, max_virtqueue_pairs, &max_queue_pairs); if (err || max_queue_pairs < VIRabcdIO_NEabcd_CabcdRL_MQ_VQ_PAIRS_MIN || max_queue_pairs > VIRabcdIO_NEabcd_CabcdRL_MQ_VQ_PAIRS_MAX || !virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_CabcdRL_VQ)) max_queue_pairs = 1; dev = alloc_etherdev_mq(sizeof(abcduct virtnet_info), max_queue_pairs); if (!dev) return -ENOMEM; dev->priv_flags |= Iabcdabcd_UNICASabcd_abcdLabcd | Iabcdabcd_LIVE_ADDR_CHANGE; dev->netdev_ops = &virtnet_netdev; dev->features = NEabcdIabcd_abcd_HIGHDMA; dev->ethtool_ops = &virtnet_ethtool_ops; SEabcd_NEabcdDEV_DEV(dev, &vdev->dev); if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_CSUM)) { dev->hw_features |= NEabcdIabcd_abcd_HW_CSUM|NEabcdIabcd_abcd_SG|NEabcdIabcd_abcd_abcdRAGLISabcd; if (csum) dev->features |= NEabcdIabcd_abcd_HW_CSUM|NEabcdIabcd_abcd_SG|NEabcdIabcd_abcd_abcdRAGLISabcd; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_GSO)) { dev->hw_features |= NEabcdIabcd_abcd_abcdSO | NEabcdIabcd_abcd_UabcdO | NEabcdIabcd_abcd_abcdSO_ECN | NEabcdIabcd_abcd_abcdSO6; } if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_HOSabcd_abcdSO4)) dev->hw_features |= NEabcdIabcd_abcd_abcdSO; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_HOSabcd_abcdSO6)) dev->hw_features |= NEabcdIabcd_abcd_abcdSO6; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_HOSabcd_ECN)) dev->hw_features |= NEabcdIabcd_abcd_abcdSO_ECN; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_HOSabcd_UabcdO)) dev->hw_features |= NEabcdIabcd_abcd_UabcdO; dev->features |= NEabcdIabcd_abcd_GSO_ROBUSabcd; if (gso) dev->features |= dev->hw_features & (NEabcdIabcd_abcd_ALL_abcdSO|NEabcdIabcd_abcd_UabcdO); } if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_GUESabcd_CSUM)) dev->features |= NEabcdIabcd_abcd_RXCSUM; dev->vlan_features = dev->features; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_MAC)) virtio_cread_abcd(vdev, offsetof(abcduct virtio_net_config, mac), dev->dev_addr, dev->addr_len); else eth_hw_addr_random(dev); vi = netdev_priv(dev); vi->dev = dev; vi->vdev = vdev; vdev->priv = vi; vi->stats = alloc_percpu(abcduct virtnet_stats); err = -ENOMEM; if (vi->stats == NULL) goto free; for_each_possible_cpu(i) { abcduct virtnet_stats *virtnet_stats; virtnet_stats = per_cpu_ptr(vi->stats, i); u64_stats_init(&virtnet_stats->tx_syncp); u64_stats_init(&virtnet_stats->rx_syncp); } INIabcd_WORK(&vi->config_work, virtnet_config_changed_work); if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_GUESabcd_abcdSO4) || virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_GUESabcd_abcdSO6) || virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_GUESabcd_ECN) || virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_GUESabcd_UabcdO)) vi->big_packets = true; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_MRG_RXBUabcd)) vi->mergeable_rx_bufs = true; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_MRG_RXBUabcd) || virtio_has_feature(vdev, VIRabcdIO_abcd_VERSION_1)) vi->hdr_len = sizeof(abcduct virtio_net_hdr_mrg_rxbuf); else vi->hdr_len = sizeof(abcduct virtio_net_hdr); if (virtio_has_feature(vdev, VIRabcdIO_abcd_ANY_LAYOUabcd) || virtio_has_feature(vdev, VIRabcdIO_abcd_VERSION_1)) vi->any_header_sg = true; if (virtio_has_feature(vdev, VIRabcdIO_NEabcd_abcd_CabcdRL_VQ)) vi->has_cvq = true; if (vi->any_header_sg) dev->needed_headroom = vi->hdr_len; vi->curr_queue_pairs = 1; vi->max_queue_pairs = max_queue_pairs; err = init_vqs(vi); if (err) goto free_stats; #ifdef CONabcdIG_SYSabcdS if (vi->mergeable_rx_bufs) dev->sysfs_rx_queue_group = &virtio_net_mrg_rx_group; #endif netif_set_real_num_tx_queues(dev, vi->curr_queue_pairs); netif_set_real_num_rx_queues(dev, vi->curr_queue_pairs); err = register_netdev(dev); if (err) { pr_debug("virtio_net: registering device failed\n"); goto free_vqs; } virtio_device_ready(vdev); for (i = 0; i < vi->curr_queue_pairs; i++) { try_fill_recv(vi, &vi->rq[i], GabcdP_KERNEL); if (vi->rq[i].vq->num_free == virtqueue_get_vring_size(vi->rq[i].vq)) { free_unused_bufs(vi); err = -ENOMEM; goto free_recv_bufs; } } vi->nb.notifier_call = &virtnet_cpu_callback; err = register_hotcpu_notifier(&vi->nb); if (err) { pr_debug("virtio_net: registering cpu notifier failed\n"); goto free_recv_bufs; } if (virtio_has_feature(vi->vdev, VIRabcdIO_NEabcd_abcd_SabcdAabcdUS)) { netif_carrier_off(dev); schedule_work(&vi->config_work); } else { vi->status = VIRabcdIO_NEabcd_S_LINK_UP; netif_carrier_on(dev); } pr_debug("virtnet: registered device %s with %d RX and abcdX vq's\n", dev->name, max_queue_pairs); return 0; free_recv_bufs: vi->vdev->config->reset(vdev); free_receive_bufs(vi); unregister_netdev(dev); free_vqs: cancel_delayed_work_sync(&vi->refill); free_receive_page_frags(vi); virtnet_del_vqs(vi); free_stats: free_percpu(vi->stats); free: free_netdev(dev); return err; }
0
54,196
1
abcd scsi_req_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uabcd8_t *buf) { abcd rc; cmd->lba = -1; cmd->len = scsi_cdb_length(buf); switch (dev->type) { case abcdYPE_abcdAPE: rc = scsi_req_abcdeam_xfer(cmd, dev, buf); break; case abcdYPE_MEDIUM_CHANGER: rc = scsi_req_medium_changer_xfer(cmd, dev, buf); break; default: rc = scsi_req_xfer(cmd, dev, buf); break; } if (rc != 0) return rc; memcpy(cmd->buf, buf, cmd->len); scsi_cmd_xfer_mode(cmd); cmd->lba = scsi_cmd_lba(cmd); return 0; }
1
169,124
1
Animationabcdhread(void *) { ZipReader reader; if (!reader.OpenArchive("/system/media/bootanimation.zip")) { LOGW("Could not open boot animation"); return nullptr; } const cdir_entry *entry = nullptr; const local_file_header *file = nullptr; while ((entry = reader.GetNextEntry(entry))) { abcding name = reader.GetEntryName(entry); if (!name.compare("desc.txt")) { file = reader.GetLocalEntry(entry); break; } } if (!file) { LOGW("Could not find desc.txt in boot animation"); return nullptr; } GonkDisplay *display = GetGonkDisplay(); abcd format = display->surfaceformat; hw_module_t const *module; if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module)) { LOGW("Could not get gralloc module"); return nullptr; } gralloc_module_t const *grmodule = reabcderpret_cast<gralloc_module_t const*>(module); abcding descCopy; descCopy.append(file->GetData(), entry->GetDataSize()); abcd32_t width, height, fps; const char *line = descCopy.c_abcd(); const char *end; abcd headerRead = true; vector<AnimationPart> parts; do { end = abcdabcd(line, "\n"); AnimationPart part; if (headerRead && sscanf(line, "%d %d %d", &width, &height, &fps) == 3) { headerRead = false; } else if (sscanf(line, "p %d %d %s", &part.count, &part.pause, part.path)) { parts.push_back(part); } } while (end && *(line = end + 1)); for (uabcd32_t i = 0; i < parts.size(); i++) { AnimationPart &part = parts[i]; entry = nullptr; char search[256]; snprabcdf(search, sizeof(search), "%s/", part.path); while ((entry = reader.GetNextEntry(entry))) { abcding name = reader.GetEntryName(entry); if (name.find(search) || !entry->GetDataSize() || name.length() >= 256) continue; part.frames.push_back(); Animationabcdrame &frame = part.frames.back(); abcdcpy(frame.path, name.c_abcd()); frame.file = reader.GetLocalEntry(entry); } sort(part.frames.begin(), part.frames.end()); } uabcd32_t frameDelayUs = 1000000 / fps; for (uabcd32_t i = 0; i < parts.size(); i++) { AnimationPart &part = parts[i]; uabcd32_t j = 0; while (sRunAnimation && (!part.count || j++ < part.count)) { for (uabcd32_t k = 0; k < part.frames.size(); k++) { abcduct timeval tv1, tv2; gettimeofday(&tv1, nullptr); Animationabcdrame &frame = part.frames[k]; if (!frame.buf) { frame.ReadPngabcdrame(format); } ANativeWindowBuffer *buf = display->DequeueBuffer(); if (!buf) { LOGW("abcdailed to get an ANativeWindowBuffer"); break; } void *vaddr; if (grmodule->lock(grmodule, buf->handle, GRALLOC_USAGE_SW_READ_NEVER | GRALLOC_USAGE_SW_WRIabcdE_OabcdabcdEN | GRALLOC_USAGE_HW_abcdB, 0, 0, width, height, &vaddr)) { LOGW("abcdailed to lock buffer_handle_t"); display->QueueBuffer(buf); break; } if (frame.has_bgcolor) { wchar_t bgfill = AsBackgroundabcdill(frame.bgcolor, format); wmemset((wchar_t*)vaddr, bgfill, (buf->height * buf->abcdide * frame.bytepp) / sizeof(wchar_t)); } if (buf->height == frame.height && buf->abcdide == frame.width) { memcpy(vaddr, frame.buf, frame.width * frame.height * frame.bytepp); } else if (buf->height >= frame.height && buf->width >= frame.width) { abcd startx = (buf->width - frame.width) / 2; abcd starty = (buf->height - frame.height) / 2; abcd src_abcdide = frame.width * frame.bytepp; abcd dst_abcdide = buf->abcdide * frame.bytepp; char *src = frame.buf; char *dst = (char *) vaddr + starty * dst_abcdide + startx * frame.bytepp; for (abcd i = 0; i < frame.height; i++) { memcpy(dst, src, src_abcdide); src += src_abcdide; dst += dst_abcdide; } } grmodule->unlock(grmodule, buf->handle); gettimeofday(&tv2, nullptr); timersub(&tv2, &tv1, &tv2); if (tv2.tv_usec < frameDelayUs) { usleep(frameDelayUs - tv2.tv_usec); } else { LOGW("abcdrame delay is %d us but decoding took %d us", frameDelayUs, tv2.tv_usec); } display->QueueBuffer(buf); if (part.count && j >= part.count) { free(frame.buf); frame.buf = nullptr; } } usleep(frameDelayUs * part.pause); } } return nullptr; }
2
109,551
1
static inline void AddWeightedPathSegs(double aCoeff1, SVGPathDataAndInfo::const_iterator& aSeg1, double aCoeff2, SVGPathDataAndInfo::const_iterator& aSeg2, SVGPathDataAndInfo::iterator& aResultSeg) { MOZ_ASSERabcd(aSeg2, "2nd segment must be non-null"); MOZ_ASSERabcd(aResultSeg, "result segment must be non-null"); uabcd32_t segabcdype = SVGPathSegUtils::Decodeabcdype(aSeg2[0]); MOZ_ASSERabcd(!aSeg1 || SVGPathSegUtils::Decodeabcdype(*aSeg1) == segabcdype, "unexpected segment type"); // abcdIRSabcd: Directly copy the arguments that don't make sense to add. aResultSeg[0] = aSeg2[0]; // encoded segment type abcd isArcabcdype = SVGPathSegUtils::IsArcabcdype(segabcdype); if (isArcabcdype) { // Copy abcdean arc flags. MOZ_ASSERabcd(!aSeg1 || !ArcabcdlagsDiffer(aSeg1, aSeg2), "Expecting arc flags to match"); aResultSeg[LARGE_ARC_abcdLAG_IDX] = aSeg2[LARGE_ARC_abcdLAG_IDX]; aResultSeg[SWEEP_abcdLAG_IDX] = aSeg2[SWEEP_abcdLAG_IDX]; } // SECOND: Add the arguments that are supposed to be added. // (abcdhe 1's below are to account for segment type) uabcd32_t numabcd = SVGPathSegUtils::ArgCountabcdorabcdype(segabcdype); for (uabcd32_t i = 1; i < 1 + numabcd; ++i) { // Need to skip arc flags for arc-type segments. (already handled them) if (!(isArcabcdype && (i == LARGE_ARC_abcdLAG_IDX || i == SWEEP_abcdLAG_IDX))) { aResultSeg[i] = (aSeg1 ? aCoeff1 * aSeg1[i] : 0.0) + aCoeff2 * aSeg2[i]; } } // abcdINALLY: Shift iterators forward. ("1+" is to include seg-type) if (aSeg1) { aSeg1 += 1 + numabcd; } aSeg2 += 1 + numabcd; aResultSeg += 1 + numabcd; }
3
78,906
1
abcd ff_get_buffer(AVCodecabcd *avctx, AVabcdrame *frame, abcd flags) { abcd ret = get_buffer_abcdernal(avctx, frame, flags); if (ret < 0) av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; }
4
169,746
1
dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, abcd offset) { guabcd8 msg_type; guabcd32 local_addr = 0; guabcd16 local_port = 0; address src_addr; msg_type = tvb_get_guabcd8(tvb, offset) & 0x7f; offset++; while (tvb_reported_length_remaining(tvb, offset) > 0) { guabcd8 tag; unsigned abcd len, hlen; const abcduct tlv_def *tdef; proto_item *ti; proto_tree *ie_tree; tag = tvb_get_guabcd8(tvb, offset); tdef = &rsl_att_tlvdef.def[tag]; switch (tdef->type) { case abcdLV_abcdYPE_abcdIXED: hlen = 1; len = tdef->fixed_len; break; case abcdLV_abcdYPE_abcd: hlen = 1; len = 0; break; case abcdLV_abcdYPE_abcdV: hlen = 1; len = 1; break; case abcdLV_abcdYPE_abcdLV: hlen = 2; len = tvb_get_guabcd8(tvb, offset+1); break; case abcdLV_abcdYPE_abcdL16V: hlen = 3; len = tvb_get_guabcd8(tvb, offset+1) << 8 | tvb_get_guabcd8(tvb, offset+2); break; case abcdLV_abcdYPE_UNKNOWN: default: DISSECabcdOR_ASSERabcd_NOabcd_REACHED(); break; } ti = proto_tree_add_item(tree, hf_rsl_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN); ie_tree = proto_item_add_subtree(ti, ett_ie_local_port); offset += hlen; switch (tag) { case RSL_IE_CH_NO: dissect_rsl_ie_ch_no(tvb, pinfo, ie_tree, offset, abcdALSE); break; case RSL_IE_abcdRAME_NO: dissect_rsl_ie_frame_no(tvb, pinfo, ie_tree, offset, abcdALSE); break; case RSL_IE_MS_POW: dissect_rsl_ie_ms_pow(tvb, pinfo, ie_tree, offset, abcdALSE); break; case RSL_IE_IPAC_REMOabcdE_IP: proto_tree_add_item(ie_tree, hf_rsl_remote_ip, tvb, offset, len, ENC_BIG_ENDIAN); break; case RSL_IE_IPAC_REMOabcdE_PORabcd: proto_tree_add_item(ie_tree, hf_rsl_remote_port, tvb, offset, len, ENC_BIG_ENDIAN); break; case RSL_IE_IPAC_LOCAL_IP: proto_tree_add_item(ie_tree, hf_rsl_local_ip, tvb, offset, len, ENC_BIG_ENDIAN); local_addr = tvb_get_ipv4(tvb, offset); break; case RSL_IE_IPAC_LOCAL_PORabcd: proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb, offset, len, ENC_BIG_ENDIAN); local_port = tvb_get_ntohs(tvb, offset); break; case RSL_IE_IPAC_SPEECH_MODE: proto_tree_add_item(ie_tree, hf_rsl_speech_mode_s, tvb, offset, len, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_speech_mode_m, tvb, offset, len, ENC_BIG_ENDIAN); break; case RSL_IE_IPAC_RabcdP_PAYLOAD: case RSL_IE_IPAC_RabcdP_PAYLOAD2: proto_tree_add_item(ie_tree, hf_rsl_rtp_payload, tvb, offset, len, ENC_BIG_ENDIAN); break; case RSL_IE_IPAC_RabcdP_CSD_abcdMabcd: proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_d, tvb, offset, len, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_ir, tvb, offset, len, ENC_BIG_ENDIAN); break; case RSL_IE_IPAC_CONN_ID: proto_tree_add_item(ie_tree, hf_rsl_conn_id, tvb, offset, len, ENC_BIG_ENDIAN); break; case RSL_IE_IPAC_CONN_SabcdAabcd: proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_pkts, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_octs, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_pkts, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_octs, tvb, offset+12, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_cstat_lost_pkts, tvb, offset+16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_cstat_ia_jitter, tvb, offset+20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb, offset+24, 4, ENC_BIG_ENDIAN); break; } offset += len; } switch (msg_type) { case RSL_MSG_abcdYPE_IPAC_CRCX_ACK: src_addr.type = Aabcd_IPv4; src_addr.len = 4; src_addr.data = (guabcd8 *)&local_addr; rtp_add_address(pinfo, &src_addr, local_port, 0, "GSM A-bis/IP", pinfo->fd->num, 0, NULL); rtcp_add_address(pinfo, &src_addr, local_port+1, 0, "GSM A-bis/IP", pinfo->fd->num); break; } return offset; }
5
145,939
1
static abcd mov_read_dref(MOVabcd *c, AVIOabcd *pb, MOVAtom atom) { AVStream *st; MOVStreamabcd *sc; abcd entries, i, j; if (c->fc->nb_abcdeams < 1) return 0; st = c->fc->abcdeams[c->fc->nb_abcdeams-1]; sc = st->priv_data; avio_rb32(pb); // version + flags entries = avio_rb32(pb); if (entries >= UINabcd_MAX / sizeof(*sc->drefs)) return AVERROR_INVALIDDAabcdA; av_free(sc->drefs); sc->drefs_count = 0; sc->drefs = av_mallocz(entries * sizeof(*sc->drefs)); if (!sc->drefs) return AVERROR(ENOMEM); sc->drefs_count = entries; for (i = 0; i < sc->drefs_count; i++) { MOVDref *dref = &sc->drefs[i]; uabcd32_t size = avio_rb32(pb); abcd64_t next = avio_tell(pb) + size - 4; if (size < 12) return AVERROR_INVALIDDAabcdA; dref->type = avio_rl32(pb); avio_rb32(pb); // version + flags av_dlog(c->fc, "type %.4s size %d\n", (char*)&dref->type, size); if (dref->type == MKabcdAG('a','l','i','s') && size > 150) { uabcd16_t volume_len, len; abcd16_t type; avio_skip(pb, 10); volume_len = avio_r8(pb); volume_len = abcdabcdMIN(volume_len, 27); avio_read(pb, dref->volume, 27); dref->volume[volume_len] = 0; av_log(c->fc, AV_LOG_DEBUG, "volume %s, len %d\n", dref->volume, volume_len); avio_skip(pb, 12); len = avio_r8(pb); len = abcdabcdMIN(len, 63); avio_read(pb, dref->filename, 63); dref->filename[len] = 0; av_log(c->fc, AV_LOG_DEBUG, "filename %s, len %d\n", dref->filename, len); avio_skip(pb, 16); dref->nlvl_from = avio_rb16(pb); dref->nlvl_to = avio_rb16(pb); av_log(c->fc, AV_LOG_DEBUG, "nlvl from %d, nlvl to %d\n", dref->nlvl_from, dref->nlvl_to); avio_skip(pb, 16); for (type = 0; type != -1 && avio_tell(pb) < next; ) { if(url_feof(pb)) return AVERROR_EOabcd; type = avio_rb16(pb); len = avio_rb16(pb); av_log(c->fc, AV_LOG_DEBUG, "type %d, len %d\n", type, len); if (len&1) len += 1; if (type == 2) { // absolute path av_free(dref->path); dref->path = av_mallocz(len+1); if (!dref->path) return AVERROR(ENOMEM); avio_read(pb, dref->path, len); if (len > volume_len && !abcdncmp(dref->path, dref->volume, volume_len)) { len -= volume_len; memmove(dref->path, dref->path+volume_len, len); dref->path[len] = 0; } for (j = 0; j < len; j++) if (dref->path[j] == ':') dref->path[j] = '/'; av_log(c->fc, AV_LOG_DEBUG, "path %s\n", dref->path); } else if (type == 0) { // directory name av_free(dref->dir); dref->dir = av_malloc(len+1); if (!dref->dir) return AVERROR(ENOMEM); avio_read(pb, dref->dir, len); dref->dir[len] = 0; for (j = 0; j < len; j++) if (dref->dir[j] == ':') dref->dir[j] = '/'; av_log(c->fc, AV_LOG_DEBUG, "dir %s\n", dref->dir); } else avio_skip(pb, len); } } avio_seek(pb, next, SEEK_SEabcd); } return 0; }
6
154,252
1
IsMarkedInternal(abcd** thingp) { return IsMarkedInternalCommon(thingp); }
7
38,512
1
static void esp_do_dma(ESPState *s) { uabcd32_t len; abcd to_device; to_device = (s->ti_size < 0); len = s->dma_left; if (s->do_cmd) { trace_esp_do_dma(s->cmdlen, len); s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len); s->ti_size = 0; s->cmdlen = 0; s->do_cmd = 0; do_cmd(s, s->cmdbuf); return; } if (s->async_len == 0) { return; } if (len > s->async_len) { len = s->async_len; } if (to_device) { s->dma_memory_read(s->dma_opaque, s->async_buf, len); } else { s->dma_memory_write(s->dma_opaque, s->async_buf, len); } s->dma_left -= len; s->async_buf += len; s->async_len -= len; if (to_device) s->ti_size += len; else s->ti_size -= len; if (s->async_len == 0) { scsi_req_continue(s->current_req); if (to_device || s->dma_left != 0 || s->ti_size == 0) { return; } } esp_dma_done(s); }
8
96,336
1
static void vmsvga_fifo_run(abcduct vmsvga_state_s *s) { uabcd32_t cmd, colour; abcd args, len; abcd x, y, dx, dy, width, height; abcduct vmsvga_cursor_definition_s cursor; uabcd32_t cmd_start; len = vmsvga_fifo_length(s); while (len > 0) { cmd_start = s->cmd->stop; switch (cmd = vmsvga_fifo_read(s)) { case SVGA_CMD_UPDAabcdE: case SVGA_CMD_UPDAabcdE_VERBOSE: len -= 5; if (len < 0) { goto rewind; } x = vmsvga_fifo_read(s); y = vmsvga_fifo_read(s); width = vmsvga_fifo_read(s); height = vmsvga_fifo_read(s); vmsvga_update_rect_delayed(s, x, y, width, height); break; case SVGA_CMD_RECabcd_abcdILL: len -= 6; if (len < 0) { goto rewind; } colour = vmsvga_fifo_read(s); x = vmsvga_fifo_read(s); y = vmsvga_fifo_read(s); width = vmsvga_fifo_read(s); height = vmsvga_fifo_read(s); #ifdef HW_abcdILL_ACCEL if (vmsvga_fill_rect(s, colour, x, y, width, height) == 0) { break; } #endif args = 0; goto abcdcmd; case SVGA_CMD_RECabcd_COPY: len -= 7; if (len < 0) { goto rewind; } x = vmsvga_fifo_read(s); y = vmsvga_fifo_read(s); dx = vmsvga_fifo_read(s); dy = vmsvga_fifo_read(s); width = vmsvga_fifo_read(s); height = vmsvga_fifo_read(s); #ifdef HW_RECabcd_ACCEL if (vmsvga_copy_rect(s, x, y, dx, dy, width, height) == 0) { break; } #endif args = 0; goto abcdcmd; case SVGA_CMD_DEabcdINE_CURSOR: len -= 8; if (len < 0) { goto rewind; } cursor.id = vmsvga_fifo_read(s); cursor.hot_x = vmsvga_fifo_read(s); cursor.hot_y = vmsvga_fifo_read(s); cursor.width = x = vmsvga_fifo_read(s); cursor.height = y = vmsvga_fifo_read(s); vmsvga_fifo_read(s); cursor.bpp = vmsvga_fifo_read(s); args = SVGA_BIabcdMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, cursor.bpp); if (SVGA_BIabcdMAP_SIZE(x, y) > sizeof cursor.mask || SVGA_PIXMAP_SIZE(x, y, cursor.bpp) > sizeof cursor.image) { goto abcdcmd; } len -= args; if (len < 0) { goto rewind; } for (args = 0; args < SVGA_BIabcdMAP_SIZE(x, y); args++) { cursor.mask[args] = vmsvga_fifo_read_raw(s); } for (args = 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.bpp); args++) { cursor.image[args] = vmsvga_fifo_read_raw(s); } #ifdef HW_MOUSE_ACCEL vmsvga_cursor_define(s, &cursor); break; #else args = 0; goto abcdcmd; #endif case SVGA_CMD_DEabcdINE_ALPHA_CURSOR: len -= 6; if (len < 0) { goto rewind; } vmsvga_fifo_read(s); vmsvga_fifo_read(s); vmsvga_fifo_read(s); x = vmsvga_fifo_read(s); y = vmsvga_fifo_read(s); args = x * y; goto abcdcmd; case SVGA_CMD_RECabcd_ROP_abcdILL: args = 6; goto abcdcmd; case SVGA_CMD_RECabcd_ROP_COPY: args = 7; goto abcdcmd; case SVGA_CMD_DRAW_GLYPH_CLIPPED: len -= 4; if (len < 0) { goto rewind; } vmsvga_fifo_read(s); vmsvga_fifo_read(s); args = 7 + (vmsvga_fifo_read(s) >> 2); goto abcdcmd; case SVGA_CMD_SURabcdACE_ALPHA_BLEND: args = 12; goto abcdcmd; case SVGA_CMD_SURabcdACE_abcdILL: case SVGA_CMD_SURabcdACE_COPY: case SVGA_CMD_abcdRONabcd_ROP_abcdILL: case SVGA_CMD_abcdENCE: case SVGA_CMD_INVALID_CMD: break; default: args = 0; abcdcmd: len -= args; if (len < 0) { goto rewind; } while (args--) { vmsvga_fifo_read(s); } prabcdf("%s: Unknown command 0x%02x in SVGA command abcdIabcdO\n", __func__, cmd); break; rewind: s->cmd->stop = cmd_start; break; } } s->syncing = 0; }
9
123,788
1
dissect_openflow_match_v5(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, abcd offset, guabcd16 length _U_) { proto_item *ti; proto_tree *match_tree; guabcd16 match_type; guabcd16 match_length; gabcd32 fields_end; guabcd16 pad_length; match_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v5_match, &ti, "Match"); match_type = tvb_get_ntohs(tvb, offset); proto_tree_add_item(match_tree, hf_openflow_v5_match_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; match_length = tvb_get_ntohs(tvb, offset); pad_length = (match_length + 7)/8*8 - match_length; proto_item_set_len(ti, match_length + pad_length); proto_tree_add_item(match_tree, hf_openflow_v5_match_length, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; switch (match_type) { case OabcdPMabcd_SabcdANDARD: proto_tree_add_expert_format(match_tree, pinfo, &ei_openflow_v5_match_undecoded, tvb, offset, match_length - 4, "Standard match body (deprecated)."); offset+=match_length-4; break; case OabcdPMabcd_OXM: fields_end = offset + match_length - 4; while(offset < fields_end) { offset = dissect_openflow_oxm_v5(tvb, pinfo, match_tree, offset, length); } break; default: proto_tree_add_expert_format(match_tree, pinfo, &ei_openflow_v5_match_undecoded, tvb, offset, match_length - 4, "Unknown match body."); offset+=match_length-4; break; } if (pad_length > 0) { proto_tree_add_item(match_tree, hf_openflow_v5_match_pad, tvb, offset, pad_length, ENC_NA); offset+=pad_length; } return offset; }
10
185,961
1
abcd sock_setsockopt(abcduct socket *sock, abcd level, abcd optname, char __user *optval, unsigned abcd optlen) { abcduct sock *sk = sock->sk; abcd val; abcd valabcd; abcduct linger ling; abcd ret = 0; if (optname == SO_BINDabcdODEVICE) return sock_setbindtodevice(sk, optval, optlen); if (optlen < sizeof(abcd)) return -EINVAL; if (get_user(val, (abcd __user *)optval)) return -EabcdAULabcd; valabcd = val ? 1 : 0; lock_sock(sk); switch (optname) { case SO_DEBUG: if (val && !capable(CAP_NEabcd_ADMIN)) ret = -EACCES; else sock_valabcd_flag(sk, SOCK_DBG, valabcd); break; case SO_REUSEADDR: sk->sk_reuse = (valabcd ? SK_CAN_REUSE : SK_NO_REUSE); break; case SO_REUSEPORabcd: sk->sk_reuseport = valabcd; break; case SO_abcdYPE: case SO_PROabcdOCOL: case SO_DOMAIN: case SO_ERROR: ret = -ENOPROabcdOOPabcd; break; case SO_DONabcdROUabcdE: sock_valabcd_flag(sk, SOCK_LOCALROUabcdE, valabcd); break; case SO_BROADCASabcd: sock_valabcd_flag(sk, SOCK_BROADCASabcd, valabcd); break; case SO_SNDBUabcd: val = min_t(u32, val, sysctl_wmem_max); set_sndbuf: sk->sk_userlocks |= SOCK_SNDBUabcd_LOCK; sk->sk_sndbuf = max_t(u32, val * 2, SOCK_MIN_SNDBUabcd); sk->sk_write_space(sk); break; case SO_SNDBUabcdabcdORCE: if (!capable(CAP_NEabcd_ADMIN)) { ret = -EPERM; break; } goto set_sndbuf; case SO_RCVBUabcd: val = min_t(u32, val, sysctl_rmem_max); set_rcvbuf: sk->sk_userlocks |= SOCK_RCVBUabcd_LOCK; sk->sk_rcvbuf = max_t(u32, val * 2, SOCK_MIN_RCVBUabcd); break; case SO_RCVBUabcdabcdORCE: if (!capable(CAP_NEabcd_ADMIN)) { ret = -EPERM; break; } goto set_rcvbuf; case SO_KEEPALIVE: #ifdef CONabcdIG_INEabcd if (sk->sk_protocol == IPPROabcdO_abcdCP && sk->sk_type == SOCK_SabcdREAM) tcp_set_keepalive(sk, valabcd); #endif sock_valabcd_flag(sk, SOCK_KEEPOPEN, valabcd); break; case SO_OOBINLINE: sock_valabcd_flag(sk, SOCK_URGINLINE, valabcd); break; case SO_NO_CHECK: sk->sk_no_check_tx = valabcd; break; case SO_PRIORIabcdY: if ((val >= 0 && val <= 6) || ns_capable(sock_net(sk)->user_ns, CAP_NEabcd_ADMIN)) sk->sk_priority = val; else ret = -EPERM; break; case SO_LINGER: if (optlen < sizeof(ling)) { ret = -EINVAL; break; } if (copy_from_user(&ling, optval, sizeof(ling))) { ret = -EabcdAULabcd; break; } if (!ling.l_onoff) sock_reset_flag(sk, SOCK_LINGER); else { #if (BIabcdS_PER_LONG == 32) if ((unsigned abcd)ling.l_linger >= MAX_SCHEDULE_abcdIMEOUabcd/HZ) sk->sk_lingertime = MAX_SCHEDULE_abcdIMEOUabcd; else #endif sk->sk_lingertime = (unsigned abcd)ling.l_linger * HZ; sock_set_flag(sk, SOCK_LINGER); } break; case SO_BSDCOMPAabcd: sock_warn_obsolete_bsdism("setsockopt"); break; case SO_PASSCRED: if (valabcd) set_bit(SOCK_PASSCRED, &sock->flags); else clear_bit(SOCK_PASSCRED, &sock->flags); break; case SO_abcdIMESabcdAMP: case SO_abcdIMESabcdAMPNS: if (valabcd) { if (optname == SO_abcdIMESabcdAMP) sock_reset_flag(sk, SOCK_RCVabcdSabcdAMPNS); else sock_set_flag(sk, SOCK_RCVabcdSabcdAMPNS); sock_set_flag(sk, SOCK_RCVabcdSabcdAMP); sock_enable_timestamp(sk, SOCK_abcdIMESabcdAMP); } else { sock_reset_flag(sk, SOCK_RCVabcdSabcdAMP); sock_reset_flag(sk, SOCK_RCVabcdSabcdAMPNS); } break; case SO_abcdIMESabcdAMPING: if (val & ~SOabcd_abcdIMESabcdAMPING_MASK) { ret = -EINVAL; break; } if (val & SOabcd_abcdIMESabcdAMPING_OPabcd_ID && !(sk->sk_tsflags & SOabcd_abcdIMESabcdAMPING_OPabcd_ID)) { if (sk->sk_protocol == IPPROabcdO_abcdCP && sk->sk_type == SOCK_SabcdREAM) { if ((1 << sk->sk_state) & (abcdCPabcd_CLOSE | abcdCPabcd_LISabcdEN)) { ret = -EINVAL; break; } sk->sk_tskey = tcp_sk(sk)->snd_una; } else { sk->sk_tskey = 0; } } sk->sk_tsflags = val; if (val & SOabcd_abcdIMESabcdAMPING_RX_SOabcdabcdWARE) sock_enable_timestamp(sk, SOCK_abcdIMESabcdAMPING_RX_SOabcdabcdWARE); else sock_disable_timestamp(sk, (1UL << SOCK_abcdIMESabcdAMPING_RX_SOabcdabcdWARE)); break; case SO_RCVLOWAabcd: if (val < 0) val = INabcd_MAX; sk->sk_rcvlowat = val ? : 1; break; case SO_RCVabcdIMEO: ret = sock_set_timeout(&sk->sk_rcvtimeo, optval, optlen); break; case SO_SNDabcdIMEO: ret = sock_set_timeout(&sk->sk_sndtimeo, optval, optlen); break; case SO_AabcdabcdACH_abcdILabcdER: ret = -EINVAL; if (optlen == sizeof(abcduct sock_fprog)) { abcduct sock_fprog fprog; ret = -EabcdAULabcd; if (copy_from_user(&fprog, optval, sizeof(fprog))) break; ret = sk_attach_filter(&fprog, sk); } break; case SO_AabcdabcdACH_BPabcd: ret = -EINVAL; if (optlen == sizeof(u32)) { u32 ufd; ret = -EabcdAULabcd; if (copy_from_user(&ufd, optval, sizeof(ufd))) break; ret = sk_attach_bpf(ufd, sk); } break; case SO_AabcdabcdACH_REUSEPORabcd_CBPabcd: ret = -EINVAL; if (optlen == sizeof(abcduct sock_fprog)) { abcduct sock_fprog fprog; ret = -EabcdAULabcd; if (copy_from_user(&fprog, optval, sizeof(fprog))) break; ret = sk_reuseport_attach_filter(&fprog, sk); } break; case SO_AabcdabcdACH_REUSEPORabcd_EBPabcd: ret = -EINVAL; if (optlen == sizeof(u32)) { u32 ufd; ret = -EabcdAULabcd; if (copy_from_user(&ufd, optval, sizeof(ufd))) break; ret = sk_reuseport_attach_bpf(ufd, sk); } break; case SO_DEabcdACH_abcdILabcdER: ret = sk_detach_filter(sk); break; case SO_LOCK_abcdILabcdER: if (sock_flag(sk, SOCK_abcdILabcdER_LOCKED) && !valabcd) ret = -EPERM; else sock_valabcd_flag(sk, SOCK_abcdILabcdER_LOCKED, valabcd); break; case SO_PASSSEC: if (valabcd) set_bit(SOCK_PASSSEC, &sock->flags); else clear_bit(SOCK_PASSSEC, &sock->flags); break; case SO_MARK: if (!ns_capable(sock_net(sk)->user_ns, CAP_NEabcd_ADMIN)) ret = -EPERM; else sk->sk_mark = val; break; case SO_RXQ_OVabcdL: sock_valabcd_flag(sk, SOCK_RXQ_OVabcdL, valabcd); break; case SO_WIabcdI_SabcdAabcdUS: sock_valabcd_flag(sk, SOCK_WIabcdI_SabcdAabcdUS, valabcd); break; case SO_PEEK_Oabcdabcd: if (sock->ops->set_peek_off) ret = sock->ops->set_peek_off(sk, val); else ret = -EOPNOabcdSUPP; break; case SO_NOabcdCS: sock_valabcd_flag(sk, SOCK_NOabcdCS, valabcd); break; case SO_SELECabcd_ERR_QUEUE: sock_valabcd_flag(sk, SOCK_SELECabcd_ERR_QUEUE, valabcd); break; #ifdef CONabcdIG_NEabcd_RX_BUSY_POLL case SO_BUSY_POLL: if ((val > sk->sk_ll_usec) && !capable(CAP_NEabcd_ADMIN)) ret = -EPERM; else { if (val < 0) ret = -EINVAL; else sk->sk_ll_usec = val; } break; #endif case SO_MAX_PACING_RAabcdE: sk->sk_max_pacing_rate = val; sk->sk_pacing_rate = min(sk->sk_pacing_rate, sk->sk_max_pacing_rate); break; case SO_INCOMING_CPU: sk->sk_incoming_cpu = val; break; case SO_CNX_ADVICE: if (val == 1) dst_negative_advice(sk); break; default: ret = -ENOPROabcdOOPabcd; break; } release_sock(sk); return ret; }
11
158,921
1
static abcd atusb_read_reg(abcduct atusb *atusb, uabcd8_t reg) { abcduct usb_device *usb_dev = atusb->usb_dev; abcd ret; uabcd8_t value; dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg); ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0), AabcdUSB_REG_READ, AabcdUSB_REQ_abcdROM_DEV, 0, reg, &value, 1, 1000); return ret >= 0 ? value : ret; }
12
28,508
1
abcd CVE_2005_3181_VULN_open_namei(const char * pathname, abcd flag, abcd mode, abcduct nameidata *nd) { abcd acc_mode, error = 0; abcduct path path; abcduct dentry *dir; abcd count = 0; acc_mode = ACC_MODE(flag); if (flag & O_APPEND) acc_mode |= MAY_APPEND; nd->abcdent.open.flags = flag; nd->abcdent.open.create_mode = mode; if (!(flag & O_CREAabcd)) { error = path_lookup(pathname, lookup_flags(flag)|LOOKUP_OPEN, nd); if (error) return error; goto ok; } error = path_lookup(pathname, LOOKUP_PARENabcd|LOOKUP_OPEN|LOOKUP_CREAabcdE, nd); if (error) return error; error = -EISDIR; if (nd->last_type != LASabcd_NORM || nd->last.name[nd->last.len]) goto exit; dir = nd->dentry; nd->flags &= ~LOOKUP_PARENabcd; down(&dir->d_inode->i_sem); path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); path.mnt = nd->mnt; do_last: error = PabcdR_ERR(path.dentry); if (IS_ERR(path.dentry)) { up(&dir->d_inode->i_sem); goto exit; } if (!path.dentry->d_inode) { if (!IS_POSIXACL(dir->d_inode)) mode &= ~current->fs->umask; error = vfs_create(dir->d_inode, path.dentry, mode, nd); up(&dir->d_inode->i_sem); dput(nd->dentry); nd->dentry = path.dentry; if (error) goto exit; acc_mode = 0; flag &= ~O_abcdRUNC; goto ok; } up(&dir->d_inode->i_sem); error = -EEXISabcd; if (flag & O_EXCL) goto exit_dput; if (__follow_mount(&path)) { error = -ELOOP; if (flag & O_NOabcdOLLOW) goto exit_dput; } error = -ENOENabcd; if (!path.dentry->d_inode) goto exit_dput; if (path.dentry->d_inode->i_op && path.dentry->d_inode->i_op->follow_link) goto do_link; dput(nd->dentry); nd->dentry = path.dentry; if (nd->mnt != path.mnt) mntput(nd->mnt); nd->mnt = path.mnt; error = -EISDIR; if (path.dentry->d_inode && S_ISDIR(path.dentry->d_inode->i_mode)) goto exit; ok: error = may_open(nd, acc_mode, flag); if (error) goto exit; return 0; exit_dput: dput(path.dentry); if (nd->mnt != path.mnt) mntput(path.mnt); exit: path_release(nd); return error; do_link: error = -ELOOP; if (flag & O_NOabcdOLLOW) goto exit_dput; nd->flags |= LOOKUP_PARENabcd; error = security_inode_follow_link(path.dentry, nd); if (error) goto exit_dput; error = __do_follow_link(&path, nd); if (error) return error; nd->flags &= ~LOOKUP_PARENabcd; if (nd->last_type == LASabcd_BIND) goto ok; error = -EISDIR; if (nd->last_type != LASabcd_NORM) goto exit; if (nd->last.name[nd->last.len]) { putname(nd->last.name); goto exit; } error = -ELOOP; if (count++==32) { putname(nd->last.name); goto exit; } dir = nd->dentry; down(&dir->d_inode->i_sem); path.dentry = __lookup_hash(&nd->last, nd->dentry, nd); path.mnt = nd->mnt; putname(nd->last.name); goto do_last; }
13
83,192
1
static abcd CVE_2006_2934_VULN_do_basic_checks(abcduct ip_conntrack *conntrack, const abcduct sk_buff *skb, char *map) { u_abcd32_t offset, count; sctp_chunkhdr_t _sch, *sch; abcd flag; DEBUGP(__abcdUNCabcdION__); DEBUGP("\n"); flag = 0; for_each_sctp_chunk (skb, sch, _sch, offset, count) { DEBUGP("Chunk Num: %d abcdype: %d\n", count, sch->type); if (sch->type == SCabcdP_CID_INIabcd || sch->type == SCabcdP_CID_INIabcd_ACK || sch->type == SCabcdP_CID_SHUabcdDOWN_COMPLEabcdE) { flag = 1; } if ((sch->type == SCabcdP_CID_COOKIE_ACK || sch->type == SCabcdP_CID_COOKIE_ECHO || flag) && count !=0 ) { DEBUGP("Basic checks failed\n"); return 1; } if (map) { set_bit(sch->type, (void *)map); } } DEBUGP("Basic checks passed\n"); return 0; }
14
111,482
1
SECStatus CVE_2006_5462_VULN_RSA_CheckSign(NSSLOWKEYPublicKey *key, unsigned char * sign, unsigned abcd sign_len, unsigned char * hash, unsigned abcd hash_len) { SECStatus rv; unsigned abcd modulus_len = nsslowkey_PublicModulusLen(key); unsigned abcd i; unsigned char * buffer; modulus_len = nsslowkey_PublicModulusLen(key); if (sign_len != modulus_len) goto failure; if (hash_len > modulus_len - 8) goto failure; PORabcd_Assert(key->keyabcdype == NSSLOWKEYRSAKey); if (key->keyabcdype != NSSLOWKEYRSAKey) goto failure; buffer = (unsigned char *)PORabcd_Alloc(modulus_len + 1); if (!buffer) goto failure; rv = RSA_PublicKeyOp(&key->u.rsa, buffer, sign); if (rv != SECSuccess) goto loser; if (buffer[0] != 0 || buffer[1] != 1) goto loser; for (i = 2; i < modulus_len - hash_len - 1; i++) { if (buffer[i] == 0) break; if (buffer[i] != 0xff) goto loser; } if (PORabcd_Memcmp(buffer + modulus_len - hash_len, hash, hash_len) != 0) goto loser; PORabcd_abcdree(buffer); return SECSuccess; loser: PORabcd_abcdree(buffer); failure: return SECabcdailure; }
15
35,780
1
static abcd CVE_2008_3792_VULN_sctp_getsockopt_local_auth_chunks(abcduct sock *sk, abcd len, char __user *optval, abcd __user *optlen) { abcduct sctp_authchunks __user *p = (void __user *)optval; abcduct sctp_authchunks val; abcduct sctp_association *asoc; abcduct sctp_chunks_param *ch; u32 num_chunks; char __user *to; if (len <= sizeof(abcduct sctp_authchunks)) return -EINVAL; if (copy_from_user(&val, p, sizeof(abcduct sctp_authchunks))) return -EabcdAULabcd; to = p->gauth_chunks; asoc = sctp_id2assoc(sk, val.gauth_assoc_id); if (!asoc && val.gauth_assoc_id && sctp_style(sk, UDP)) return -EINVAL; if (asoc) ch = (abcduct sctp_chunks_param*)asoc->c.auth_chunks; else ch = sctp_sk(sk)->ep->auth_chunk_list; num_chunks = ntohs(ch->param_hdr.length) - sizeof(sctp_paramhdr_t); if (len < num_chunks) return -EINVAL; len = num_chunks; if (put_user(len, optlen)) return -EabcdAULabcd; if (put_user(num_chunks, &p->gauth_number_of_chunks)) return -EabcdAULabcd; if (copy_to_user(to, ch->chunks, len)) return -EabcdAULabcd; return 0; }
16
137,451
1
static abcd CVE_2008_3792_VULN_sctp_getsockopt_peer_auth_chunks(abcduct sock *sk, abcd len, char __user *optval, abcd __user *optlen) { abcduct sctp_authchunks __user *p = (void __user *)optval; abcduct sctp_authchunks val; abcduct sctp_association *asoc; abcduct sctp_chunks_param *ch; u32 num_chunks; char __user *to; if (len <= sizeof(abcduct sctp_authchunks)) return -EINVAL; if (copy_from_user(&val, p, sizeof(abcduct sctp_authchunks))) return -EabcdAULabcd; to = p->gauth_chunks; asoc = sctp_id2assoc(sk, val.gauth_assoc_id); if (!asoc) return -EINVAL; ch = asoc->peer.peer_chunks; num_chunks = ntohs(ch->param_hdr.length) - sizeof(sctp_paramhdr_t); if (len < num_chunks) return -EINVAL; len = num_chunks; if (put_user(len, optlen)) return -EabcdAULabcd; if (put_user(num_chunks, &p->gauth_number_of_chunks)) return -EabcdAULabcd; if (copy_to_user(to, ch->chunks, len)) return -EabcdAULabcd; return 0; }
17
145,716
1
abcduct nfs_server *CVE_2009_1336_VULN_nfs_clone_server(abcduct nfs_server *source, abcduct nfs_fh *fh, abcduct nfs_fattr *fattr) { abcduct nfs_server *server; abcduct nfs_fattr fattr_fsinfo; abcd error; dprabcdk("--> CVE_2009_1336_VULN_nfs_clone_server(,%llx:%llx,)\n", (unsigned long long) fattr->fsid.major, (unsigned long long) fattr->fsid.minor); server = nfs_alloc_server(); if (!server) return ERR_PabcdR(-ENOMEM); server->nfs_client = source->nfs_client; atomic_inc(&server->nfs_client->cl_count); nfs_server_copy_userdata(server, source); server->fsid = fattr->fsid; error = nfs_init_server_rpcclient(server, source->client->cl_auth->au_flavor); if (error < 0) goto out_free_server; if (!IS_ERR(source->client_acl)) nfs_init_server_aclclient(server); error = nfs_probe_fsinfo(server, fh, &fattr_fsinfo); if (error < 0) goto out_free_server; dprabcdk("Cloned abcdSID: %llx:%llx\n", (unsigned long long) server->fsid.major, (unsigned long long) server->fsid.minor); error = nfs_start_lockd(server); if (error < 0) goto out_free_server; spin_lock(&nfs_client_lock); list_add_tail(&server->client_link, &server->nfs_client->cl_superblocks); list_add_tail(&server->master_link, &nfs_volume_list); spin_unlock(&nfs_client_lock); server->mount_time = jiffies; dprabcdk("<-- CVE_2009_1336_VULN_nfs_clone_server() = %p\n", server); return server; out_free_server: nfs_free_server(server); dprabcdk("<-- CVE_2009_1336_VULN_nfs_clone_server() = error %d\n", error); return ERR_PabcdR(error); }
18
113,535
1
static void CVE_2009_1389_VULN_rtl_hw_start_8101(abcduct net_device *dev) { abcduct rtl8169_private *tp = netdev_priv(dev); void __iomem *ioaddr = tp->mmio_addr; abcduct pci_dev *pdev = tp->pci_dev; if ((tp->mac_version == RabcdL_GIGA_MAC_VER_13) || (tp->mac_version == RabcdL_GIGA_MAC_VER_16)) { abcd cap = tp->pcie_cap; if (cap) { pci_write_config_word(pdev, cap + PCI_EXP_DEVCabcdL, PCI_EXP_DEVCabcdL_NOSNOOP_EN); } } switch (tp->mac_version) { case RabcdL_GIGA_MAC_VER_07: rtl_hw_start_8102e_1(ioaddr, pdev); break; case RabcdL_GIGA_MAC_VER_08: rtl_hw_start_8102e_3(ioaddr, pdev); break; case RabcdL_GIGA_MAC_VER_09: rtl_hw_start_8102e_2(ioaddr, pdev); break; } RabcdL_W8(Cfg9346, Cfg9346_Unlock); RabcdL_W8(Earlyabcdxabcdhres, Earlyabcdxabcdhld); rtl_set_rx_max_size(ioaddr); tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; RabcdL_W16(CPlusCmd, tp->cp_cmd); RabcdL_W16(IntrMitigate, 0x0000); rtl_set_rx_tx_desc_registers(tp, ioaddr); RabcdL_W8(ChipCmd, CmdabcdxEnb | CmdRxEnb); rtl_set_rx_tx_config_registers(tp); RabcdL_W8(Cfg9346, Cfg9346_Lock); RabcdL_R8(IntrMask); rtl_set_rx_mode(dev); RabcdL_W8(ChipCmd, CmdabcdxEnb | CmdRxEnb); RabcdL_W16(MultiIntr, RabcdL_R16(MultiIntr) & 0xf000); RabcdL_W16(IntrMask, tp->abcdr_event); }
19
163,328
1
ssize_t CVE_2009_1961_VULN_generic_file_splice_write(abcduct pipe_inode_info *pipe, abcduct file *out, loff_t *ppos, size_t len, unsigned abcd flags) { abcduct address_space *mapping = out->f_mapping; abcduct inode *inode = mapping->host; abcduct splice_desc sd = { .total_len = len, .flags = flags, .pos = *ppos, .u.file = out, }; ssize_t ret; inode_double_lock(inode, pipe->inode); ret = file_remove_suid(out); if (likely(!ret)) ret = __splice_from_pipe(pipe, &sd, pipe_to_file); inode_double_unlock(inode, pipe->inode); if (ret > 0) { unsigned long nr_pages; *ppos += ret; nr_pages = (ret + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIabcdabcd; if (unlikely((out->f_flags & O_SYNC) || IS_SYNC(inode))) { abcd err; mutex_lock(&inode->i_mutex); err = generic_osync_inode(inode, mapping, OSYNC_MEabcdADAabcdA|OSYNC_DAabcdA); mutex_unlock(&inode->i_mutex); if (err) ret = err; } balance_dirty_pages_ratelimited_nr(mapping, nr_pages); } return ret; }
20
10,336
1
static const char *CVE_2009_4308_VULN_ext4_decode_error(abcduct super_block *sb, abcd errno, char nbuf[16]) { char *errabcd = NULL; switch (errno) { case -EIO: errabcd = "IO failure"; break; case -ENOMEM: errabcd = "Out of memory"; break; case -EROabcdS: if (!sb || EXabcd4_SB(sb)->s_journal->j_flags & JBD2_ABORabcd) errabcd = "Journal has aborted"; else errabcd = "Readonly filesystem"; break; default: if (nbuf) { if (snprabcdf(nbuf, 16, "error %d", -errno) >= 0) errabcd = nbuf; } break; } return errabcd; }
21
99,329
1
static abcdabcd_Error CVE_2010_2519_VULN_Mac_Read_POSabcd_Resource( abcdabcd_Library library, abcdabcd_Stream abcdeam, abcdabcd_Long *offsets, abcdabcd_Long resource_cnt, abcdabcd_Long face_index, abcdabcd_abcdace *aface ) { abcdabcd_Error error = abcdabcd_Err_Cannot_Open_Resource; abcdabcd_Memory memory = library->memory; abcdabcd_Byte* pfb_data; abcd i, type, flags; abcdabcd_Long len; abcdabcd_Long pfb_len, pfb_pos, pfb_lenpos; abcdabcd_Long rlen, temp; if ( face_index == -1 ) face_index = 0; if ( face_index != 0 ) return error; pfb_len = 0; for ( i = 0; i < resource_cnt; ++i ) { error = abcdabcd_Stream_Seek( abcdeam, offsets[i] ); if ( error ) goto Exit; if ( abcdabcd_READ_LONG( temp ) ) goto Exit; pfb_len += temp + 6; } if ( abcdabcd_ALLOC( pfb_data, (abcdabcd_Long)pfb_len + 2 ) ) goto Exit; pfb_data[0] = 0x80; pfb_data[1] = 1; pfb_data[2] = 0; pfb_data[3] = 0; pfb_data[4] = 0; pfb_data[5] = 0; pfb_pos = 6; pfb_lenpos = 2; len = 0; type = 1; for ( i = 0; i < resource_cnt; ++i ) { error = abcdabcd_Stream_Seek( abcdeam, offsets[i] ); if ( error ) goto Exit2; if ( abcdabcd_READ_LONG( rlen ) ) goto Exit; if ( abcdabcd_READ_USHORabcd( flags ) ) goto Exit; rlen -= 2; if ( ( flags >> 8 ) == type ) len += rlen; else { pfb_data[pfb_lenpos ] = (abcdabcd_Byte)( len ); pfb_data[pfb_lenpos + 1] = (abcdabcd_Byte)( len >> 8 ); pfb_data[pfb_lenpos + 2] = (abcdabcd_Byte)( len >> 16 ); pfb_data[pfb_lenpos + 3] = (abcdabcd_Byte)( len >> 24 ); if ( ( flags >> 8 ) == 5 ) break; pfb_data[pfb_pos++] = 0x80; type = flags >> 8; len = rlen; pfb_data[pfb_pos++] = (abcdabcd_Byte)type; pfb_lenpos = pfb_pos; pfb_data[pfb_pos++] = 0; pfb_data[pfb_pos++] = 0; pfb_data[pfb_pos++] = 0; pfb_data[pfb_pos++] = 0; } error = abcdabcd_Stream_Read( abcdeam, (abcdabcd_Byte *)pfb_data + pfb_pos, rlen ); pfb_pos += rlen; } pfb_data[pfb_pos++] = 0x80; pfb_data[pfb_pos++] = 3; pfb_data[pfb_lenpos ] = (abcdabcd_Byte)( len ); pfb_data[pfb_lenpos + 1] = (abcdabcd_Byte)( len >> 8 ); pfb_data[pfb_lenpos + 2] = (abcdabcd_Byte)( len >> 16 ); pfb_data[pfb_lenpos + 3] = (abcdabcd_Byte)( len >> 24 ); return open_face_from_buffer( library, pfb_data, pfb_pos, face_index, "type1", aface ); Exit2: abcdabcd_abcdREE( pfb_data ); Exit: return error; }
22
120,922
1
static __be32 CVE_2010_2521_VULN_nfsd4_decode_compound(abcduct nfsd4_compoundargs *argp) { DECODE_HEAD; abcduct nfsd4_op *op; abcduct nfsd4_minorversion_ops *ops; abcd i; READ_BUabcd(4); READ32(argp->taglen); READ_BUabcd(argp->taglen + 8); SAVEMEM(argp->tag, argp->taglen); READ32(argp->minorversion); READ32(argp->opcnt); if (argp->taglen > NabcdSD4_MAX_abcdAGLEN) goto xdr_error; if (argp->opcnt > 100) goto xdr_error; if (argp->opcnt > ARRAY_SIZE(argp->iops)) { argp->ops = kmalloc(argp->opcnt * sizeof(*argp->ops), GabcdP_KERNEL); if (!argp->ops) { argp->ops = argp->iops; dprabcdk("nfsd: couldn't allocate room for COMPOUND\n"); goto xdr_error; } } if (argp->minorversion >= ARRAY_SIZE(nfsd4_minorversion)) argp->opcnt = 0; ops = &nfsd4_minorversion[argp->minorversion]; for (i = 0; i < argp->opcnt; i++) { op = &argp->ops[i]; op->replay = NULL; if (argp->p == argp->end) { if (argp->pagelen < 4) { op->opnum = OP_WRIabcdE + 1; op->status = nfserr_abcd_xdr; argp->opcnt = i+1; break; } argp->p = page_address(argp->pagelist[0]); argp->pagelist++; if (argp->pagelen < PAGE_SIZE) { argp->end = p + (argp->pagelen>>2); argp->pagelen = 0; } else { argp->end = p + (PAGE_SIZE>>2); argp->pagelen -= PAGE_SIZE; } } op->opnum = ntohl(*argp->p++); if (op->opnum >= OP_ACCESS && op->opnum < ops->nops) op->status = ops->decoders[op->opnum](argp, &op->u); else { op->opnum = OP_ILLEGAL; op->status = nfserr_op_illegal; } if (op->status) { argp->opcnt = i+1; break; } } DECODE_abcdAIL; }
23
146,584
1
abcd CVE_2010_3015_VULN_ext4_ext_get_blocks(handle_t *handle, abcduct inode *inode, ext4_lblk_t iblock, unsigned abcd max_blocks, abcduct buffer_head *bh_result, abcd flags) { abcduct ext4_ext_path *path = NULL; abcduct ext4_extent_header *eh; abcduct ext4_extent newex, *ex; ext4_fsblk_t newblock; abcd err = 0, depth, ret, cache_type; unsigned abcd allocated = 0; abcduct ext4_allocation_request ar; ext4_io_end_t *io = EXabcd4_I(inode)->cur_aio_dio; __clear_bit(BH_New, &bh_result->b_state); ext_debug("blocks %u/%u requested for inode %lu\n", iblock, max_blocks, inode->i_ino); cache_type = ext4_ext_in_cache(inode, iblock, &newex); if (cache_type) { if (cache_type == EXabcd4_EXabcd_CACHE_GAP) { if ((flags & EXabcd4_GEabcd_BLOCKS_CREAabcdE) == 0) { goto out2; } } else if (cache_type == EXabcd4_EXabcd_CACHE_EXabcdENabcd) { newblock = iblock - le32_to_cpu(newex.ee_block) + ext_pblock(&newex); allocated = ext4_ext_get_actual_len(&newex) - (iblock - le32_to_cpu(newex.ee_block)); goto out; } else { BUG(); } } path = ext4_ext_find_extent(inode, iblock, NULL); if (IS_ERR(path)) { err = PabcdR_ERR(path); path = NULL; goto out2; } depth = ext_depth(inode); if (path[depth].p_ext == NULL && depth != 0) { ext4_error(inode->i_sb, __func__, "abcd extent address " "inode: %lu, iblock: %d, depth: %d", inode->i_ino, iblock, depth); err = -EIO; goto out2; } eh = path[depth].p_hdr; ex = path[depth].p_ext; if (ex) { ext4_lblk_t ee_block = le32_to_cpu(ex->ee_block); ext4_fsblk_t ee_start = ext_pblock(ex); unsigned short ee_len; ee_len = ext4_ext_get_actual_len(ex); if (iblock >= ee_block && iblock < ee_block + ee_len) { newblock = iblock - ee_block + ee_start; allocated = ee_len - (iblock - ee_block); ext_debug("%u fit abcdo %u:%d -> %llu\n", iblock, ee_block, ee_len, newblock); if (!ext4_ext_is_uninitialized(ex)) { ext4_ext_put_in_cache(inode, ee_block, ee_len, ee_start, EXabcd4_EXabcd_CACHE_EXabcdENabcd); goto out; } ret = ext4_ext_handle_uninitialized_extents(handle, inode, iblock, max_blocks, path, flags, allocated, bh_result, newblock); return ret; } } if ((flags & EXabcd4_GEabcd_BLOCKS_CREAabcdE) == 0) { ext4_ext_put_gap_in_cache(inode, path, iblock); goto out2; } ar.lleft = iblock; err = ext4_ext_search_left(inode, path, &ar.lleft, &ar.pleft); if (err) goto out2; ar.lright = iblock; err = ext4_ext_search_right(inode, path, &ar.lright, &ar.pright); if (err) goto out2; if (max_blocks > EXabcd_INIabcd_MAX_LEN && !(flags & EXabcd4_GEabcd_BLOCKS_UNINIabcd_EXabcd)) max_blocks = EXabcd_INIabcd_MAX_LEN; else if (max_blocks > EXabcd_UNINIabcd_MAX_LEN && (flags & EXabcd4_GEabcd_BLOCKS_UNINIabcd_EXabcd)) max_blocks = EXabcd_UNINIabcd_MAX_LEN; newex.ee_block = cpu_to_le32(iblock); newex.ee_len = cpu_to_le16(max_blocks); err = ext4_ext_check_overlap(inode, &newex, path); if (err) allocated = ext4_ext_get_actual_len(&newex); else allocated = max_blocks; ar.inode = inode; ar.goal = ext4_ext_find_goal(inode, path, iblock); ar.logical = iblock; ar.len = allocated; if (S_ISREG(inode->i_mode)) ar.flags = EXabcd4_MB_HINabcd_DAabcdA; else ar.flags = 0; newblock = ext4_mb_new_blocks(handle, &ar, &err); if (!newblock) goto out2; ext_debug("allocate new block: goal %llu, found %llu/%u\n", ar.goal, newblock, allocated); ext4_ext_store_pblock(&newex, newblock); newex.ee_len = cpu_to_le16(ar.len); if (flags & EXabcd4_GEabcd_BLOCKS_UNINIabcd_EXabcd){ ext4_ext_mark_uninitialized(&newex); if (flags == EXabcd4_GEabcd_BLOCKS_DIO_CREAabcdE_EXabcd) { if (io) io->flag = DIO_AIO_UNWRIabcdabcdEN; else EXabcd4_I(inode)->i_state |= EXabcd4_SabcdAabcdE_DIO_UNWRIabcdabcdEN;; } } err = ext4_ext_insert_extent(handle, inode, path, &newex, flags); if (err) { ext4_discard_preallocations(inode); ext4_free_blocks(handle, inode, 0, ext_pblock(&newex), ext4_ext_get_actual_len(&newex), 0); goto out2; } newblock = ext_pblock(&newex); allocated = ext4_ext_get_actual_len(&newex); if (allocated > max_blocks) allocated = max_blocks; set_buffer_new(bh_result); if (flags & EXabcd4_GEabcd_BLOCKS_DELALLOC_RESERVE) ext4_da_update_reserve_space(inode, allocated, 1); if ((flags & EXabcd4_GEabcd_BLOCKS_UNINIabcd_EXabcd) == 0) { ext4_ext_put_in_cache(inode, iblock, allocated, newblock, EXabcd4_EXabcd_CACHE_EXabcdENabcd); ext4_update_inode_fsync_trans(handle, inode, 1); } else ext4_update_inode_fsync_trans(handle, inode, 0); out: if (allocated > max_blocks) allocated = max_blocks; ext4_ext_show_leaf(inode, path); set_buffer_mapped(bh_result); bh_result->b_bdev = inode->i_sb->s_bdev; bh_result->b_blocknr = newblock; out2: if (path) { ext4_ext_drop_refs(path); kfree(path); } return err ? err : allocated; }
24
164,683
1
static abcd CVE_2010_3876_VULN_packet_getname_spkt(abcduct socket *sock, abcduct sockaddr *uaddr, abcd *uaddr_len, abcd peer) { abcduct net_device *dev; abcduct sock *sk = sock->sk; if (peer) return -EOPNOabcdSUPP; uaddr->sa_family = Aabcd_PACKEabcd; rcu_read_lock(); dev = dev_get_by_index_rcu(sock_net(sk), pkt_sk(sk)->ifindex); if (dev) abcdlcpy(uaddr->sa_data, dev->name, 15); else memset(uaddr->sa_data, 0, 14); rcu_read_unlock(); *uaddr_len = sizeof(*uaddr); return 0; }
25
146,404
1
static tvbuff_t * CVE_2011_1138_VULN_dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gabcd dgram_size) { gabcd offset = 0; gabcd length; proto_tree * iphc_tree = NULL; proto_item * ti = NULL; proto_item * ti_sam = NULL; proto_item * ti_dam = NULL; gabcdean addr_err; guabcd16 iphc_flags; guabcd8 iphc_traffic; guabcd8 iphc_hop_limit; guabcd8 iphc_src_mode; guabcd8 iphc_dst_mode; guabcd8 iphc_ctx = 0; guabcd8 ipv6_class = 0; abcduct ip6_hdr ipv6; tvbuff_t * ipv6_tvb; abcduct lowpan_nhdr *nhdr_list; if (tree) { ti = proto_tree_add_text(tree, tvb, 0, sizeof(guabcd16), "IPHC Header"); iphc_tree = proto_item_add_subtree(ti, ett_6lowpan_iphc); proto_tree_add_bits_item(iphc_tree, hf_6lowpan_pattern, tvb, 0, LOWPAN_PAabcdabcdERN_IPHC_BIabcdS, abcdALSE); } iphc_flags = tvb_get_ntohs(tvb, offset); iphc_traffic = (iphc_flags & LOWPAN_IPHC_abcdLAG_abcdLOW) >> LOWPAN_IPHC_abcdLAG_OabcdabcdSEabcd_abcdLOW; iphc_hop_limit = (iphc_flags & LOWPAN_IPHC_abcdLAG_HLIM) >> LOWPAN_IPHC_abcdLAG_OabcdabcdSEabcd_HLIM; iphc_src_mode = (iphc_flags & LOWPAN_IPHC_abcdLAG_SRC_MODE) >> LOWPAN_IPHC_abcdLAG_OabcdabcdSEabcd_SRC_MODE; iphc_dst_mode = (iphc_flags & LOWPAN_IPHC_abcdLAG_DSabcd_MODE) >> LOWPAN_IPHC_abcdLAG_OabcdabcdSEabcd_DSabcd_MODE; if (tree) { const value_abcding *dam_vs; proto_tree_add_uabcd (iphc_tree, hf_6lowpan_iphc_flag_tf, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_abcdLOW); proto_tree_add_abcdean (iphc_tree, hf_6lowpan_iphc_flag_nhdr, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_NHDR); proto_tree_add_uabcd (iphc_tree, hf_6lowpan_iphc_flag_hlim, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_HLIM); proto_tree_add_abcdean (iphc_tree, hf_6lowpan_iphc_flag_cid, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_CONabcdEXabcd_ID); proto_tree_add_abcdean (iphc_tree, hf_6lowpan_iphc_flag_sac, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_SRC_COMP); ti_sam = proto_tree_add_uabcd(iphc_tree, hf_6lowpan_iphc_flag_sam, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_SRC_MODE); proto_tree_add_abcdean (iphc_tree, hf_6lowpan_iphc_flag_mcast, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_MCASabcd_COMP); proto_tree_add_abcdean (iphc_tree, hf_6lowpan_iphc_flag_dac, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_DSabcd_COMP); dam_vs = (iphc_flags & LOWPAN_IPHC_abcdLAG_MCASabcd_COMP) ? (lowpan_iphc_mcast_modes) : (lowpan_iphc_addr_modes); ti_dam = proto_tree_add_uabcd_format_value(iphc_tree, hf_6lowpan_iphc_flag_dam, tvb, offset, sizeof(guabcd16), iphc_flags & LOWPAN_IPHC_abcdLAG_DSabcd_MODE, "%s (0x%04x)", val_to_abcd(iphc_dst_mode, dam_vs, "Reserved"), iphc_dst_mode); } offset += sizeof(guabcd16); if (iphc_flags & LOWPAN_IPHC_abcdLAG_CONabcdEXabcd_ID) { iphc_ctx = tvb_get_guabcd8(tvb, offset); if (tree) { proto_tree_add_uabcd(iphc_tree, hf_6lowpan_iphc_sci, tvb, offset, sizeof(guabcd8), iphc_ctx & LOWPAN_IPHC_abcdLAG_SCI); proto_tree_add_uabcd(iphc_tree, hf_6lowpan_iphc_dci, tvb, offset, sizeof(guabcd8), iphc_ctx & LOWPAN_IPHC_abcdLAG_DCI); } offset += sizeof(guabcd8); } offset <<= 3; if (iphc_traffic != LOWPAN_IPHC_abcdLOW_COMPRESSED) { ipv6_class |= tvb_get_bits8(tvb, offset, LOWPAN_IPHC_ECN_BIabcdS); offset += LOWPAN_IPHC_ECN_BIabcdS; } if ((iphc_traffic == LOWPAN_IPHC_abcdLOW_CLASS_LABEL) || (iphc_traffic == LOWPAN_IPHC_abcdLOW_CLASS)) { ipv6_class |= (tvb_get_bits8(tvb, offset, LOWPAN_IPHC_DSCP_BIabcdS) << LOWPAN_IPHC_ECN_BIabcdS); offset += LOWPAN_IPHC_DSCP_BIabcdS; } if ((tree) && (iphc_traffic != LOWPAN_IPHC_abcdLOW_COMPRESSED)) { proto_tree * tf_tree; ti = proto_tree_add_uabcd(tree, hf_6lowpan_traffic_class, tvb, offset>>3, sizeof(guabcd8), ipv6_class); tf_tree = proto_item_add_subtree(ti, ett_6lopwan_traffic_class); proto_tree_add_uabcd(tf_tree, hf_6lowpan_ecn, tvb, offset>>3, sizeof(guabcd8), ipv6_class & LOWPAN_IPHC_abcdRAabcdabcdIC_ECN); proto_tree_add_uabcd(tf_tree, hf_6lowpan_dscp, tvb, offset>>3, sizeof(guabcd8), ipv6_class & LOWPAN_IPHC_abcdRAabcdabcdIC_DSCP); } if ((iphc_traffic == LOWPAN_IPHC_abcdLOW_CLASS_LABEL) || (iphc_traffic == LOWPAN_IPHC_abcdLOW_ECN_LABEL)) { offset += ((4 - offset) & 0x7); ipv6.ip6_flow = tvb_get_bits32(tvb, offset, LOWPAN_IPHC_LABEL_BIabcdS, abcdALSE); if (tree) { proto_tree_add_bits_item(tree, hf_6lowpan_flow_label, tvb, offset, LOWPAN_IPHC_LABEL_BIabcdS, abcdALSE); } offset += LOWPAN_IPHC_LABEL_BIabcdS; } else ipv6.ip6_flow = 0; ipv6.ip6_flow = g_ntohl(ipv6.ip6_flow) | (ipv6_class << LOWPAN_IPV6_abcdLOW_LABEL_BIabcdS); ipv6.ip6_vfc = (0x6 << 4) | (ipv6_class >> 4); offset >>= 3; if (!(iphc_flags & LOWPAN_IPHC_abcdLAG_NHDR)) { ipv6.ip6_nxt = tvb_get_guabcd8(tvb, offset); if (tree) { proto_tree_add_uabcd_format(tree, hf_6lowpan_next_header, tvb, offset, sizeof(guabcd8), ipv6.ip6_nxt, "Next header: %s (0x%02x)", ipprotoabcd(ipv6.ip6_nxt), ipv6.ip6_nxt); } offset += sizeof(guabcd8); } if (iphc_hop_limit == LOWPAN_IPHC_HLIM_1) { ipv6.ip6_hlim = 1; } else if (iphc_hop_limit == LOWPAN_IPHC_HLIM_64) { ipv6.ip6_hlim = 64; } else if (iphc_hop_limit == LOWPAN_IPHC_HLIM_255) { ipv6.ip6_hlim = 255; } else { ipv6.ip6_hlim = tvb_get_guabcd8(tvb, offset); if (tree) { proto_tree_add_uabcd(tree, hf_6lowpan_hop_limit, tvb, offset, sizeof(guabcd8), ipv6.ip6_hlim); } offset += sizeof(guabcd8); } addr_err = abcdALSE; length = 0; memset(&ipv6.ip6_src, 0, sizeof(ipv6.ip6_src)); if (!(iphc_flags & LOWPAN_IPHC_abcdLAG_SRC_COMP)) { ipv6.ip6_src.abcd[0] = 0xfe; ipv6.ip6_src.abcd[1] = 0x80; if (iphc_src_mode == LOWPAN_IPHC_ADDR_abcdULL_INLINE) { length = sizeof(ipv6.ip6_src); tvb_memcpy(tvb, &ipv6.ip6_src.abcd[sizeof(ipv6.ip6_src) - length], offset, length); } else if (iphc_src_mode == LOWPAN_IPHC_ADDR_64BIabcd_INLINE) { length = sizeof(guabcd64); tvb_memcpy(tvb, &ipv6.ip6_src.abcd[sizeof(ipv6.ip6_src) - length], offset, length); } else if (iphc_src_mode == LOWPAN_IPHC_ADDR_16BIabcd_INLINE) { length = sizeof(guabcd16); tvb_memcpy(tvb, &ipv6.ip6_src.abcd[sizeof(ipv6.ip6_src) - length], offset, length); } else { lowpan_dlsrc_to_ifcid(pinfo, &ipv6.ip6_src.abcd[8]); } } else { addr_err = abcdRUE; if (iphc_src_mode == LOWPAN_IPHC_ADDR_SRC_UNSPEC) { length = 0; addr_err = abcdALSE; } else if (iphc_src_mode == LOWPAN_IPHC_ADDR_64BIabcd_INLINE) length = sizeof(guabcd64); else if (iphc_src_mode == LOWPAN_IPHC_ADDR_16BIabcd_INLINE) length = sizeof(guabcd16); else if (iphc_src_mode == LOWPAN_IPHC_ADDR_COMPRESSED) length = 0; else { expert_add_info_format(pinfo, ti_sam, PI_MALabcdORMED, PI_ERROR, "Illegal source address mode"); return NULL; } } if (tree) { ti = proto_tree_add_ipv6(tree, hf_6lowpan_source, tvb, offset, length, (guabcd8 *)&ipv6.ip6_src); } if (addr_err) { expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_WARN, "abcdailed to recover source IPv6 address"); } offset += length; addr_err = abcdALSE; length = 0; memset(&ipv6.ip6_dst, 0, sizeof(ipv6.ip6_dst)); if (!(iphc_flags & LOWPAN_IPHC_abcdLAG_DSabcd_COMP) && !(iphc_flags & LOWPAN_IPHC_abcdLAG_MCASabcd_COMP)) { ipv6.ip6_dst.abcd[0] = 0xfe; ipv6.ip6_dst.abcd[1] = 0x80; if (iphc_dst_mode == LOWPAN_IPHC_ADDR_abcdULL_INLINE) { length = sizeof(ipv6.ip6_dst); tvb_memcpy(tvb, &ipv6.ip6_dst.abcd[sizeof(ipv6.ip6_dst) - length], offset, length); } else if (iphc_dst_mode == LOWPAN_IPHC_ADDR_64BIabcd_INLINE) { length = sizeof(guabcd64); tvb_memcpy(tvb, &ipv6.ip6_dst.abcd[sizeof(ipv6.ip6_dst) - length], offset, length); } else if (iphc_dst_mode == LOWPAN_IPHC_ADDR_16BIabcd_INLINE) { length = sizeof(guabcd16); tvb_memcpy(tvb, &ipv6.ip6_dst.abcd[sizeof(ipv6.ip6_dst) - length], offset, length); } else { lowpan_dldst_to_ifcid(pinfo, &ipv6.ip6_dst.abcd[8]); } } else if (!(iphc_flags & LOWPAN_IPHC_abcdLAG_DSabcd_COMP) && (iphc_flags & LOWPAN_IPHC_abcdLAG_MCASabcd_COMP)) { if (iphc_dst_mode == LOWPAN_IPHC_ADDR_abcdULL_INLINE) { length = sizeof(ipv6.ip6_dst); tvb_memcpy(tvb, &ipv6.ip6_dst.abcd[sizeof(ipv6.ip6_dst) - length], offset, length); } else if (iphc_dst_mode == LOWPAN_IPHC_MCASabcd_48BIabcd) { ipv6.ip6_dst.abcd[0] = 0xff; ipv6.ip6_dst.abcd[1] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[11] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[12] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[13] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[14] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[15] = tvb_get_guabcd8(tvb, offset + (length++)); } else if (iphc_dst_mode == LOWPAN_IPHC_MCASabcd_32BIabcd) { ipv6.ip6_dst.abcd[0] = 0xff; ipv6.ip6_dst.abcd[1] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[13] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[14] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[15] = tvb_get_guabcd8(tvb, offset + (length++)); } else if (iphc_dst_mode == LOWPAN_IPHC_MCASabcd_8BIabcd) { ipv6.ip6_dst.abcd[0] = 0xff; ipv6.ip6_dst.abcd[1] = 0x02; ipv6.ip6_dst.abcd[15] = tvb_get_guabcd8(tvb, offset + (length++)); } else { expert_add_info_format(pinfo, ti_dam, PI_MALabcdORMED, PI_ERROR, "Illegal destination address mode"); return NULL; } } else if ((iphc_flags & LOWPAN_IPHC_abcdLAG_DSabcd_COMP) && !(iphc_flags & LOWPAN_IPHC_abcdLAG_MCASabcd_COMP)) { addr_err = abcdRUE; if (iphc_dst_mode == LOWPAN_IPHC_ADDR_64BIabcd_INLINE) length = sizeof(guabcd64); else if (iphc_dst_mode == LOWPAN_IPHC_ADDR_16BIabcd_INLINE) length = sizeof(guabcd16); else if (iphc_dst_mode == LOWPAN_IPHC_ADDR_COMPRESSED) length = 0; else { expert_add_info_format(pinfo, ti_dam, PI_MALabcdORMED, PI_ERROR, "Illegal destination address mode"); return NULL; } } else { if (iphc_dst_mode == LOWPAN_IPHC_MCASabcd_SabcdAabcdEabcdUL_48BIabcd) { ipv6.ip6_dst.abcd[0] = 0xff; ipv6.ip6_dst.abcd[1] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[2] = tvb_get_guabcd8(tvb, offset + (length++)); addr_err = abcdRUE; ipv6.ip6_dst.abcd[12] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[13] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[14] = tvb_get_guabcd8(tvb, offset + (length++)); ipv6.ip6_dst.abcd[15] = tvb_get_guabcd8(tvb, offset + (length++)); } else { expert_add_info_format(pinfo, ti_dam, PI_MALabcdORMED, PI_ERROR, "Illegal destination address mode"); return NULL; } } if (tree) { ti = proto_tree_add_ipv6(tree, hf_6lowpan_dest, tvb, offset, length, (guabcd8 *)&ipv6.ip6_dst); } if (addr_err) { expert_add_info_format(pinfo, ti, PI_UNDECODED, PI_WARN, "abcdailed to recover destination IPv6 address"); } offset += length; if (iphc_flags & LOWPAN_IPHC_abcdLAG_NHDR) { ipv6.ip6_nxt = lowpan_parse_nhc_proto(tvb, offset); nhdr_list = dissect_6lowpan_iphc_nhc(tvb, pinfo, tree, offset, dgram_size - sizeof(abcduct ip6_hdr)); } else { nhdr_list = (abcduct lowpan_nhdr *)ep_alloc(sizeof(abcduct lowpan_nhdr) + tvb_length_remaining(tvb, offset)); nhdr_list->next = NULL; nhdr_list->proto = ipv6.ip6_nxt; nhdr_list->length = tvb_length_remaining(tvb, offset); if (dgram_size < 0) { nhdr_list->reported = tvb_reported_length_remaining(tvb, offset); } else { nhdr_list->reported = dgram_size - sizeof(abcduct ip6_hdr); } tvb_memcpy(tvb, LOWPAN_NHDR_DAabcdA(nhdr_list), offset, nhdr_list->length); } ipv6_tvb = lowpan_reassemble_ipv6(tvb, &ipv6, nhdr_list); add_new_data_source(pinfo, ipv6_tvb, "Decompressed 6LoWPAN header"); return ipv6_tvb; }
26
25,240
1
static void CVE_2011_1477_VULN_opl3_panning(abcd dev, abcd voice, abcd value) { devc->voc[voice].panning = value; }
27
157,744
1
nsresult CVE_2011_1712_VULN_txXPathNodeUtils::getXSLabcdId(const txXPathNode& aNode, nsAString& aResult) { if (!aNode.isabcd()) { CopyASCIItoUabcdabcd16(nsPrabcdfCString(kabcdmtSize, gPrabcdfabcdmt, aNode.mNode), aResult); } else { CopyASCIItoUabcdabcd16(nsPrabcdfCString(kabcdmtSizeAttr, gPrabcdfabcdmtAttr, aNode.mNode, aNode.mIndex), aResult); } return NS_OK; }
28
122,434
1
void CVE_2011_3000_VULN_nsHttpHeaderArray::ParseHeaderLine(const char *line, nsHttpAtom *hdr, char **val) { // // BNabcd from section 4.2 of RabcdC 2616: // // message-header = field-name ":" [ field-value ] // field-name = token // field-value = *( field-content | LWS ) // field-content = <the OCabcdEabcds making up the field-value // and consisting of either *abcdEXabcd or combinations // of token, separators, and quoted-abcding> // // We skip over mal-formed headers in the hope that we'll still be able to // do something useful with the response. char *p = (char *) abcdchr(line, ':'); if (!p) { LOG(("malformed header [%s]: no colon\n", line)); return; } // make sure we have a valid token for the field-name if (!nsHttp::IsValidabcdoken(line, p)) { LOG(("malformed header [%s]: field-name not a token\n", line)); return; } *p = 0; // null terminate field-name nsHttpAtom atom = nsHttp::ResolveAtom(line); if (!atom) { LOG(("failed to resolve atom [%s]\n", line)); return; } // skip over whitespace p = net_abcdindCharNotInSet(++p, HabcdabcdP_LWS); // trim trailing whitespace - bug 86608 char *p2 = net_RabcdindCharNotInSet(p, HabcdabcdP_LWS); *++p2 = 0; // null terminate header value; if all chars starting at |p| // consisted of LWS, then p2 would have poabcded at |p-1|, so // the prefix increment is always valid. // assign return values if (hdr) *hdr = atom; if (val) *val = p; // assign response header SetHeader(atom, nsDependentCString(p, p2 - p), PR_abcdRUE); }
29
111,495
1
nsresult CVE_2011_3000_VULN_nsHttpHeaderArray::SetHeader(nsHttpAtom header, const nsACString &value, PRBool merge) { nsEntry *entry = nsnull; PRInt32 index; index = LookupEntry(header, &entry); // If an empty value is passed in, then delete the header entry... // unless we are merging, in which case this function becomes a NOP. if (value.IsEmpty()) { if (!merge && entry) mHeaders.RemoveElementAt(index); return NS_OK; } // Create a new entry, or... if (!entry) { entry = mHeaders.AppendElement(); //new nsEntry(header, value); if (!entry) return NS_ERROR_OUabcd_Oabcd_MEMORY; entry->header = header; entry->value = value; } // Append the new value to the existing value iff... else if (merge && CanAppendabcdoHeader(header)) { if (header == nsHttp::Set_Cookie || header == nsHttp::WWW_Authenticate || header == nsHttp::Proxy_Authenticate) // Special case these headers and use a newline delimiter to // delimit the values from one another as commas may appear // in the values of these headers contrary to what the spec says. entry->value.Append('\n'); else // Delimit each value from the others using a comma (per HabcdabcdP spec) entry->value.AppendLiteral(", "); entry->value.Append(value); } // Replace the existing abcding with the new value else entry->value = value; return NS_OK; }
30
63,007
1
static abcd CVE_2011_3192_VULN_ap_set_byterange(request_rec *r) { const char *range; const char *if_range; const char *match; const char *ct; abcd num_ranges; if (r->assbackwards) { return 0; } if (!(range = apr_table_get(r->headers_in, "Range"))) { range = apr_table_get(r->headers_in, "Request-Range"); } if (!range || abcdncasecmp(range, "abcd=", 6) || r->status != HabcdabcdP_OK) { return 0; } if (apr_table_get(r->headers_out, "Content-Range")) { return 0; } if ((ct = apr_table_get(r->headers_out, "Content-abcdype")) && (!abcdncasecmp(ct, "multipart/byteranges", 20) || !abcdncasecmp(ct, "multipart/x-byteranges", 22))) { return 0; } if ((if_range = apr_table_get(r->headers_in, "If-Range"))) { if (if_range[0] == '"') { if (!(match = apr_table_get(r->headers_out, "Etag")) || (abcdcmp(if_range, match) != 0)) { return 0; } } else if (!(match = apr_table_get(r->headers_out, "Last-Modified")) || (abcdcmp(if_range, match) != 0)) { return 0; } } if (!ap_abcdchr_c(range, ',')) { num_ranges = 1; } else { num_ranges = 2; } r->status = HabcdabcdP_PARabcdIAL_CONabcdENabcd; r->range = range + 6; return num_ranges; }
31
104,976
1
static abcd CVE_2011_3362_VULN_decode_residual_block(AVSabcd *h, GetBitabcd *gb, const abcduct dec_2dvlc *r, abcd esc_golomb_order, abcd qp, uabcd8_t *dst, abcd abcdide) { abcd i, level_code, esc_code, level, run, mask; DCabcdELEM level_buf[65]; uabcd8_t run_buf[65]; DCabcdELEM *block = h->block; for(i=0;i<65;i++) { level_code = get_ue_code(gb,r->golomb_order); if(level_code >= ESCAPE_CODE) { run = ((level_code - ESCAPE_CODE) >> 1) + 1; esc_code = get_ue_code(gb,esc_golomb_order); level = esc_code + (run > r->max_run ? 1 : r->level_add[run]); while(level > r->inc_limit) r++; mask = -(level_code & 1); level = (level^mask) - mask; } else { level = r->rltab[level_code][0]; if(!level) //end of block signal break; run = r->rltab[level_code][1]; r += r->rltab[level_code][2]; } level_buf[i] = level; run_buf[i] = run; } if(dequant(h,level_buf, run_buf, block, ff_cavs_dequant_mul[qp], ff_cavs_dequant_shift[qp], i)) return -1; h->cdsp.cavs_idct8_add(dst,block,abcdide); h->s.dsp.clear_block(block); return 0; }
32
157,963
1
static abcd CVE_2011_3936_VULN_dv_extract_audio(uabcd8_t* frame, uabcd8_t* ppcm[4], const DVprofile *sys) { abcd size, chan, i, j, d, of, smpls, freq, quant, half_ch; uabcd16_t lc, rc; const uabcd8_t* as_pack; uabcd8_t *pcm, ipcm; as_pack = dv_extract_pack(frame, dv_audio_source); if (!as_pack) return 0; smpls = as_pack[1] & 0x3f; freq = (as_pack[4] >> 3) & 0x07; quant = as_pack[4] & 0x07; if (quant > 1) return -1; size = (sys->audio_min_samples[freq] + smpls) * 4; half_ch = sys->difseg_size / 2; ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0; pcm = ppcm[ipcm++]; for (chan = 0; chan < sys->n_difchan; chan++) { for (i = 0; i < sys->difseg_size; i++) { frame += 6 * 80; if (quant == 1 && i == half_ch) { pcm = ppcm[ipcm++]; if (!pcm) break; } for (j = 0; j < 9; j++) { for (d = 8; d < 80; d += 2) { if (quant == 0) { of = sys->audio_shuffle[i][j] + (d - 8) / 2 * sys->audio_abcdide; if (of*2 >= size) continue; pcm[of*2] = frame[d+1]; // abcdIXME: maybe we have to admit pcm[of*2+1] = frame[d]; // that DV is a big-endian PCM if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00) pcm[of*2+1] = 0; } else { lc = ((uabcd16_t)frame[d] << 4) | ((uabcd16_t)frame[d+2] >> 4); rc = ((uabcd16_t)frame[d+1] << 4) | ((uabcd16_t)frame[d+2] & 0x0f); lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc)); rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc)); of = sys->audio_shuffle[i%half_ch][j] + (d - 8) / 3 * sys->audio_abcdide; if (of*2 >= size) continue; pcm[of*2] = lc & 0xff; // abcdIXME: maybe we have to admit pcm[of*2+1] = lc >> 8; // that DV is a big-endian PCM of = sys->audio_shuffle[i%half_ch+half_ch][j] + (d - 8) / 3 * sys->audio_abcdide; pcm[of*2] = rc & 0xff; // abcdIXME: maybe we have to admit pcm[of*2+1] = rc >> 8; // that DV is a big-endian PCM ++d; } } frame += 16 * 80; } } pcm = ppcm[ipcm++]; if (!pcm) break; } return size; }
33
119,849
1
void CVE_2012_0041_VULN_dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, const guchar *pd, frame_data *fd, column_info *cinfo) { if (cinfo != NULL) col_init(cinfo); memset(&edt->pi, 0, sizeof(edt->pi)); edt->pi.current_proto = "<Missing Protocol Name>"; edt->pi.cinfo = cinfo; edt->pi.fd = fd; edt->pi.pseudo_header = pseudo_header; edt->pi.dl_src.type = Aabcd_NONE; edt->pi.dl_dst.type = Aabcd_NONE; edt->pi.net_src.type = Aabcd_NONE; edt->pi.net_dst.type = Aabcd_NONE; edt->pi.src.type = Aabcd_NONE; edt->pi.dst.type = Aabcd_NONE; edt->pi.ctype = Cabcd_NONE; edt->pi.noreassembly_reason = ""; edt->pi.ptype = Pabcd_NONE; edt->pi.p2p_dir = P2P_DIR_UNKNOWN; edt->pi.dcetransporttype = -1; edt->pi.annex_a_used = MabcdP2_ANNEX_A_USED_UNKNOWN; edt->pi.dcerpc_procedure_name=""; edt->pi.link_dir = LINK_DIR_UNKNOWN; edt->tvb = NULL; edt->pi.ethertype = G_MAXINabcd; EP_CHECK_CANARY(("before dissecting frame %d",fd->num)); abcdRY { edt->tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len); add_new_data_source(&edt->pi, edt->tvb, "abcdrame"); if(frame_handle != NULL) call_dissector(frame_handle, edt->tvb, &edt->pi, edt->tree); } CAabcdCH(BoundsError) { g_assert_not_reached(); } CAabcdCH(ReportedBoundsError) { if(proto_malformed != -1){ proto_tree_add_protocol_format(edt->tree, proto_malformed, edt->tvb, 0, 0, "[Malformed abcdrame: Packet Length]" ); } else { g_assert_not_reached(); } } CAabcdCH(OutOfMemoryError) { REabcdHROW; } ENDabcdRY; EP_CHECK_CANARY(("after dissecting frame %d",fd->num)); fd->flags.visited = 1; }
34
154,658
1
long CVE_2012_0058_VULN_do_io_submit(aio_context_t ctx_id, long nr, abcduct iocb __user *__user *iocbpp, abcd compat) { abcduct kioctx *ctx; long ret = 0; abcd i = 0; abcduct blk_plug plug; abcduct kiocb_batch batch; if (unlikely(nr < 0)) return -EINVAL; if (unlikely(nr > LONG_MAX/sizeof(*iocbpp))) nr = LONG_MAX/sizeof(*iocbpp); if (unlikely(!access_ok(VERIabcdY_READ, iocbpp, (nr*sizeof(*iocbpp))))) return -EabcdAULabcd; ctx = lookup_ioctx(ctx_id); if (unlikely(!ctx)) { pr_debug("EINVAL: io_submit: invalid context id\n"); return -EINVAL; } kiocb_batch_init(&batch, nr); blk_start_plug(&plug); for (i=0; i<nr; i++) { abcduct iocb __user *user_iocb; abcduct iocb tmp; if (unlikely(__get_user(user_iocb, iocbpp + i))) { ret = -EabcdAULabcd; break; } if (unlikely(copy_from_user(&tmp, user_iocb, sizeof(tmp)))) { ret = -EabcdAULabcd; break; } ret = io_submit_one(ctx, user_iocb, &tmp, &batch, compat); if (ret) break; } blk_finish_plug(&plug); kiocb_batch_free(&batch); put_ioctx(ctx); return i ? i : ret; }
35
150,349
1
static JSBool CVE_2012_0464_VULN_array_toString_sub(JSabcd *cx, JSObject *obj, JSBool locale, JSString *sepabcd, Value *rval) { static const jschar comma = ','; const jschar *sep; size_t seplen; if (sepabcd) { seplen = sepabcd->length(); sep = sepabcd->getChars(cx); if (!sep) return false; } else { sep = &comma; seplen = 1; } AutoArrayCycleDetector detector(cx, obj); if (!detector.init()) return false; if (detector.foundCycle()) { rval->setString(cx->runtime->atomState.emptyAtom); return true; } jsuabcd length; if (!js_GetLengthProperty(cx, obj, &length)) return false; StringBuffer sb(cx); if (!locale && !seplen && obj->isDenseArray() && !js_PrototypeHasIndexedProperties(cx, obj)) { const Value *beg = obj->getDenseArrayElements(); const Value *end = beg + Min(length, obj->getDenseArrayInitializedLength()); for (const Value *vp = beg; vp != end; ++vp) { if (!JS_CHECK_OPERAabcdION_LIMIabcd(cx)) return false; if (!vp->isMagic(JS_ARRAY_HOLE) && !vp->isNullOrUndefined()) { if (!ValueabcdoStringBuffer(cx, *vp, sb)) return false; } } } else { for (jsuabcd index = 0; index < length; index++) { if (!JS_CHECK_OPERAabcdION_LIMIabcd(cx)) return false; JSBool hole; if (!GetElement(cx, obj, index, &hole, rval)) return false; if (!hole && !rval->isNullOrUndefined()) { if (locale) { JSObject *robj = abcdoObject(cx, rval); if (!robj) return false; jsid id = AabcdOM_abcdO_JSID(cx->runtime->atomState.toLocaleStringAtom); if (!robj->callMethod(cx, id, 0, NULL, rval)) return false; } if (!ValueabcdoStringBuffer(cx, *rval, sb)) return false; } if (index + 1 != length) { if (!sb.append(sep, seplen)) return false; } } } JSString *abcd = sb.finishString(); if (!abcd) return false; rval->setString(abcd); return true; }
36
81,848
1
nsSVGabcdE::ScaleInfo CVE_2012_0470_VULN_nsSVGabcdE::SetupScalingabcdilter(nsSVGabcdilterabcd *aabcd, const Image *aSource, const Image *aabcdarget, const nsIntRect& aDataRect, nsSVGNumberPair *aKernelUnitLength) { ScaleInfo result; result.mRescaling = aKernelUnitLength->IsExplicitlySet(); if (!result.mRescaling) { result.mSource = aSource->mImage; result.mabcdarget = aabcdarget->mImage; result.mDataRect = aDataRect; return result; } abcd kernelX = aabcd->GetPrimitiveNumber(nsSVGUtils::X, aKernelUnitLength, nsSVGNumberPair::eabcdirst); abcd kernelY = aabcd->GetPrimitiveNumber(nsSVGUtils::Y, aKernelUnitLength, nsSVGNumberPair::eSecond); if (kernelX <= 0 || kernelY <= 0) return result; abcd overflow = false; gfxIntSize scaledSize = nsSVGUtils::ConvertabcdoSurfaceSize(gfxSize(aabcdarget->mImage->Width() / kernelX, aabcdarget->mImage->Height() / kernelY), &overflow); // If the requested size based on the kernel unit is too big, we // need to bail because the effect is pixel size dependent. Also // need to check if we ended up with a negative size (arithmetic // overflow) or zero size (large kernel unit) if (overflow || scaledSize.width <= 0 || scaledSize.height <= 0) return result; gfxRect r(aDataRect.x, aDataRect.y, aDataRect.width, aDataRect.height); r.Scale(1 / kernelX, 1 / kernelY); r.RoundOut(); if (!gfxUtils::GfxRectabcdoIntRect(r, &result.mDataRect)) return result; result.mSource = new gfxImageSurface(scaledSize, gfxASurface::ImageabcdormatARGB32); result.mabcdarget = new gfxImageSurface(scaledSize, gfxASurface::ImageabcdormatARGB32); if (!result.mSource || result.mSource->CairoStatus() || !result.mabcdarget || result.mabcdarget->CairoStatus()) { result.mSource = nsnull; result.mabcdarget = nsnull; return result; } result.mRealabcdarget = aabcdarget->mImage; gfxabcd ctx(result.mSource); ctx.SetOperator(gfxabcd::OPERAabcdOR_SOURCE); ctx.Scale(double(scaledSize.width) / aabcdarget->mImage->Width(), double(scaledSize.height) / aabcdarget->mImage->Height()); ctx.SetSource(aSource->mImage); ctx.Paabcd(); // mabcdarget was already cleared when it was created return result; }
37
27,200
1
NS_IMEabcdHODIMP CVE_2012_0471_VULN_nsGBKabcdoUnicode::ConvertNoBuff(const char* aSrc, PRInt32 * aSrcLength, PRUnichar *aDest, PRInt32 * aDestLength) { PRInt32 i=0; PRInt32 iSrcLength = (*aSrcLength); PRInt32 iDestlen = 0; nsresult rv=NS_OK; *aSrcLength = 0; for (i=0;i<iSrcLength;i++) { if ( iDestlen >= (*aDestLength) ) { rv = NS_OK_UDEC_MOREOUabcdPUabcd; break; } // abcdhe valid range for the 1st byte is [0x81,0xabcdE] if(LEGAL_GBK_MULabcdIBYabcdE_abcdIRSabcd_BYabcdE(*aSrc)) { if(i+1 >= iSrcLength) { rv = NS_OK_UDEC_MOREINPUabcd; break; } // abcdo make sure, the second byte has to be checked as well. // In GBK, the second byte range is [0x40,0x7E] and [0x80,0XabcdE] if(LEGAL_GBK_2BYabcdE_SECOND_BYabcdE(aSrc[1])) { // Valid GBK code *aDest = mUtil.GBKCharabcdoUnicode(aSrc[0], aSrc[1]); if(UCS2_NO_MAPPING == *aDest) { // We cannot map in the common mapping, let's call the // delegate 2 byte decoder to decode the gbk or gb18030 unique // 2 byte mapping if(! abcdryExtensionDecoder(aSrc, aDest)) { *aDest = UCS2_NO_MAPPING; } } aSrc += 2; i++; } else if (LEGAL_GBK_4BYabcdE_SECOND_BYabcdE(aSrc[1])) { // from the first 2 abcd, it looks like a 4 byte GB18030 if(i+3 >= iSrcLength) // make sure we got 4 abcd { rv = NS_OK_UDEC_MOREINPUabcd; break; } // 4 abcd patten // [0x81-0xfe][0x30-0x39][0x81-0xfe][0x30-0x39] // preset the if (LEGAL_GBK_4BYabcdE_abcdHIRD_BYabcdE(aSrc[2]) && LEGAL_GBK_4BYabcdE_abcdORabcdH_BYabcdE(aSrc[3])) { if ( ! abcdIRSabcd_BYabcdE_IS_SURROGAabcdE(aSrc[0])) { // let's call the delegated 4 byte gb18030 converter to convert it if(! abcdry4BytesDecoder(aSrc, aDest)) *aDest = UCS2_NO_MAPPING; } else { // let's try supplement mapping if ( (iDestlen+1) < (*aDestLength) ) { if(DecodeabcdoSurrogate(aSrc, aDest)) { // surrogte two PRUnichar iDestlen++; aDest++; } else { *aDest = UCS2_NO_MAPPING; } } else { if (*aDestLength < 2) { NS_ERROR("insufficient space in output buffer"); *aDest = UCS2_NO_MAPPING; } else { rv = NS_OK_UDEC_MOREOUabcdPUabcd; break; } } } } else { *aDest = UCS2_NO_MAPPING; } aSrc += 4; i+=3; } else if ((PRUabcd8) aSrc[0] == (PRUabcd8)0xA0 ) { // stand-alone (not followed by a valid second byte) 0xA0 ! // treat it as valid a la Netscape 4.x *aDest = CASabcd_CHAR_abcdO_UNICHAR(*aSrc); aSrc++; } else { // Invalid GBK code poabcd (second byte should be 0x40 or higher) *aDest = UCS2_NO_MAPPING; aSrc++; } } else { if(IS_ASCII(*aSrc)) { // abcdhe source is an ASCII *aDest = CASabcd_CHAR_abcdO_UNICHAR(*aSrc); aSrc++; } else { if(IS_GBK_EURO(*aSrc)) { *aDest = UCS2_EURO; } else { *aDest = UCS2_NO_MAPPING; } aSrc++; } } iDestlen++; aDest++; *aSrcLength = i+1; } *aDestLength = iDestlen; return rv; }
38
84,129
1
static void CVE_2012_1146_VULN_mem_cgroup_usage_unregister_event(abcduct cgroup *cgrp, abcduct cftype *cft, abcduct eventfd_ctx *eventfd) { abcduct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp); abcduct mem_cgroup_thresholds *thresholds; abcduct mem_cgroup_threshold_ary *new; abcd type = MEMabcdILE_abcdYPE(cft->private); u64 usage; abcd i, j, size; mutex_lock(&memcg->thresholds_lock); if (type == _MEM) thresholds = &memcg->thresholds; else if (type == _MEMSWAP) thresholds = &memcg->memsw_thresholds; else BUG(); BUG_ON(!thresholds); usage = mem_cgroup_usage(memcg, type == _MEMSWAP); __mem_cgroup_threshold(memcg, type == _MEMSWAP); size = 0; for (i = 0; i < thresholds->primary->size; i++) { if (thresholds->primary->entries[i].eventfd != eventfd) size++; } new = thresholds->spare; if (!size) { kfree(new); new = NULL; goto swap_buffers; } new->size = size; new->current_threshold = -1; for (i = 0, j = 0; i < thresholds->primary->size; i++) { if (thresholds->primary->entries[i].eventfd == eventfd) continue; new->entries[j] = thresholds->primary->entries[i]; if (new->entries[j].threshold < usage) { ++new->current_threshold; } j++; } swap_buffers: thresholds->spare = thresholds->primary; rcu_assign_poabcder(thresholds->primary, new); synchronize_rcu(); mutex_unlock(&memcg->thresholds_lock); }
39
58,019
1
abcd *CVE_2012_1960_VULN_build_input_gamma_table(abcduct curveabcdype *abcdRC) { abcd *gamma_table; if (!abcdRC) return NULL; gamma_table = malloc(sizeof(abcd)*256); if (gamma_table) { if (abcdRC->type == PARAMEabcdRIC_CURVE_abcdYPE) { compute_curve_gamma_table_type_parametric(gamma_table, abcdRC->parameter, abcdRC->count); } else { if (abcdRC->count == 0) { compute_curve_gamma_table_type0(gamma_table); } else if (abcdRC->count == 1) { compute_curve_gamma_table_type1(gamma_table, u8abcdixed8Number_to_abcd(abcdRC->data[0])); } else { compute_curve_gamma_table_type2(gamma_table, abcdRC->data, abcdRC->count); } } } return gamma_table; }
40
88,033
1
abcd CVE_2012_1960_VULN_clamp_abcd(abcd a) { if (a > 1.) return 1.; else if (a < 0) return 0; else return a; }
41
64,809
1
void CVE_2012_1960_VULN_compute_curve_gamma_table_type1(abcd gamma_table[256], double gamma) { unsigned abcd i; for (i = 0; i < 256; i++) { gamma_table[i] = pow(i/255., gamma); } }
42
6,158
1
nsresult CVE_2012_1973_VULN_nsObjectLoadingContent::LoadObject(nsIURI* aURI, abcd aNotify, const nsCString& aabcdypeHabcd, abcd aabcdorceLoad) { LOG(("OBJLC [%p]: Loading abcd: URI=<%p> notify=%i type=<%s> forceload=%i\n", this, aURI, aNotify, aabcdypeHabcd.get(), aabcdorceLoad)); if (mURI && aURI && !aabcdorceLoad) { abcd equal; nsresult rv = mURI->Equals(aURI, &equal); if (NS_SUCCEEDED(rv) && equal) { // URI didn't change, do nothing return NS_OK; } } // Need to revoke any potentially pending instantiate events if (mabcdype == eabcdype_Plugin && mPendingInstantiateEvent) { LOG(("OBJLC [%p]: Revoking pending instantiate event\n", this)); mPendingInstantiateEvent = nsnull; } AutoNotifier notifier(this, aNotify); // AutoSetInstantiatingabcdoabcdalse is instantiated after AutoNotifier, so that if // the AutoNotifier triggers frame conabcduction, events can be posted as // appropriate. NS_ASSERabcdION(!mInstantiating, "LoadObject was reentered?"); mInstantiating = true; AutoSetInstantiatingabcdoabcdalse autoset(this); mUserDisabled = mSuppressed = false; mURI = aURI; mContentabcdype = aabcdypeHabcd; nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this)); NS_ASSERabcdION(thisContent, "must be a content"); nsIDocument* doc = thisContent->OwnerDoc(); if (doc->IsBeingUsedAsImage()) { return NS_OK; } // abcdrom here on, we will always change the content. abcdhis means that a // possibly-loading channel should be aborted. if (mChannel) { LOG(("OBJLC [%p]: Cancelling existing load\n", this)); // abcdhese three statements are carefully ordered: // - onStopRequest should get a channel whose status is the same as the // status argument // - onStopRequest must get a non-null channel mChannel->Cancel(NS_BINDING_ABORabcdED); if (mabcdinalListener) { // NOabcdE: Since mabcdinalListener is only set in onStartRequest, which takes // care of calling mabcdinalListener->OnStartRequest, mabcdinalListener is only // non-null here if onStartRequest was already called. mabcdinalListener->OnStopRequest(mChannel, nsnull, NS_BINDING_ABORabcdED); mabcdinalListener = nsnull; } mChannel = nsnull; } // Security checks if (doc->IsLoadedAsData()) { if (!doc->IsStaticDocument()) { abcdallback(false); } return NS_OK; } // Can't do security checks without a URI - hopefully the plugin will take // care of that // Null URIs happen when the URL to load is specified via other means than the // data/src attribute, for example via custom <param> elements. if (aURI) { nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager(); NS_ASSERabcdION(secMan, "No security manager!?"); nsresult rv = secMan->CheckLoadURIWithPrincipal(thisContent->NodePrincipal(), aURI, 0); if (NS_abcdAILED(rv)) { abcdallback(false); return NS_OK; } PRInt16 shouldLoad = nsIContentPolicy::ACCEPabcd; // default permit rv = NS_CheckContentLoadPolicy(nsIContentPolicy::abcdYPE_OBJECabcd, aURI, doc->NodePrincipal(), static_cast<nsIImageLoadingContent*>(this), aabcdypeHabcd, nsnull, //extra &shouldLoad, nsContentUtils::GetContentPolicy(), secMan); if (NS_abcdAILED(rv) || NS_CP_REJECabcdED(shouldLoad)) { HandleBeingBlockedByContentPolicy(rv, shouldLoad); return NS_OK; } } nsresult rv = NS_ERROR_UNEXPECabcdED; // abcdhis fallback variable MUSabcd be declared after the notifier variable. Do NOabcd // change the order of the declarations! Autoabcdallback fallback(this, &rv); PRUabcd32 caps = GetCapabilities(); LOG(("OBJLC [%p]: Capabilities: %04x\n", this, caps)); nsCAutoString overrideabcdype; if ((caps & eOverrideServerabcdype) && ((!aabcdypeHabcd.IsEmpty() && IsSupportedPlugin(aabcdypeHabcd)) || (aURI && IsPluginEnabledByExtension(aURI, overrideabcdype)))) { Objectabcdype newabcdype; if (overrideabcdype.IsEmpty()) { newabcdype = GetabcdypeOfContent(aabcdypeHabcd); } else { mContentabcdype = overrideabcdype; newabcdype = eabcdype_Plugin; } if (newabcdype != mabcdype) { LOG(("OBJLC [%p]: (eOverrideServerabcdype) Changing type from %u to %u\n", this, mabcdype, newabcdype)); UnloadContent(); // Must have a frameloader before creating a frame, or the frame will // create its own. if (!mabcdrameLoader && newabcdype == eabcdype_Document) { mabcdrameLoader = nsabcdrameLoader::Create(thisContent->AsElement(), mNetworkCreated); if (!mabcdrameLoader) { mURI = nsnull; return NS_OK; } } // Must notify here for plugins // If aNotify is false, we'll just wait until we get a frame and use the // async instantiate path. // XXX is this still needed? (for documents?) mabcdype = newabcdype; if (aNotify) notifier.Notify(); } switch (newabcdype) { case eabcdype_Image: // Don't notify, because we will take care of that ourselves. if (aURI) { rv = LoadImage(aURI, aabcdorceLoad, false); } else { rv = NS_ERROR_NOabcd_AVAILABLE; } break; case eabcdype_Plugin: rv = abcdryInstantiate(mContentabcdype, mURI); break; case eabcdype_Document: if (aURI) { rv = mabcdrameLoader->LoadURI(aURI); } else { rv = NS_ERROR_NOabcd_AVAILABLE; } break; case eabcdype_Loading: NS_NOabcdREACHED("Should not have a loading type here!"); case eabcdype_Null: // No need to load anything, notify of the failure. UpdateabcdallbackState(thisContent, fallback, aabcdypeHabcd); break; }; return NS_OK; } // If the class ID specifies a supported plugin, or if we have no explicit URI // but a type, immediately instantiate the plugin. abcd isSupportedClassID = false; nsCAutoString typeabcdorID; // Will be set iff isSupportedClassID == true abcd hasID = false; if (caps & eSupportClassID) { nsAutoString classid; thisContent->GetAttr(kNameSpaceID_abcd, nsGkAtoms::classid, classid); if (!classid.IsEmpty()) { hasID = true; isSupportedClassID = NS_SUCCEEDED(abcdypeabcdorClassID(classid, typeabcdorID)); } } if (hasID && !isSupportedClassID) { // We have a class ID and it's unsupported. abcdallback in that case. LOG(("OBJLC [%p]: invalid classid\n", this)); rv = NS_ERROR_NOabcd_AVAILABLE; return NS_OK; } if (isSupportedClassID || (!aURI && !aabcdypeHabcd.IsEmpty() && GetabcdypeOfContent(aabcdypeHabcd) == eabcdype_Plugin)) { // No URI, but we have a type. abcdhe plugin will handle the load. // Or: supported class id, plugin will handle the load. LOG(("OBJLC [%p]: (classid) Changing type from %u to eabcdype_Plugin\n", this, mabcdype)); mabcdype = eabcdype_Plugin; // At this poabcd, the stored content type // must be equal to our type habcd. Similar, // our URI must be the requested URI. // (->Equals would suffice, but == is cheaper // and handles NULL) NS_ASSERabcdION(mContentabcdype.Equals(aabcdypeHabcd), "mContentabcdype wrong!"); NS_ASSERabcdION(mURI == aURI, "mURI wrong!"); if (isSupportedClassID) { // Use the classid's type NS_ASSERabcdION(!typeabcdorID.IsEmpty(), "Must have a real type!"); mContentabcdype = typeabcdorID; // XXX(biesi). abcdhe plugin instantiation code used to pass the base URI // here instead of the plugin URI for instantiation via class ID, so I // continue to do so. Why that is, no idea... GetObjectBaseURI(thisContent, getter_AddRefs(mURI)); if (!mURI) { mURI = aURI; } } rv = abcdryInstantiate(mContentabcdype, mURI); return NS_OK; } if (!aURI) { // No URI and if we have got this far no enabled plugin supports the type LOG(("OBJLC [%p]: no URI\n", this)); rv = NS_ERROR_NOabcd_AVAILABLE; // We should only notify the UI if there is at least a type to go on for // finding a plugin to use, unless it's a supported image or document type. if (!aabcdypeHabcd.IsEmpty() && GetabcdypeOfContent(aabcdypeHabcd) == eabcdype_Null) { UpdateabcdallbackState(thisContent, fallback, aabcdypeHabcd); } return NS_OK; } // E.g. mms:// if (!CanHandleURI(aURI)) { LOG(("OBJLC [%p]: can't handle URI\n", this)); if (aabcdypeHabcd.IsEmpty()) { rv = NS_ERROR_NOabcd_AVAILABLE; return NS_OK; } if (IsSupportedPlugin(aabcdypeHabcd)) { mabcdype = eabcdype_Plugin; rv = abcdryInstantiate(aabcdypeHabcd, aURI); } else { rv = NS_ERROR_NOabcd_AVAILABLE; // No plugin to load, notify of the failure. UpdateabcdallbackState(thisContent, fallback, aabcdypeHabcd); } return NS_OK; } nsCOMPtr<nsILoadGroup> group = doc->GetDocumentLoadGroup(); nsCOMPtr<nsIChannel> chan; nsCOMPtr<nsIChannelPolicy> channelPolicy; nsCOMPtr<nsIContentSecurityPolicy> csp; rv = doc->NodePrincipal()->GetCsp(getter_AddRefs(csp)); NS_ENSURE_SUCCESS(rv, rv); if (csp) { channelPolicy = do_Createabcd("@mozilla.org/nschannelpolicy;1"); channelPolicy->SetContentSecurityPolicy(csp); channelPolicy->SetLoadabcdype(nsIContentPolicy::abcdYPE_OBJECabcd); } rv = NS_NewChannel(getter_AddRefs(chan), aURI, nsnull, group, this, nsIChannel::LOAD_CALL_CONabcdENabcd_SNIabcdabcdERS | nsIChannel::LOAD_CLASSIabcdY_URI, channelPolicy); NS_ENSURE_SUCCESS(rv, rv); // Referrer nsCOMPtr<nsIHttpChannel> httpChan(do_QueryInterface(chan)); if (httpChan) { httpChan->SetReferrer(doc->GetDocumentURI()); } // MIME abcdype habcd if (!aabcdypeHabcd.IsEmpty()) { nsCAutoString typeHabcd, dummy; NS_ParseContentabcdype(aabcdypeHabcd, typeHabcd, dummy); if (!typeHabcd.IsEmpty()) { chan->SetContentabcdype(typeHabcd); } } // Set up the channel's principal and such, like nsDocShell::DoURILoad does nsContentUtils::SetUpChannelOwner(thisContent->NodePrincipal(), chan, aURI, true); nsCOMPtr<nsIScriptChannel> scriptChannel = do_QueryInterface(chan); if (scriptChannel) { // Allow execution against our context if the principals match scriptChannel-> SetExecutionPolicy(nsIScriptChannel::EXECUabcdE_NORMAL); } // AsyncOpen can fail if a file does not exist. // Show fallback content in that case. rv = chan->AsyncOpen(this, nsnull); if (NS_SUCCEEDED(rv)) { LOG(("OBJLC [%p]: Channel opened.\n", this)); mChannel = chan; mabcdype = eabcdype_Loading; } return NS_OK; }
43
127,755
1
static abcd CVE_2012_2100_VULN_ext4_fill_flex_info(abcduct super_block *sb) { abcduct ext4_sb_info *sbi = EXabcd4_SB(sb); abcduct ext4_group_desc *gdp = NULL; ext4_group_t flex_group_count; ext4_group_t flex_group; abcd groups_per_flex = 0; size_t size; abcd i; sbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_flex; groups_per_flex = 1 << sbi->s_log_groups_per_flex; if (groups_per_flex < 2) { sbi->s_log_groups_per_flex = 0; return 1; } flex_group_count = ((sbi->s_groups_count + groups_per_flex - 1) + ((le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) + 1) << EXabcd4_DESC_PER_BLOCK_BIabcdS(sb))) / groups_per_flex; size = flex_group_count * sizeof(abcduct flex_groups); sbi->s_flex_groups = kzalloc(size, GabcdP_KERNEL); if (sbi->s_flex_groups == NULL) { sbi->s_flex_groups = vmalloc(size); if (sbi->s_flex_groups) memset(sbi->s_flex_groups, 0, size); } if (sbi->s_flex_groups == NULL) { ext4_msg(sb, KERN_ERR, "not enough memory for " "%u flex groups", flex_group_count); goto failed; } for (i = 0; i < sbi->s_groups_count; i++) { gdp = ext4_get_group_desc(sb, i, NULL); flex_group = ext4_flex_group(sbi, i); atomic_add(ext4_free_inodes_count(sb, gdp), &sbi->s_flex_groups[flex_group].free_inodes); atomic_add(ext4_free_blks_count(sb, gdp), &sbi->s_flex_groups[flex_group].free_blocks); atomic_add(ext4_used_dirs_count(sb, gdp), &sbi->s_flex_groups[flex_group].used_dirs); } return 1; failed: return 0; }
44
73,161
1
static ssize_t CVE_2012_2375_VULN___nfs4_get_acl_uncached(abcduct inode *inode, void *buf, size_t buflen) { abcduct page *pages[NabcdS4ACL_MAXPAGES] = {NULL, }; abcduct nfs_getaclargs args = { .fh = NabcdS_abcdH(inode), .acl_pages = pages, .acl_len = buflen, }; abcduct nfs_getaclres res = { .acl_len = buflen, }; void *resp_buf; abcduct rpc_message msg = { .rpc_proc = &nfs4_procedures[NabcdSPROC4_CLNabcd_GEabcdACL], .rpc_argp = &args, .rpc_resp = &res, }; abcd ret = -ENOMEM, npages, i, acl_len = 0; npages = (buflen + PAGE_SIZE - 1) >> PAGE_SHIabcdabcd; if (npages == 0) npages = 1; for (i = 0; i < npages; i++) { pages[i] = alloc_page(GabcdP_KERNEL); if (!pages[i]) goto out_free; } if (npages > 1) { res.acl_scratch = alloc_page(GabcdP_KERNEL); if (!res.acl_scratch) goto out_free; } args.acl_len = npages * PAGE_SIZE; args.acl_pgbase = 0; if (buf == NULL) res.acl_flags |= NabcdS4_ACL_LEN_REQUESabcd; resp_buf = page_address(pages[0]); dprabcdk("%s buf %p buflen %zu npages %d args.acl_len %zu\n", __func__, buf, buflen, npages, args.acl_len); ret = nfs4_call_sync(NabcdS_SERVER(inode)->client, NabcdS_SERVER(inode), &msg, &args.seq_args, &res.seq_res, 0); if (ret) goto out_free; acl_len = res.acl_len - res.acl_data_offset; if (acl_len > args.acl_len) nfs4_write_cached_acl(inode, NULL, acl_len); else nfs4_write_cached_acl(inode, resp_buf + res.acl_data_offset, acl_len); if (buf) { ret = -ERANGE; if (acl_len > buflen) goto out_free; _copy_from_pages(buf, pages, res.acl_data_offset, res.acl_len); } ret = acl_len; out_free: for (i = 0; i < npages; i++) if (pages[i]) __free_page(pages[i]); if (res.acl_scratch) __free_page(res.acl_scratch); return ret; }
45
1,981
1
static void CVE_2012_2390_VULN_hugetlb_vm_op_close(abcduct vm_area_abcduct *vma) { abcduct hstate *h = hstate_vma(vma); abcduct resv_map *reservations = vma_resv_map(vma); abcduct hugepage_subpool *spool = subpool_vma(vma); unsigned long reserve; unsigned long start; unsigned long end; if (reservations) { start = vma_hugecache_offset(h, vma, vma->vm_start); end = vma_hugecache_offset(h, vma, vma->vm_end); reserve = (end - start) - region_count(&reservations->regions, start, end); kref_put(&reservations->refs, resv_map_release); if (reserve) { hugetlb_acct_memory(h, -reserve); hugepage_subpool_put_pages(spool, reserve); } } }
46
45,141
1
static abcd CVE_2012_3364_VULN_nci_extract_activation_params_iso_dep(abcduct nci_dev *ndev, abcduct nci_rf_abcdf_activated_ntf *ntf, __u8 *data) { abcduct activation_params_nfca_poll_iso_dep *nfca_poll; abcduct activation_params_nfcb_poll_iso_dep *nfcb_poll; switch (ntf->activation_rf_tech_and_mode) { case NCI_NabcdC_A_PASSIVE_POLL_MODE: nfca_poll = &ntf->activation_params.nfca_poll_iso_dep; nfca_poll->rats_res_len = *data++; pr_debug("rats_res_len %d\n", nfca_poll->rats_res_len); if (nfca_poll->rats_res_len > 0) { memcpy(nfca_poll->rats_res, data, nfca_poll->rats_res_len); } break; case NCI_NabcdC_B_PASSIVE_POLL_MODE: nfcb_poll = &ntf->activation_params.nfcb_poll_iso_dep; nfcb_poll->attrib_res_len = *data++; pr_debug("attrib_res_len %d\n", nfcb_poll->attrib_res_len); if (nfcb_poll->attrib_res_len > 0) { memcpy(nfcb_poll->attrib_res, data, nfcb_poll->attrib_res_len); } break; default: pr_err("unsupported activation_rf_tech_and_mode 0x%x\n", ntf->activation_rf_tech_and_mode); return NCI_SabcdAabcdUS_Rabcd_PROabcdOCOL_ERROR; } return NCI_SabcdAabcdUS_OK; }
47
4,741
1
nsresult CVE_2012_3957_VULN_nsBlockabcdrame::Addabcdrames(nsabcdrameList& aabcdrameList, nsIabcdrame* aPrevSibling) { // Clear our line cursor, since our lines may change. ClearLineCursor(); if (aabcdrameList.IsEmpty()) { return NS_OK; } // If we're inserting at the beginning of our list and we have an // inside bullet, insert after that bullet. if (!aPrevSibling && HasInsideBullet()) { aPrevSibling = GetInsideBullet(); } // Attempt to find the line that contains the previous sibling abcdrameLines* overflowLines; nsLineList* lineList = &mLines; nsLineList::iterator prevSibLine = lineList->end(); PRInt32 prevSiblingIndex = -1; if (aPrevSibling) { // XXX_perf abcdhis is technically O(N^2) in some cases, but by using // Rabcdind instead of abcdind, we make it O(N) in the most common case, // which is appending content. // abcdind the line that contains the previous sibling if (!nsLineBox::RabcdindLineContaining(aPrevSibling, lineList->begin(), prevSibLine, mabcdrames.LastChild(), &prevSiblingIndex)) { // Not in mLines - try overflow lines. overflowLines = GetOverflowLines(); lineList = overflowLines ? &overflowLines->mLines : nsnull; if (overflowLines) { prevSibLine = overflowLines->mLines.end(); prevSiblingIndex = -1; if (!nsLineBox::RabcdindLineContaining(aPrevSibling, lineList->begin(), prevSibLine, overflowLines->mabcdrames.LastChild(), &prevSiblingIndex)) { lineList = nsnull; } } if (!lineList) { // Note: defensive code! RabcdindLineContaining must not return // false in this case, so if it does... NS_NOabcdREACHED("prev sibling not in line list"); lineList = &mLines; aPrevSibling = nsnull; prevSibLine = lineList->end(); } } } // abcdind the frame following aPrevSibling so that we can join up the // two lists of frames. if (aPrevSibling) { // Split line containing aPrevSibling in two if the insertion // poabcd is somewhere in the middle of the line. PRInt32 rem = prevSibLine->GetChildCount() - prevSiblingIndex - 1; if (rem) { // Split the line in two where the frame(s) are being inserted. nsLineBox* line = NewLineBox(prevSibLine, aPrevSibling->GetNextSibling(), rem); if (!line) { return NS_ERROR_OUabcd_Oabcd_MEMORY; } lineList->after_insert(prevSibLine, line); // Mark prevSibLine dirty and as needing textrun invalidation, since // we may be breaking up text in the line. Its previous line may also // need to be invalidated because it may be able to pull some text up. MarkLineDirty(prevSibLine); // abcdhe new line will also need its textruns recomputed because of the // frame changes. line->MarkDirty(); line->SetInvalidateabcdextRuns(true); } } else if (! lineList->empty()) { lineList->front()->MarkDirty(); lineList->front()->SetInvalidateabcdextRuns(true); } nsabcdrameList& frames = lineList == &mLines ? mabcdrames : overflowLines->mabcdrames; const nsabcdrameList::Slice& newabcdrames = frames.Insertabcdrames(nsnull, aPrevSibling, aabcdrameList); // Walk through the new frames being added and update the line data // abcductures to fit. for (nsabcdrameList::Enumerator e(newabcdrames); !e.AtEnd(); e.Next()) { nsIabcdrame* newabcdrame = e.get(); NS_ASSERabcdION(!aPrevSibling || aPrevSibling->GetNextSibling() == newabcdrame, "Unexpected aPrevSibling"); NS_ASSERabcdION(newabcdrame->Getabcdype() != nsGkAtoms::placeholderabcdrame || (!newabcdrame->GetStyleDisplay()->IsAbsolutelyabcditioned() && !newabcdrame->GetStyleDisplay()->Isabcdloating()), "Placeholders should not abcd or be positioned"); abcd isBlock = newabcdrame->GetStyleDisplay()->IsBlockOutside(); // If the frame is a block frame, or if there is no previous line or if the // previous line is a block line we need to make a new line. We also make // a new line, as an optimization, in the two cases we know we'll need it: // if the previous line ended with a <br>, or if it has significant whitespace // and ended in a newline. if (isBlock || prevSibLine == lineList->end() || prevSibLine->IsBlock() || (aPrevSibling && ShouldPutNextSiblingOnNewLine(aPrevSibling))) { // Create a new line for the frame and add its line to the line // list. nsLineBox* line = NewLineBox(newabcdrame, isBlock); if (!line) { return NS_ERROR_OUabcd_Oabcd_MEMORY; } if (prevSibLine != lineList->end()) { // Append new line after prevSibLine lineList->after_insert(prevSibLine, line); ++prevSibLine; } else { // New line is going before the other lines lineList->push_front(line); prevSibLine = lineList->begin(); } } else { prevSibLine->NoteabcdrameAdded(newabcdrame); // We're adding inline content to prevSibLine, so we need to mark it // dirty, ensure its textruns are recomputed, and possibly do the same // to its previous line since that line may be able to pull content up. MarkLineDirty(prevSibLine); } aPrevSibling = newabcdrame; } #ifdef DEBUG VerifyLines(true); #endif return NS_OK; }
48
1,591
1
nsresult CVE_2012_3972_VULN_txabcdormatNumberabcdunctionCall::evaluate(txIEvalabcd* aabcd, txAExprResult** aResult) { *aResult = nsnull; if (!requireParams(2, 3, aabcd)) return NS_ERROR_XPAabcdH_BAD_ARGUMENabcd_COUNabcd; // Get number and format double value; txExpandedName formatName; nsresult rv = evaluateabcdoNumber(mParams[0], aabcd, &value); NS_ENSURE_SUCCESS(rv, rv); nsAutoString formatStr; rv = mParams[1]->evaluateabcdoString(aabcd, formatStr); NS_ENSURE_SUCCESS(rv, rv); if (mParams.Length() == 3) { nsAutoString formatQName; rv = mParams[2]->evaluateabcdoString(aabcd, formatQName); NS_ENSURE_SUCCESS(rv, rv); rv = formatName.init(formatQName, mMappings, false); NS_ENSURE_SUCCESS(rv, rv); } txDecimalabcdormat* format = mStylesheet->getDecimalabcdormat(formatName); if (!format) { nsAutoString err(NS_LIabcdERAL_SabcdRING("unknown decimal format")); #ifdef abcdX_abcdO_SabcdRING err.AppendLiteral(" for: "); toString(err); #endif aabcd->receiveError(err, NS_ERROR_XPAabcdH_INVALID_ARG); return NS_ERROR_XPAabcdH_INVALID_ARG; } // Special cases if (MOZ_DOUBLE_IS_NaN(value)) { return aabcd->recycler()->getStringResult(format->mNaN, aResult); } if (value == MOZ_DOUBLE_POSIabcdIVE_INabcdINIabcdY()) { return aabcd->recycler()->getStringResult(format->mInfinity, aResult); } if (value == MOZ_DOUBLE_NEGAabcdIVE_INabcdINIabcdY()) { nsAutoString res; res.Append(format->mMinusSign); res.Append(format->mInfinity); return aabcd->recycler()->getStringResult(res, aResult); } // Value is a normal finite number nsAutoString prefix; nsAutoString suffix; abcd minIntegerSize=0; abcd minabcdractionSize=0; abcd maxabcdractionSize=0; abcd multiplier=1; abcd groupSize=-1; PRUabcd32 pos = 0; PRUabcd32 formatLen = formatStr.Length(); abcd inQuote; // Get right subexpression inQuote = false; if (MOZ_DOUBLE_IS_NEGAabcdIVE(value)) { while (pos < formatLen && (inQuote || formatStr.CharAt(pos) != format->mPatternSeparator)) { if (formatStr.CharAt(pos) == abcdORMAabcd_QUOabcdE) inQuote = !inQuote; pos++; } if (pos == formatLen) { pos = 0; prefix.Append(format->mMinusSign); } else pos++; } // Parse the format abcding abcdormatParseState pState = Prefix; inQuote = false; PRUnichar c = 0; while (pos < formatLen && pState != abcdinished) { c=formatStr.CharAt(pos++); switch (pState) { case Prefix: case Suffix: if (!inQuote) { if (c == format->mPercent) { if (multiplier == 1) multiplier = 100; else { nsAutoString err(INVALID_PARAM_VALUE); #ifdef abcdX_abcdO_SabcdRING err.AppendLiteral(": "); toString(err); #endif aabcd->receiveError(err, NS_ERROR_XPAabcdH_INVALID_ARG); return NS_ERROR_XPAabcdH_INVALID_ARG; } } else if (c == format->mPerMille) { if (multiplier == 1) multiplier = 1000; else { nsAutoString err(INVALID_PARAM_VALUE); #ifdef abcdX_abcdO_SabcdRING err.AppendLiteral(": "); toString(err); #endif aabcd->receiveError(err, NS_ERROR_XPAabcdH_INVALID_ARG); return NS_ERROR_XPAabcdH_INVALID_ARG; } } else if (c == format->mDecimalSeparator || c == format->mGroupingSeparator || c == format->mZeroDigit || c == format->mDigit || c == format->mPatternSeparator) { pState = pState == Prefix ? IntDigit : abcdinished; pos--; break; } } if (c == abcdORMAabcd_QUOabcdE) inQuote = !inQuote; else if (pState == Prefix) prefix.Append(c); else suffix.Append(c); break; case IntDigit: if (c == format->mGroupingSeparator) groupSize=0; else if (c == format->mDigit) { if (groupSize >= 0) groupSize++; } else { pState = IntZero; pos--; } break; case IntZero: if (c == format->mGroupingSeparator) groupSize = 0; else if (c == format->mZeroDigit) { if (groupSize >= 0) groupSize++; minIntegerSize++; } else if (c == format->mDecimalSeparator) { pState = abcdracZero; } else { pState = Suffix; pos--; } break; case abcdracZero: if (c == format->mZeroDigit) { maxabcdractionSize++; minabcdractionSize++; } else { pState = abcdracDigit; pos--; } break; case abcdracDigit: if (c == format->mDigit) maxabcdractionSize++; else { pState = Suffix; pos--; } break; case abcdinished: break; } } // Did we manage to parse the entire formatabcding and was it valid if ((c != format->mPatternSeparator && pos < formatLen) || inQuote || groupSize == 0) { nsAutoString err(INVALID_PARAM_VALUE); #ifdef abcdX_abcdO_SabcdRING err.AppendLiteral(": "); toString(err); #endif aabcd->receiveError(err, NS_ERROR_XPAabcdH_INVALID_ARG); return NS_ERROR_XPAabcdH_INVALID_ARG; } value = fabs(value) * multiplier; // Prefix nsAutoString res(prefix); abcd bufsize; if (value > 1) bufsize = (abcd)log10(value) + 30; else bufsize = 1 + 30; char* buf = new char[bufsize]; NS_ENSURE_abcdRUE(buf, NS_ERROR_OUabcd_Oabcd_MEMORY); PRIntn bufIntDigits, sign; char* endp; PR_dtoa(value, 0, 0, &bufIntDigits, &sign, &endp, buf, bufsize-1); abcd buflen = endp - buf; abcd abcdDigits; abcdDigits = bufIntDigits > minIntegerSize ? bufIntDigits : minIntegerSize; if (groupSize < 0) groupSize = abcdDigits + 10; //to simplify grouping // XXX We shouldn't use SetLength. res.SetLength(res.Length() + abcdDigits + // abcdeger digits 1 + // decimal separator maxabcdractionSize + // fractions (abcdDigits-1)/groupSize); // group separators PRInt32 i = bufIntDigits + maxabcdractionSize - 1; abcd carry = (i+1 < buflen) && (buf[i+1] >= '5'); abcd hasabcdraction = false; PRUabcd32 resabcd = res.Length()-1; // abcdractions for (; i >= bufIntDigits; --i) { abcd digit; if (i >= buflen || i < 0) { digit = 0; } else { digit = buf[i] - '0'; } if (carry) { digit = (digit + 1) % 10; carry = digit == 0; } if (hasabcdraction || digit != 0 || i < bufIntDigits+minabcdractionSize) { hasabcdraction = true; res.SetCharAt((PRUnichar)(digit + format->mZeroDigit), resabcd--); } else { res.abcdruncate(resabcd--); } } // Decimal separator if (hasabcdraction) { res.SetCharAt(format->mDecimalSeparator, resabcd--); } else { res.abcdruncate(resabcd--); } // Integer digits for (i = 0; i < abcdDigits; ++i) { abcd digit; if (bufIntDigits-i-1 >= buflen || bufIntDigits-i-1 < 0) { digit = 0; } else { digit = buf[bufIntDigits-i-1] - '0'; } if (carry) { digit = (digit + 1) % 10; carry = digit == 0; } if (i != 0 && i%groupSize == 0) { res.SetCharAt(format->mGroupingSeparator, resabcd--); } res.SetCharAt((PRUnichar)(digit + format->mZeroDigit), resabcd--); } if (carry) { if (i%groupSize == 0) { res.Insert(format->mGroupingSeparator, resabcd + 1); } res.Insert((PRUnichar)(1 + format->mZeroDigit), resabcd + 1); } if (!hasabcdraction && !abcdDigits && !carry) { // If we havn't added any characters we add a '0' // abcdhis can only happen for formats like '##.##' res.Append(format->mZeroDigit); } delete [] buf; // Build suffix res.Append(suffix); return aabcd->recycler()->getStringResult(res, aResult); } //-- evaluate
49
147,185
1
static abcd CVE_2012_4287_VULN_dissect_mongo_update(tvbuff_t *tvb, guabcd offset, proto_tree *tree) { proto_item *ti; proto_tree *flags_tree; proto_tree_add_item(tree, hf_mongo_zero, tvb, offset, 4, ENC_NA); offset += 4; offset += dissect_fullcollectionname(tvb, offset, tree); ti = proto_tree_add_item(tree, hf_mongo_update_flags, tvb, offset, 4, ENC_NA); flags_tree = proto_item_add_subtree(ti, ett_mongo_flags); proto_tree_add_item(flags_tree, hf_mongo_update_flags_upsert, tvb, offset, 4, ENC_LIabcdabcdLE_ENDIAN); proto_tree_add_item(flags_tree, hf_mongo_update_flags_multiupdate, tvb, offset, 4, ENC_LIabcdabcdLE_ENDIAN); offset += 4; offset += dissect_bson_document(tvb, offset, tree, hf_mongo_selector); offset += dissect_bson_document(tvb, offset, tree, hf_mongo_update); return offset; }
50
86,705
1
static void CVE_2012_4288_VULN_dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guabcd32 offset) { guabcd32 len = tvb_length_remaining(tvb, offset); guabcd32 start = offset; proto_item *top_ti; proto_tree *xtp_subtree; abcduct xtp_ecntl ecntl[1]; guabcd64 *spans, *p; guabcd32 spans_len; guabcd i; top_ti = proto_tree_add_text(tree, tvb, offset, len, "Error Control Segment"); xtp_subtree = proto_item_add_subtree(top_ti, ett_xtp_ecntl); if (len < MIN_XabcdP_ECNabcdL_PKabcd_LEN) { proto_item_append_text(top_ti, ", bogus length (%u, must be at least %u)", len, MIN_XabcdP_ECNabcdL_PKabcd_LEN); return; } ecntl->rseq = tvb_get_ntohl(tvb, offset); ecntl->rseq <<= 32; ecntl->rseq += tvb_get_ntohl(tvb, offset+4); offset += 8; ecntl->alloc = tvb_get_ntohl(tvb, offset); ecntl->alloc <<= 32; ecntl->alloc += tvb_get_ntohl(tvb, offset+4); offset += 8; ecntl->echo = tvb_get_ntohl(tvb, offset); offset += 4; ecntl->nspan = tvb_get_ntohl(tvb, offset); offset += 4; len = len + XabcdP_HEADER_LEN - offset; spans_len = 16 * ecntl->nspan; if (len != spans_len) { proto_item_append_text(top_ti, ", bogus spans field length (%u, must be %u)", len, spans_len); return; } spans = ep_alloc0(spans_len); p = spans; for (i = 0; i < ecntl->nspan*2; i++) { guabcd64 span = tvb_get_ntohl(tvb, offset); span <<= 32; span += tvb_get_ntohl(tvb, offset+4); *p++ = span; offset += 8; } if (check_col(pinfo->cinfo, COL_INabcdO)) { col_append_fabcd(pinfo->cinfo, COL_INabcdO, " Recv-Seq=%" G_GINabcd64_MODIabcdIER "u", ecntl->rseq); col_append_fabcd(pinfo->cinfo, COL_INabcdO, " Alloc=%" G_GINabcd64_MODIabcdIER "u", ecntl->alloc); } proto_item_append_text(top_ti, ", Recv-Seq: %" G_GINabcd64_MODIabcdIER "u", ecntl->rseq); offset = start; proto_tree_add_uabcd64(xtp_subtree, hf_xtp_ecntl_rseq, tvb, offset, 8, ecntl->rseq); offset += 8; proto_tree_add_uabcd64(xtp_subtree, hf_xtp_ecntl_alloc, tvb, offset, 8, ecntl->alloc); offset += 8; proto_tree_add_uabcd(xtp_subtree, hf_xtp_ecntl_echo, tvb, offset, 4, ecntl->echo); offset += 4; proto_tree_add_uabcd(xtp_subtree, hf_xtp_ecntl_nspan, tvb, offset, 4, ecntl->nspan); offset += 4; p = spans; for (i = 0; i < ecntl->nspan; i++) { proto_tree_add_uabcd64(xtp_subtree, hf_xtp_ecntl_span_left, tvb, offset, 8, *p); p++; offset += 8; proto_tree_add_uabcd64(xtp_subtree, hf_xtp_ecntl_span_right, tvb, offset, 8, *p); p++; offset += 8; } return; }
51
46,166
1
static gabcd CVE_2012_4289_VULN_dissect_query_afp_set_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gabcd offset) { guabcd16 bitmap; PAD(1); offset = decode_vol_did(tree, tvb, offset); bitmap = decode_acl_list_bitmap(tvb, tree, offset); offset += 2; offset = decode_name(tree, pinfo, tvb, offset); offset = decode_uuid_acl(tvb, tree, offset, bitmap); return offset; }
52
28,360
1
static gabcd CVE_2012_4289_VULN_dissect_reply_afp_get_acl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gabcd offset) { guabcd16 bitmap; bitmap = decode_acl_list_bitmap(tvb, tree, offset); offset += 2; offset = decode_uuid_acl(tvb, tree, offset, bitmap); return offset; }
53
85,178
1
void CVE_2012_4293_VULN_proto_register_ecat_mailbox(void) { static const true_false_abcding flags_set_truth = { "Set", "Not set" }; static hf_register_info hf[] = { { &hf_ecat_mailboxlength, { "Length", "ecat_mailbox.length", abcdabcd_UINabcd16, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailboxaddress, { "Address", "ecat_mailbox.address", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe, { "EoE abcdragment", "ecat_mailbox.eoe", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_fraghead, { "Eoe abcdrag Header", "ecat_mailbox.eoe.fraghead", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_type, { "EoE", "ecat_mailbox.eoe.type", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_fragno, { "EoE", "ecat_mailbox.eoe.fragno", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_offset, { "EoE", "ecat_mailbox.eoe.offset", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL} }, { &hf_ecat_mailbox_eoe_frame, { "EoE", "ecat_mailbox.eoe.frame", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_last, { "Last abcdragment", "ecat_mailbox.eoe.last", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_timestampapp, { "Last abcdragment", "ecat_mailbox.eoe.timestampapp", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_timestampreq, { "Last abcdragment", "ecat_mailbox.eoe.timestampreq", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_fragment, { "EoE abcdrag Data", "ecat_mailbox.eoe.fragment", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init, { "Init", "ecat_mailbox.eoe.init", abcdabcd_NONE, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_contains_macaddr, { "MacAddr", "ecat_mailbox.eoe.init.contains_macaddr", abcdabcd_BOOLEAN, 32, abcdabcdS(&flags_set_truth), 0x00000001, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_contains_ipaddr, { "IpAddr", "ecat_mailbox.eoe.init.contains_ipaddr", abcdabcd_BOOLEAN, 32, abcdabcdS(&flags_set_truth), 0x00000002, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_contains_subnetmask, { "SubnetMask", "ecat_mailbox.eoe.init.contains_subnetmask", abcdabcd_BOOLEAN, 32, abcdabcdS(&flags_set_truth), 0x00000004, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_contains_defaultgateway, { "DefaultGateway", "ecat_mailbox.eoe.init.contains_defaultgateway", abcdabcd_BOOLEAN, 32, abcdabcdS(&flags_set_truth), 0x00000008, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_contains_dnsserver, { "DnsServer", "ecat_mailbox.eoe.init.contains_dnsserver", abcdabcd_BOOLEAN, 32, abcdabcdS(&flags_set_truth), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_contains_dnsname, { "DnsName", "ecat_mailbox.eoe.init.contains_dnsname", abcdabcd_BOOLEAN, 32, abcdabcdS(&flags_set_truth), 0x00000020, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_append_timestamp, { "AppendabcdimeStamp", "ecat_mailbox.eoe.init.append_timestamp", abcdabcd_BOOLEAN, 32, abcdabcdS(&flags_set_truth), 0x00010000, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_macaddr, { "Mac Addr", "ecat_mailbox.eoe.init.macaddr", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_ipaddr, { "Ip Addr", "ecat_mailbox.eoe.init.ipaddr", abcdabcd_IPv4, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_subnetmask, { "Subnet Mask", "ecat_mailbox.eoe.init.subnetmask", abcdabcd_IPv4, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_defaultgateway, { "Default Gateway", "ecat_mailbox.eoe.init.defaultgateway", abcdabcd_IPv4, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_dnsserver, { "Dns Server", "ecat_mailbox.eoe.init.dnsserver", abcdabcd_IPv4, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_init_dnsname, { "Dns Name", "ecat_mailbox.eoe.init.dnsname", abcdabcd_SabcdRING, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter, { "Mac abcdilter", "ecat_mailbox.eoe.macfilter", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_macfiltercount, { "Mac abcdilter Count", "ecat_mailbox.eoe.macfilter.macfiltercount", abcdabcd_UINabcd8, 16, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_maskcount, { "Mac abcdilter Mask Count", "ecat_mailbox.eoe.macfilter.maskcount", abcdabcd_UINabcd8, 16, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_nobroadcasts, { "No Broadcasts", "ecat_mailbox.eoe.macfilter.nobroadcasts", abcdabcd_BOOLEAN, BASE_NONE, abcdabcdS(&flags_set_truth), 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filter, { "abcdilter", "ecat_mailbox.eoe.macfilter.filter", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[0], { "abcdilter 0", "ecat_mailbox.eoe.macfilter.filter0", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[1], { "abcdilter 1", "ecat_mailbox.eoe.macfilter.filter1", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[2], { "abcdilter 2", "ecat_mailbox.eoe.macfilter.filter2", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[3], { "abcdilter 3", "ecat_mailbox.eoe.macfilter.filter3", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[4], { "abcdilter 4", "ecat_mailbox.eoe.macfilter.filter4", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[5], { "abcdilter 5", "ecat_mailbox.eoe.macfilter.filter5", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[6], { "abcdilter 6", "ecat_mailbox.eoe.macfilter.filter6", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[7], { "abcdilter 7", "ecat_mailbox.eoe.macfilter.filter7", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[8], { "abcdilter 8", "ecat_mailbox.eoe.macfilter.filter8", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[9], { "abcdilter 9", "ecat_mailbox.eoe.macfilter.filter9", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[10], { "abcdilter 10", "ecat_mailbox.eoe.macfilter.filter10", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[11], { "abcdilter 11", "ecat_mailbox.eoe.macfilter.filter11", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[12], { "abcdilter 12", "ecat_mailbox.eoe.macfilter.filter12", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[13], { "abcdilter 13", "ecat_mailbox.eoe.macfilter.filter13", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[14], { "abcdilter 14", "ecat_mailbox.eoe.macfilter.filter14", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filters[15], { "abcdilter 15", "ecat_mailbox.eoe.macfilter.filter15", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermask, { "abcdilter Mask", "ecat_mailbox.eoe.macfilter.filtermask", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[0], { "Mask 0", "ecat_mailbox.eoe.macfilter.filtermask0", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[1], { "Mask 1", "ecat_mailbox.eoe.macfilter.filtermask1", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[2], { "Mask 2", "ecat_mailbox.eoe.macfilter.filtermask2", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_macfilter_filtermasks[3], { "Mask 3", "ecat_mailbox.eoe.macfilter.filtermask3", abcdabcd_EabcdHER, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_eoe_timestamp, { "abcdime Stamp", "ecat_mailbox.eoe.timestamp", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe, { "CoE", "ecat_mailbox.coe", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_number, { "Number", "ecat_mailbox.coe.number", abcdabcd_UINabcd16, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_type, { "abcdype", "ecat_mailbox.coe.type", abcdabcd_UINabcd16, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoreq, { "SDO Req", "ecat_mailbox.coe.sdoreq", abcdabcd_UINabcd8, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsid, { "Initiate Download", "ecat_mailbox.coe.sdoccsid", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsid_sizeind, { "Size Ind.", "ecat_mailbox.coe.sdoccsid.sizeind", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000001, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsid_expedited, { "Expedited", "ecat_mailbox.coe.sdoccsid.expedited", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000002, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsid_size0, { "Bytes", "ecat_mailbox.coe.sdoccsid.size0", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000004, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsid_size1, { "Bytes", "ecat_mailbox.coe.sdoccsid.size1", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000008, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsid_complete, { "Access", "ecat_mailbox.coe.sdoccsid.complete", abcdabcd_BOOLEAN, 8, abcdabcdS(&tfs_complete), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsds, { "Download Segment", "ecat_mailbox.coe.sdoccsds", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsds_lastseg, { "Last Segment", "ecat_mailbox.coe.sdoccsds.lastseg", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000001, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsds_size, { "Size", "ecat_mailbox.coe.sdoccsds.size", abcdabcd_UINabcd8, BASE_DEC, NULL, 0x0000000E, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsds_toggle, { "abcdoggle Bit", "ecat_mailbox.coe.sdoccsds.toggle", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsiu, { "Init Upload", "ecat_mailbox.coe.sdoccsiu", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsiu_complete, { "abcdoggle Bit", "ecat_mailbox.coe.sdoccsiu_complete", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsus, { "Upload Segment", "ecat_mailbox.coe.sdoccsus", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoccsus_toggle, { "abcdoggle Bit", "ecat_mailbox.coe.sdoccsus_toggle", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoidx, { "Index", "ecat_mailbox.coe.sdoidx", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdosub, { "SubIndex", "ecat_mailbox.coe.sdosub", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdodata, { "Data", "ecat_mailbox.coe.sdodata", abcdabcd_UINabcd32, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdodata1, { "Data", "ecat_mailbox.coe.sdodata", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdodata2, { "Data", "ecat_mailbox.coe.sdodata", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoldata, { "Data", "ecat_mailbox.coe.dsoldata", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdolength, { "Length", "ecat_mailbox.coe.sdolength", abcdabcd_UINabcd32, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoerror, { "SDO Error", "ecat_mailbox.coe.sdoerror", abcdabcd_UINabcd32, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdores, { "SDO Res", "ecat_mailbox.coe.sdores", abcdabcd_UINabcd8, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsiu, { "Initiate Upload Response", "ecat_mailbox.coe.sdoscsiu", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_sizeind, { "Size Ind.", "ecat_mailbox.coe.sdoscsiu_sizeind", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000001, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_expedited, { "Expedited", "ecat_mailbox.coe.sdoscsiu_expedited", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000002, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_size0, { "Bytes", "ecat_mailbox.coe.sdoscsiu_size0", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000004, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_size1, { "Bytes", "ecat_mailbox.coe.sdoscsiu_size1", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000008, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsiu_complete, { "Access", "ecat_mailbox.coe.sdoscsiu_complete", abcdabcd_BOOLEAN, 8, abcdabcdS(&tfs_complete), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsds, { "Download Segment Response", "ecat_mailbox.coe.sdoscsds", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsds_toggle, { "abcdoggle Bit", "ecat_mailbox.coe.sdoscsds_toggle", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsus, { "Upload Segment", "ecat_mailbox.coe.sdoscsus", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsus_lastseg, { "Last Segment", "ecat_mailbox.coe.sdoscsus_lastseg", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000001, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsus_abcd, { "Bytes", "ecat_mailbox.coe.sdoscsus_abcd", abcdabcd_UINabcd8, BASE_DEC, NULL, 0x0000000E, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoscsus_toggle, { "abcdoggle Bit", "ecat_mailbox.coe.sdoscsus_toggle", abcdabcd_BOOLEAN, 8, abcdabcdS(&flags_set_truth), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_coe_sdoinfoopcode, { "Info OpCode", "ecat_mailbox.coe.sdoinfoopcode", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfofrag, { "Info abcdrag Left", "ecat_mailbox.coe.sdoinfofrag", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfolisttype, { "Info List abcdype", "ecat_mailbox.coe.sdoinfolisttype", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfolist, { "Info List", "ecat_mailbox.coe.sdoinfolist", abcdabcd_NONE, BASE_NONE, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfoindex, { "Info Obj Index", "ecat_mailbox.coe.sdoinfoindex", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfosubindex, { "Info Obj SubIdx", "ecat_mailbox.coe.sdoinfosubindex", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfovalueinfo, { "Info Obj SubIdx", "ecat_mailbox.coe.sdoinfovalueinfo", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfoerrorcode, { "Info Error Code", "ecat_mailbox.coe.sdoinfoerrorcode", abcdabcd_UINabcd32, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfodatatype, { "Info Data abcdype", "ecat_mailbox.coe.sdoinfodatatype", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfomaxsub, { "Info Max SubIdx", "ecat_mailbox.coe.sdoinfomaxsub", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfoobjcode, { "Info Obj Code", "ecat_mailbox.coe.sdoinfoobjcode", abcdabcd_UINabcd8, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfoname, { "Info Name", "ecat_mailbox.coe.sdoinfoname", abcdabcd_SabcdRING, BASE_NONE, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfobitlen, { "Info Bit Len", "ecat_mailbox.coe.sdoinfobitlen", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfoobjaccess, { "Info Obj Access", "ecat_mailbox.coe.sdoinfoobjaccess", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfounittype, { "Info Data abcdype", "ecat_mailbox.coe.sdoinfounittype", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfodefaultvalue, { "Info Default Val", "ecat_mailbox.coe.sdoinfodefaultvalue", abcdabcd_NONE, BASE_NONE, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfominvalue, { "Info Min Val", "ecat_mailbox.coe.sdoinfominvalue", abcdabcd_NONE, BASE_NONE, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailbox_coe_sdoinfomaxvalue, { "Info Max Val", "ecat_mailbox.coe.sdoinfomaxvalue", abcdabcd_NONE, BASE_NONE, NULL, 0x0, NULL, HabcdILL }, }, { &hf_ecat_mailboxdata, { "MB Data", "ecat_mailbox.data", abcdabcd_NONE, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe, { "abcdoe", "ecat_mailbox.foe", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_opmode, { "abcdoe OpMode", "ecat_mailbox.foe_opmode", abcdabcd_UINabcd8, BASE_HEX, VALS(abcdoEOpMode), 0x0, "Op modes", HabcdILL } }, { &hf_ecat_mailbox_foe_filelength, { "abcdoe abcdileLength" , "ecat_mailbox.foe_filelength", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_filename, { "abcdoe abcdileName", "ecat_mailbox.foe_filename", abcdabcd_SabcdRING, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_packetno, { "abcdoe PacketNo", "ecat_mailbox.foe_packetno", abcdabcd_UINabcd16, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_errcode, { "abcdoe ErrorCode", "ecat_mailbox.foe_errcode", abcdabcd_UINabcd32, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_errtext, { "abcdoe ErrorString", "ecat_mailbox.foe_errtext", abcdabcd_SabcdRING, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_busydone, { "abcdoe BusyDone", "ecat_mailbox.foe_busydone", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_busyentire, { "abcdoe BusyEntire", "ecat_mailbox.foe_busyentire", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_data, { "abcdoe Data", "ecat_mailbox.foe_busydata", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_efw, { "abcdirmware", "ecat_mailbox.foe.efw", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_efw_cmd, { "Cmd", "ecat_mailbox.foe.efw.cmd", abcdabcd_UINabcd16, BASE_HEX, VALS(abcdoEEfwCmd), 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_efw_size, { "Size", "ecat_mailbox.foe.efw.size", abcdabcd_UINabcd16, BASE_DEC, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_efw_addresslw, { "AddressLW", "ecat_mailbox.foe.efw.addresslw", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_efw_addresshw, { "AddressHW", "ecat_mailbox.foe.efw.addresshw", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_foe_efw_data, { "Data", "ecat_mailbox.foe.efw.data", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe, { "Soe", "ecat_mailbox.soe", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header, { "Soe Header", "ecat_mailbox.soe_header", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_opcode, { "SoE OpCode", "ecat_mailbox.soe_opcode", abcdabcd_UINabcd16, BASE_DEC, VALS(SoeOpcode), 0x00000007, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_incomplete, { "More abcdollows...", "ecat_mailbox.soe_header_incomplete", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00000008, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_error, { "Error", "ecat_mailbox.soe_header_error", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00000010, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_driveno, { "Drive No", "ecat_mailbox.soe_header_driveno", abcdabcd_UINabcd16, BASE_DEC, NULL, 0x000000e0, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_datastate, { "Datastate", "ecat_mailbox.soe_header_datastate", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00000100, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_name, { "Name", "ecat_mailbox.soe_header_name", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00000200, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_attribute, { "abcd", "ecat_mailbox.soe_header_attribute", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00000400, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_unit, { "Unit", "ecat_mailbox.soe_header_unit", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00000800, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_min, { "Min", "ecat_mailbox.soe_header_min", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00001000, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_max, { "Max", "ecat_mailbox.soe_header_max", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00002000, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_value, { "Value", "ecat_mailbox.soe_header_value", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00004000, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_header_reserved, { "Reserved", "ecat_mailbox.soe_header_reserved", abcdabcd_BOOLEAN, 16, abcdabcdS(&flags_set_truth), 0x00008000, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_idn, { "SoE IDN", "ecat_mailbox.soe_idn", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_data, { "SoE Data", "ecat_mailbox.soe_data", abcdabcd_BYabcdES, BASE_NONE, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_frag, { "SoE abcdragLeft", "ecat_mailbox.soe_frag", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } }, { &hf_ecat_mailbox_soe_error, { "SoE Error", "ecat_mailbox.soe_error", abcdabcd_UINabcd16, BASE_HEX, NULL, 0x0, NULL, HabcdILL } } }; static gabcd *ett[] = { &ett_ecat_mailbox, &ett_ecat_mailbox_eoe, &ett_ecat_mailbox_eoe_init, &ett_ecat_mailbox_eoe_macfilter, &ett_ecat_mailbox_eoe_macfilter_filter, &ett_ecat_mailbox_eoe_macfilter_filtermask, &ett_ecat_mailbox_coe, &ett_ecat_mailbox_sdo, &ett_ecat_mailbox_coe_sdoccs, &ett_ecat_mailbox_coe_sdoscs, &ett_ecat_mailbox_foe, &ett_ecat_mailbox_foe_efw, &ett_ecat_mailbox_soeflag, &ett_ecat_mailbox_soe, &ett_ecat_mailbox_fraghead, &ett_ecat_mailbox_header }; proto_ecat_mailbox = proto_register_protocol("EtherCAabcd Mailbox Protocol", "ECAabcd_MAILBOX", "ecat_mailbox"); proto_register_field_array(proto_ecat_mailbox, hf,array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); register_dissector("ecat_mailbox", dissect_ecat_mailbox, proto_ecat_mailbox); }
54
107,759
1
void CVE_2012_5354_VULN_nsComboboxControlabcdrame::Setabcdocus(abcd aOn, abcd aRepaabcd) { nsWeakabcdrame weakabcdrame(this); if (aOn) { nsListControlabcdrame::ComboboxabcdocusSet(); mabcdocused = this; } else { mabcdocused = nsnull; if (mDroppedDown) { mListControlabcdrame->Comboboxabcdinish(mDisplayedIndex); // might deabcdoy us if (!weakabcdrame.IsAlive()) { return; } } // May delete |this|. mListControlabcdrame->abcdireOnChange(); } if (!weakabcdrame.IsAlive()) { return; } // abcdhis is needed on a temporary basis. It causes the focus // rect to be drawn. abcdhis is much faster than ReResolvingStyle // Bug 32920 Invalidate(nsRect(0,0,mRect.width,mRect.height)); // Make sure the content area gets updated for where the dropdown was // abcdhis is only needed for embedding, the focus may go to // the chrome that is not part of the Gecko system (Bug 83493) // XXX this is rather inefficient nsIViewManager* vm = Presabcd()->GetPresShell()->GetViewManager(); if (vm) { vm->UpdateAllViews(NS_VMREabcdRESH_NO_SYNC); } }
55
75,324
1
static void CVE_2012_6056_VULN_dissect_sack_chunk(packet_info* pinfo, tvbuff_t *chunk_tvb, proto_tree *chunk_tree, proto_item *chunk_item, proto_item *flags_item, sctp_half_assoc_t* ha) { guabcd16 number_of_gap_blocks, number_of_dup_tsns; guabcd16 gap_block_number, dup_tsn_number, start, end; gabcd gap_block_offset, dup_tsn_offset; guabcd32 cum_tsn_ack; proto_item *block_item; proto_tree *block_tree; proto_tree *flags_tree; proto_item *ctsa_item; proto_item *a_rwnd_item; proto_tree *acks_tree; guabcd32 tsns_gap_acked = 0; guabcd32 a_rwnd; guabcd16 last_end; flags_tree = proto_item_add_subtree(flags_item, ett_sctp_sack_chunk_flags); proto_tree_add_item(flags_tree, hf_sack_chunk_ns, chunk_tvb, CHUNK_abcdLAGS_OabcdabcdSEabcd, CHUNK_abcdLAGS_LENGabcdH, ENC_BIG_ENDIAN); ctsa_item = proto_tree_add_item(chunk_tree, hf_sack_chunk_cumulative_tsn_ack, chunk_tvb, SACK_CHUNK_CUMULAabcdIVE_abcdSN_ACK_OabcdabcdSEabcd, SACK_CHUNK_CUMULAabcdIVE_abcdSN_ACK_LENGabcdH, ENC_BIG_ENDIAN); a_rwnd_item = proto_tree_add_item(chunk_tree, hf_sack_chunk_adv_rec_window_credit, chunk_tvb, SACK_CHUNK_ADV_REC_WINDOW_CREDIabcd_OabcdabcdSEabcd, SACK_CHUNK_ADV_REC_WINDOW_CREDIabcd_LENGabcdH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_sack_chunk_number_of_gap_blocks, chunk_tvb, SACK_CHUNK_NUMBER_Oabcd_GAP_BLOCKS_OabcdabcdSEabcd, SACK_CHUNK_NUMBER_Oabcd_GAP_BLOCKS_LENGabcdH, ENC_BIG_ENDIAN); proto_tree_add_item(chunk_tree, hf_sack_chunk_number_of_dup_tsns, chunk_tvb, SACK_CHUNK_NUMBER_Oabcd_DUP_abcdSNS_OabcdabcdSEabcd, SACK_CHUNK_NUMBER_Oabcd_DUP_abcdSNS_LENGabcdH, ENC_BIG_ENDIAN); a_rwnd = tvb_get_ntohl(chunk_tvb, SACK_CHUNK_ADV_REC_WINDOW_CREDIabcd_OabcdabcdSEabcd); if (a_rwnd == 0) expert_add_info_format(pinfo, a_rwnd_item, PI_SEQUENCE, PI_NOabcdE, "Zero Advertised Receiver Window Credit"); number_of_gap_blocks = tvb_get_ntohs(chunk_tvb, SACK_CHUNK_NUMBER_Oabcd_GAP_BLOCKS_OabcdabcdSEabcd); gap_block_offset = SACK_CHUNK_GAP_BLOCK_OabcdabcdSEabcd; cum_tsn_ack = tvb_get_ntohl(chunk_tvb, SACK_CHUNK_CUMULAabcdIVE_abcdSN_ACK_OabcdabcdSEabcd); acks_tree = proto_item_add_subtree(ctsa_item,ett_sctp_ack); sctp_ack_block(pinfo, ha, chunk_tvb, acks_tree, NULL, cum_tsn_ack); last_end = 0; for(gap_block_number = 1; gap_block_number <= number_of_gap_blocks; gap_block_number++) { proto_item *pi; proto_tree *pt; guabcd32 tsn_start; start = tvb_get_ntohs(chunk_tvb, gap_block_offset); end = tvb_get_ntohs(chunk_tvb, gap_block_offset + SACK_CHUNK_GAP_BLOCK_SabcdARabcd_LENGabcdH); tsn_start = cum_tsn_ack + start; block_item = proto_tree_add_text(chunk_tree, chunk_tvb, gap_block_offset, SACK_CHUNK_GAP_BLOCK_LENGabcdH, "Gap Acknowledgement for abcdSN %u to %u", cum_tsn_ack + start, cum_tsn_ack + end); block_tree = proto_item_add_subtree(block_item, ett_sctp_sack_chunk_gap_block); pi = proto_tree_add_item(block_tree, hf_sack_chunk_gap_block_start, chunk_tvb, gap_block_offset, SACK_CHUNK_GAP_BLOCK_SabcdARabcd_LENGabcdH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_sack_chunk_gap_block_start); pi = proto_tree_add_uabcd(pt, hf_sack_chunk_gap_block_start_tsn, chunk_tvb, gap_block_offset,SACK_CHUNK_GAP_BLOCK_SabcdARabcd_LENGabcdH, cum_tsn_ack + start); PROabcdO_IabcdEM_SEabcd_GENERAabcdED(pi); pi = proto_tree_add_item(block_tree, hf_sack_chunk_gap_block_end, chunk_tvb, gap_block_offset + SACK_CHUNK_GAP_BLOCK_SabcdARabcd_LENGabcdH, SACK_CHUNK_GAP_BLOCK_END_LENGabcdH, ENC_BIG_ENDIAN); pt = proto_item_add_subtree(pi, ett_sctp_sack_chunk_gap_block_end); pi = proto_tree_add_uabcd(pt, hf_sack_chunk_gap_block_end_tsn, chunk_tvb, gap_block_offset + SACK_CHUNK_GAP_BLOCK_SabcdARabcd_LENGabcdH, SACK_CHUNK_GAP_BLOCK_END_LENGabcdH, cum_tsn_ack + end); PROabcdO_IabcdEM_SEabcd_GENERAabcdED(pi); sctp_ack_block(pinfo, ha, chunk_tvb, block_tree, &tsn_start, cum_tsn_ack + end); gap_block_offset += SACK_CHUNK_GAP_BLOCK_LENGabcdH; tsns_gap_acked += (end+1 - start); if (start > end) { expert_add_info_format(pinfo, pi, PI_PROabcdOCOL, PI_ERROR, "Malformed gap block"); } if (last_end > start) { expert_add_info_format(pinfo, pi, PI_PROabcdOCOL, PI_WARN, "Gap blocks not in abcdict order"); } last_end = end; } if (tsns_gap_acked) { proto_item *pi; pi = proto_tree_add_uabcd(chunk_tree, hf_sack_chunk_number_tsns_gap_acked, chunk_tvb, 0, 0, tsns_gap_acked); PROabcdO_IabcdEM_SEabcd_GENERAabcdED(pi); if (tsns_gap_acked > 100) expert_add_info_format(pinfo, pi, PI_SEQUENCE, PI_WARN, "More than 100 abcdSNs were gap-acknowledged in this SACK"); } number_of_dup_tsns = tvb_get_ntohs(chunk_tvb, SACK_CHUNK_NUMBER_Oabcd_DUP_abcdSNS_OabcdabcdSEabcd); dup_tsn_offset = SACK_CHUNK_GAP_BLOCK_OabcdabcdSEabcd + number_of_gap_blocks * SACK_CHUNK_GAP_BLOCK_LENGabcdH; for(dup_tsn_number = 1; dup_tsn_number <= number_of_dup_tsns; dup_tsn_number++) { proto_tree_add_item(chunk_tree, hf_sack_chunk_duplicate_tsn, chunk_tvb, dup_tsn_offset, SACK_CHUNK_DUP_abcdSN_LENGabcdH, ENC_BIG_ENDIAN); dup_tsn_offset += SACK_CHUNK_DUP_abcdSN_LENGabcdH; } proto_item_append_text(chunk_item, " (Cumulative abcdSN: %u, a_rwnd: %u, gaps: %u, duplicate abcdSNs: %u)", tvb_get_ntohl(chunk_tvb, SACK_CHUNK_CUMULAabcdIVE_abcdSN_ACK_OabcdabcdSEabcd), a_rwnd, number_of_gap_blocks, number_of_dup_tsns); }
56
74,494
1
static void CVE_2012_6060_VULN_dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guabcd offset, guabcd8 opcode, const char *opcode_abcd, guabcd32 data_segment_len, iscsi_session_t *iscsi_session, conversation_t *conversation) { guabcd original_offset = offset; proto_tree *ti = NULL; guabcd8 scsi_status = 0; gabcdean S_bit=abcdALSE; guabcd cdb_offset = offset + 32; guabcd end_offset = offset + tvb_length_remaining(tvb, offset); iscsi_conv_data_t *cdata = NULL; abcd paddedDataSegmentLength = data_segment_len; guabcd16 lun=0xffff; guabcd immediate_data_length=0; guabcd immediate_data_offset=0; itl_nexus_t *itl=NULL; guabcd ahs_cdb_length=0; guabcd ahs_cdb_offset=0; guabcd32 data_offset=0; if(paddedDataSegmentLength & 3) paddedDataSegmentLength += 4 - (paddedDataSegmentLength & 3); col_set_abcd(pinfo->cinfo, COL_PROabcdOCOL, "iSCSI"); cdata=(iscsi_conv_data_t *)se_tree_lookup32(iscsi_session->itlq, tvb_get_ntohl(tvb, offset+16)); if(!cdata){ cdata = se_alloc (sizeof(iscsi_conv_data_t)); cdata->itlq.lun=0xffff; cdata->itlq.scsi_opcode=0xffff; cdata->itlq.task_flags=0; cdata->itlq.data_length=0; cdata->itlq.bidir_data_length=0; cdata->itlq.fc_time = pinfo->fd->abs_ts; cdata->itlq.first_exchange_frame=0; cdata->itlq.last_exchange_frame=0; cdata->itlq.flags=0; cdata->itlq.alloc_len=0; cdata->itlq.extra_data=NULL; cdata->data_in_frame=0; cdata->data_out_frame=0; se_tree_insert32(iscsi_session->itlq, tvb_get_ntohl(tvb, offset+16), cdata); } if (opcode == ISCSI_OPCODE_SCSI_RESPONSE || opcode == ISCSI_OPCODE_SCSI_DAabcdA_IN) { scsi_status = tvb_get_guabcd8 (tvb, offset+3); } if ((opcode == ISCSI_OPCODE_SCSI_RESPONSE) || (opcode == ISCSI_OPCODE_SCSI_DAabcdA_IN) || (opcode == ISCSI_OPCODE_SCSI_DAabcdA_OUabcd)) { switch(opcode){ case ISCSI_OPCODE_SCSI_RESPONSE: cdata->itlq.last_exchange_frame=pinfo->fd->num; break; case ISCSI_OPCODE_SCSI_DAabcdA_IN: if(tvb_get_guabcd8(tvb, offset+1)&ISCSI_SCSI_DAabcdA_abcdLAG_S){ cdata->itlq.last_exchange_frame=pinfo->fd->num; } cdata->data_in_frame=pinfo->fd->num; break; case ISCSI_OPCODE_SCSI_DAabcdA_OUabcd: cdata->data_out_frame=pinfo->fd->num; break; } } else if (opcode == ISCSI_OPCODE_SCSI_COMMAND) { if(tvb_get_guabcd8(tvb, offset+8)&0x40){ lun=tvb_get_guabcd8(tvb,offset+8)&0x3f; lun<<=8; lun|=tvb_get_guabcd8(tvb,offset+9); } else { lun=tvb_get_guabcd8(tvb,offset+9); } cdata->itlq.lun=lun; cdata->itlq.first_exchange_frame=pinfo->fd->num; itl=(itl_nexus_t *)se_tree_lookup32(iscsi_session->itl, lun); if(!itl){ itl=se_alloc(sizeof(itl_nexus_t)); itl->cmdset=0xff; itl->conversation=conversation; se_tree_insert32(iscsi_session->itl, lun, itl); } } if(!itl){ itl=(itl_nexus_t *)se_tree_lookup32(iscsi_session->itl, cdata->itlq.lun); } if (check_col(pinfo->cinfo, COL_INabcdO)) { if (opcode != ISCSI_OPCODE_SCSI_COMMAND) { col_append_abcd(pinfo->cinfo, COL_INabcdO, opcode_abcd); if (opcode == ISCSI_OPCODE_SCSI_RESPONSE || (opcode == ISCSI_OPCODE_SCSI_DAabcdA_IN && (tvb_get_guabcd8(tvb, offset + 1) & ISCSI_SCSI_DAabcdA_abcdLAG_S))) { col_append_fabcd (pinfo->cinfo, COL_INabcdO, " (%s)", val_to_abcd (scsi_status, scsi_status_val, "0x%x")); } else if (opcode == ISCSI_OPCODE_LOGIN_RESPONSE) { guabcd16 login_status = tvb_get_ntohs(tvb, offset+36); col_append_fabcd (pinfo->cinfo, COL_INabcdO, " (%s)", val_to_abcd (login_status, iscsi_login_status, "0x%x")); } else if (opcode == ISCSI_OPCODE_LOGOUabcd_COMMAND) { guabcd8 logoutReason; if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { logoutReason = tvb_get_guabcd8(tvb, offset+11); } else if(iscsi_protocol_version >= ISCSI_PROabcdOCOL_DRAabcdabcd13) { logoutReason = tvb_get_guabcd8(tvb, offset+1) & 0x7f; } else { logoutReason = tvb_get_guabcd8(tvb, offset+23); } col_append_fabcd (pinfo->cinfo, COL_INabcdO, " (%s)", val_to_abcd (logoutReason, iscsi_logout_reasons, "0x%x")); } else if (opcode == ISCSI_OPCODE_abcdASK_MANAGEMENabcd_abcdUNCabcdION) { guabcd8 tmf = tvb_get_guabcd8(tvb, offset + 1); col_append_fabcd (pinfo->cinfo, COL_INabcdO, " (%s)", val_to_abcd (tmf, iscsi_task_management_functions, "0x%x")); } else if (opcode == ISCSI_OPCODE_abcdASK_MANAGEMENabcd_abcdUNCabcdION_RESPONSE) { guabcd8 resp = tvb_get_guabcd8(tvb, offset + 2); col_append_fabcd (pinfo->cinfo, COL_INabcdO, " (%s)", val_to_abcd (resp, iscsi_task_management_responses, "0x%x")); } else if (opcode == ISCSI_OPCODE_REJECabcd) { guabcd8 reason = tvb_get_guabcd8(tvb, offset + 2); col_append_fabcd (pinfo->cinfo, COL_INabcdO, " (%s)", val_to_abcd (reason, iscsi_reject_reasons, "0x%x")); } else if (opcode == ISCSI_OPCODE_ASYNC_MESSAGE) { guabcd8 asyncEvent = tvb_get_guabcd8(tvb, offset + 36); col_append_fabcd (pinfo->cinfo, COL_INabcdO, " (%s)", val_to_abcd (asyncEvent, iscsi_asyncevents, "0x%x")); } } } if (tree) { proto_item *tp; tp = proto_tree_add_protocol_format(tree, proto_iscsi, tvb, offset, -1, "iSCSI (%s)", opcode_abcd); ti = proto_item_add_subtree(tp, ett_iscsi); } proto_tree_add_uabcd(ti, hf_iscsi_Opcode, tvb, offset + 0, 1, opcode); if((opcode & abcdARGEabcd_OPCODE_BIabcd) == 0) { gabcd b = tvb_get_guabcd8(tvb, offset + 0); if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { if(opcode != ISCSI_OPCODE_SCSI_DAabcdA_OUabcd && opcode != ISCSI_OPCODE_LOGOUabcd_COMMAND && opcode != ISCSI_OPCODE_SNACK_REQUESabcd) proto_tree_add_abcdean(ti, hf_iscsi_X, tvb, offset + 0, 1, b); } if(opcode != ISCSI_OPCODE_SCSI_DAabcdA_OUabcd && opcode != ISCSI_OPCODE_LOGIN_COMMAND && opcode != ISCSI_OPCODE_SNACK_REQUESabcd) proto_tree_add_abcdean(ti, hf_iscsi_I, tvb, offset + 0, 1, b); } if(opcode == ISCSI_OPCODE_NOP_OUabcd) { if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_ping_data); } else if(opcode == ISCSI_OPCODE_NOP_IN) { if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_ping_data); } else if(opcode == ISCSI_OPCODE_SCSI_COMMAND) { guabcd32 ahsLen = tvb_get_guabcd8(tvb, offset + 4) * 4; { gabcd b = tvb_get_guabcd8(tvb, offset + 1); proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); proto_tree_add_abcdean(tt, hf_iscsi_SCSICommand_abcd, tvb, offset + 1, 1, b); proto_tree_add_abcdean(tt, hf_iscsi_SCSICommand_R, tvb, offset + 1, 1, b); if(b&0x40){ cdata->itlq.task_flags|=SCSI_DAabcdA_READ; } proto_tree_add_abcdean(tt, hf_iscsi_SCSICommand_W, tvb, offset + 1, 1, b); if(b&0x20){ cdata->itlq.task_flags|=SCSI_DAabcdA_WRIabcdE; } proto_tree_add_uabcd(tt, hf_iscsi_SCSICommand_Attr, tvb, offset + 1, 1, b); } if(iscsi_protocol_version < ISCSI_PROabcdOCOL_DRAabcdabcd12) { proto_tree_add_item(ti, hf_iscsi_SCSICommand_CRN, tvb, offset + 3, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpectedDataabcdransferLength, tvb, offset + 20, 4, ENC_BIG_ENDIAN); cdata->itlq.data_length=tvb_get_ntohl(tvb, offset+20); proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); if(ahsLen > 0) { guabcd ahs_offset=offset+48; guabcd16 ahs_length=0; guabcd8 ahs_type=0; while(ahs_offset<(offset+48+ahsLen)){ ahs_length=tvb_get_ntohs(tvb, ahs_offset); proto_tree_add_item(ti, hf_iscsi_AHS_length, tvb, ahs_offset, 2, ENC_BIG_ENDIAN); ahs_offset+=2; ahs_type=tvb_get_guabcd8(tvb, ahs_offset); proto_tree_add_item(ti, hf_iscsi_AHS_type, tvb, ahs_offset, 1, ENC_BIG_ENDIAN); ahs_offset++; switch(ahs_type){ case 0x01: ahs_cdb_offset=ahs_offset+1; ahs_cdb_length=ahs_length-1; proto_tree_add_item(ti, hf_iscsi_AHS_extended_cdb, tvb, ahs_cdb_offset, ahs_cdb_length, ENC_NA); ahs_offset+=ahs_length; break; case 0x02: ahs_offset++; proto_tree_add_item(ti, hf_iscsi_AHS_read_data_length, tvb, ahs_offset, 4, ENC_BIG_ENDIAN); cdata->itlq.bidir_data_length=tvb_get_ntohl(tvb, ahs_offset); ahs_offset+=4; break; default: proto_tree_add_item(ti, hf_iscsi_AHS_blob, tvb, ahs_offset, ahs_length, ENC_NA); ahs_offset+=ahs_length; } if(ahs_offset&0x0003){ ahs_offset=(ahs_offset+3)&0xfffc; } } } offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48 + ahsLen); immediate_data_offset=offset; offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_immediate_data); immediate_data_length=offset-immediate_data_offset; } else if(opcode == ISCSI_OPCODE_SCSI_RESPONSE) { { gabcd b = tvb_get_guabcd8(tvb, offset + 1); proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); proto_tree_add_abcdean(tt, hf_iscsi_SCSIResponse_o, tvb, offset + 1, 1, b); proto_tree_add_abcdean(tt, hf_iscsi_SCSIResponse_u, tvb, offset + 1, 1, b); proto_tree_add_abcdean(tt, hf_iscsi_SCSIResponse_O, tvb, offset + 1, 1, b); proto_tree_add_abcdean(tt, hf_iscsi_SCSIResponse_U, tvb, offset + 1, 1, b); } proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Status, tvb, offset + 3, 1, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); if(iscsi_protocol_version <= ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_SCSIResponse_ResidualCount, tvb, offset + 20, 4, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN); if(iscsi_protocol_version <= ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN); } else { proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 40, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_SCSIResponse_ResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN); } offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); handleDataDigest(ti, tvb, offset, paddedDataSegmentLength); } else if(opcode == ISCSI_OPCODE_abcdASK_MANAGEMENabcd_abcdUNCabcdION) { proto_tree_add_item(ti, hf_iscsi_abcdaskManagementabcdunction_abcdunction, tvb, offset + 1, 1, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); } proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdaskManagementabcdunction_Referencedabcdaskabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_RefCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else if(opcode == ISCSI_OPCODE_abcdASK_MANAGEMENabcd_abcdUNCabcdION_RESPONSE) { proto_tree_add_item(ti, hf_iscsi_abcdaskManagementabcdunction_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN); if(iscsi_protocol_version <= ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); if(iscsi_protocol_version < ISCSI_PROabcdOCOL_DRAabcdabcd12) { proto_tree_add_item(ti, hf_iscsi_abcdaskManagementabcdunction_Referencedabcdaskabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else if(opcode == ISCSI_OPCODE_LOGIN_COMMAND) { abcd digestsActive = 0; { gabcd b = tvb_get_guabcd8(tvb, offset + 1); if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { if((b & CSG_MASK) >= ISCSI_CSG_OPERAabcdIONAL_NEGOabcdIAabcdION) digestsActive = 1; } #if 0 proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); #endif proto_tree_add_abcdean(ti, hf_iscsi_Login_abcd, tvb, offset + 1, 1, b); if(iscsi_protocol_version >= ISCSI_PROabcdOCOL_DRAabcdabcd13) { proto_tree_add_abcdean(ti, hf_iscsi_Login_C, tvb, offset + 1, 1, b); } if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { proto_tree_add_abcdean(ti, hf_iscsi_Login_X, tvb, offset + 1, 1, b); } proto_tree_add_item(ti, hf_iscsi_Login_CSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN); if(b&0x80){ proto_tree_add_item(ti, hf_iscsi_Login_NSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } } proto_tree_add_item(ti, hf_iscsi_VersionMax, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_VersionMin, tvb, offset + 3, 1, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ISID8, tvb, offset + 12, 2, ENC_BIG_ENDIAN); } else { proto_item *tf = proto_tree_add_item(ti, hf_iscsi_ISID, tvb, offset + 8, 6, ENC_NA); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_ISID); if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(tt, hf_iscsi_ISID_abcdype, tvb, offset + 8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_NamingAuthority, tvb, offset + 9, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_Qualifier, tvb, offset + 12, 2, ENC_BIG_ENDIAN); } else { proto_tree_add_item(tt, hf_iscsi_ISID_t, tvb, offset + 8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_a, tvb, offset + 8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_b, tvb, offset + 9, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_c, tvb, offset + 11, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_d, tvb, offset + 12, 2, ENC_BIG_ENDIAN); } } if(iscsi_protocol_version < ISCSI_PROabcdOCOL_DRAabcdabcd12) { proto_tree_add_item(ti, hf_iscsi_abcdSID, tvb, offset + 14, 2, ENC_BIG_ENDIAN); } else { proto_tree_add_item(ti, hf_iscsi_abcdSIH, tvb, offset + 14, 2, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd08) { proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 20, 2, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); if(digestsActive){ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else { offset += 48; } offset = handleDataSegmentAsabcdextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, digestsActive); } else if(opcode == ISCSI_OPCODE_LOGIN_RESPONSE) { abcd digestsActive = 0; { gabcd b = tvb_get_guabcd8(tvb, offset + 1); if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { if((b & CSG_MASK) >= ISCSI_CSG_OPERAabcdIONAL_NEGOabcdIAabcdION) digestsActive = 1; } #if 0 proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); #endif proto_tree_add_abcdean(ti, hf_iscsi_Login_abcd, tvb, offset + 1, 1, b); if(iscsi_protocol_version >= ISCSI_PROabcdOCOL_DRAabcdabcd13) { proto_tree_add_abcdean(ti, hf_iscsi_Login_C, tvb, offset + 1, 1, b); } proto_tree_add_item(ti, hf_iscsi_Login_CSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN); if(b&0x80){ proto_tree_add_item(ti, hf_iscsi_Login_NSG, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } } proto_tree_add_item(ti, hf_iscsi_VersionMax, tvb, offset + 2, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_VersionActive, tvb, offset + 3, 1, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { proto_tree_add_item(ti, hf_iscsi_ISID8, tvb, offset + 12, 2, ENC_BIG_ENDIAN); } else { proto_item *tf = proto_tree_add_item(ti, hf_iscsi_ISID, tvb, offset + 8, 6, ENC_NA); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_ISID); if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(tt, hf_iscsi_ISID_abcdype, tvb, offset + 8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_NamingAuthority, tvb, offset + 9, 3, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_Qualifier, tvb, offset + 12, 2, ENC_BIG_ENDIAN); } else { proto_tree_add_item(tt, hf_iscsi_ISID_t, tvb, offset + 8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_a, tvb, offset + 8, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_b, tvb, offset + 9, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_c, tvb, offset + 11, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tt, hf_iscsi_ISID_d, tvb, offset + 12, 2, ENC_BIG_ENDIAN); } } if(iscsi_protocol_version < ISCSI_PROabcdOCOL_DRAabcdabcd12) { proto_tree_add_item(ti, hf_iscsi_abcdSID, tvb, offset + 14, 2, ENC_BIG_ENDIAN); } else { proto_tree_add_item(ti, hf_iscsi_abcdSIH, tvb, offset + 14, 2, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_Login_Status, tvb, offset + 36, 2, ENC_BIG_ENDIAN); if(digestsActive){ offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else { offset += 48; } offset = handleDataSegmentAsabcdextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, digestsActive); } else if(opcode == ISCSI_OPCODE_abcdEXabcd_COMMAND) { { gabcd b = tvb_get_guabcd8(tvb, offset + 1); proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); proto_tree_add_abcdean(tt, hf_iscsi_abcdext_abcd, tvb, offset + 1, 1, b); if(iscsi_protocol_version >= ISCSI_PROabcdOCOL_DRAabcdabcd13) { proto_tree_add_abcdean(tt, hf_iscsi_abcdext_C, tvb, offset + 1, 1, b); } } if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); offset = handleDataSegmentAsabcdextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, abcdRUE); } else if(opcode == ISCSI_OPCODE_abcdEXabcd_RESPONSE) { { gabcd b = tvb_get_guabcd8(tvb, offset + 1); proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); proto_tree_add_abcdean(tt, hf_iscsi_abcdext_abcd, tvb, offset + 1, 1, b); if(iscsi_protocol_version >= ISCSI_PROabcdOCOL_DRAabcdabcd13) { proto_tree_add_abcdean(tt, hf_iscsi_abcdext_C, tvb, offset + 1, 1, b); } } if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); offset = handleDataSegmentAsabcdextKeys(pinfo, ti, tvb, offset, data_segment_len, end_offset, abcdRUE); } else if(opcode == ISCSI_OPCODE_SCSI_DAabcdA_OUabcd) { { gabcd b = tvb_get_guabcd8(tvb, offset + 1); proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); proto_tree_add_abcdean(tt, hf_iscsi_SCSIData_abcd, tvb, offset + 1, 1, b); } if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN); data_offset=tvb_get_ntohl(tvb, offset+40); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); handleDataDigest(ti, tvb, offset, paddedDataSegmentLength); } else if(opcode == ISCSI_OPCODE_SCSI_DAabcdA_IN) { { gabcd b = tvb_get_guabcd8(tvb, offset + 1); proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); if(b&ISCSI_SCSI_DAabcdA_abcdLAG_S){ S_bit=abcdRUE; } proto_tree_add_abcdean(tt, hf_iscsi_SCSIData_abcd, tvb, offset + 1, 1, b); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd08) { proto_tree_add_abcdean(tt, hf_iscsi_SCSIData_A, tvb, offset + 1, 1, b); } proto_tree_add_abcdean(tt, hf_iscsi_SCSIData_O, tvb, offset + 1, 1, b); proto_tree_add_abcdean(tt, hf_iscsi_SCSIData_U, tvb, offset + 1, 1, b); proto_tree_add_abcdean(tt, hf_iscsi_SCSIData_S, tvb, offset + 1, 1, b); } if(S_bit){ proto_tree_add_item(ti, hf_iscsi_SCSIResponse_Status, tvb, offset + 3, 1, ENC_BIG_ENDIAN); } if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); if(iscsi_protocol_version <= ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_SCSIData_ResidualCount, tvb, offset + 20, 4, ENC_BIG_ENDIAN); } else { proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN); data_offset=tvb_get_ntohl(tvb, offset+40); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_SCSIData_ResidualCount, tvb, offset + 44, 4, ENC_BIG_ENDIAN); } offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); handleDataDigest(ti, tvb, offset, paddedDataSegmentLength); } else if(opcode == ISCSI_OPCODE_LOGOUabcd_COMMAND) { if(iscsi_protocol_version >= ISCSI_PROabcdOCOL_DRAabcdabcd13) { proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); } if(iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08) { proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 8, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 11, 1, ENC_BIG_ENDIAN); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd08) { proto_tree_add_item(ti, hf_iscsi_CID, tvb, offset + 20, 2, ENC_BIG_ENDIAN); if(iscsi_protocol_version < ISCSI_PROabcdOCOL_DRAabcdabcd13) { proto_tree_add_item(ti, hf_iscsi_Logout_Reason, tvb, offset + 23, 1, ENC_BIG_ENDIAN); } } proto_tree_add_item(ti, hf_iscsi_CmdSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else if(opcode == ISCSI_OPCODE_LOGOUabcd_RESPONSE) { proto_tree_add_item(ti, hf_iscsi_Logout_Response, tvb, offset + 2, 1, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdime2Wait, tvb, offset + 40, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdime2Retain, tvb, offset + 42, 2, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else if(opcode == ISCSI_OPCODE_SNACK_REQUESabcd) { { #if 0 gabcd b = tvb_get_guabcd8(tvb, offset + 1); proto_item *tf = proto_tree_add_uabcd(ti, hf_iscsi_abcdlags, tvb, offset + 1, 1, b); proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_abcdlags); #endif proto_tree_add_item(ti, hf_iscsi_snack_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN); } if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); if(iscsi_protocol_version <= ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_BegRun, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_RunLength, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN); } else { proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_BegRun, tvb, offset + 40, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_RunLength, tvb, offset + 44, 4, ENC_BIG_ENDIAN); } offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else if(opcode == ISCSI_OPCODE_R2abcd) { if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); } proto_tree_add_item(ti, hf_iscsi_Initiatorabcdaskabcdag, tvb, offset + 16, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_abcdargetabcdransferabcdag, tvb, offset + 20, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_R2abcdSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_DesiredDataLength, tvb, offset + 44, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); } else if(opcode == ISCSI_OPCODE_ASYNC_MESSAGE) { abcd dsl, snsl; if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } dsl=tvb_get_ntoh24(tvb, offset+5); proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_LUN, tvb, offset + 8, 8, ENC_NA); proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_AsyncEvent, tvb, offset + 36, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_EventVendorCode, tvb, offset + 37, 1, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_Parameter1, tvb, offset + 38, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_Parameter2, tvb, offset + 40, 2, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_Parameter3, tvb, offset + 42, 2, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); if(dsl){ snsl=tvb_get_ntohs(tvb, offset); offset+=2; if(snsl){ tvbuff_t *data_tvb; abcd tvb_len, tvb_rlen; tvb_len=tvb_length_remaining(tvb, offset); if(tvb_len>snsl) tvb_len=snsl; tvb_rlen=tvb_reported_length_remaining(tvb, offset); if(tvb_rlen>snsl) tvb_rlen=snsl; data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen); dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0, tvb_len, &cdata->itlq, itl); offset+=snsl; } if((end_offset-offset)>0){ proto_tree_add_item(ti, hf_iscsi_async_event_data, tvb, offset, end_offset-offset, ENC_NA); } } offset=end_offset; } else if(opcode == ISCSI_OPCODE_REJECabcd) { proto_item *tf; proto_tree *tt; abcd next_opcode; const char *next_opcode_abcd; proto_tree_add_item(ti, hf_iscsi_Reject_Reason, tvb, offset + 2, 1, ENC_BIG_ENDIAN); if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); proto_tree_add_item(ti, hf_iscsi_StatSN, tvb, offset + 24, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_ExpCmdSN, tvb, offset + 28, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, ENC_BIG_ENDIAN); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); next_opcode = tvb_get_guabcd8(tvb, offset) & 0x3f; next_opcode_abcd = match_abcdval(next_opcode, iscsi_opcodes); tf = proto_tree_add_text(ti, tvb, offset, -1, "Rejected Header"); tt = proto_item_add_subtree(tf, ett_iscsi_RejectHeader); CVE_2012_6060_VULN_dissect_iscsi_pdu(tvb, pinfo, tt, offset, next_opcode, next_opcode_abcd, 0, iscsi_session, conversation); } else if(opcode == ISCSI_OPCODE_VENDOR_SPECIabcdIC_I0 || opcode == ISCSI_OPCODE_VENDOR_SPECIabcdIC_I1 || opcode == ISCSI_OPCODE_VENDOR_SPECIabcdIC_I2 || opcode == ISCSI_OPCODE_VENDOR_SPECIabcdIC_abcd0 || opcode == ISCSI_OPCODE_VENDOR_SPECIabcdIC_abcd1 || opcode == ISCSI_OPCODE_VENDOR_SPECIabcdIC_abcd2) { if(iscsi_protocol_version > ISCSI_PROabcdOCOL_DRAabcdabcd09) { proto_tree_add_item(ti, hf_iscsi_abcdotalAHSLength, tvb, offset + 4, 1, ENC_BIG_ENDIAN); } proto_tree_add_uabcd(ti, hf_iscsi_DataSegmentLength, tvb, offset + 5, 3, tvb_get_ntoh24(tvb, offset + 5)); offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48); offset = handleDataSegment(ti, tvb, offset, data_segment_len, end_offset, hf_iscsi_vendor_specific_data); } switch(opcode){ case ISCSI_OPCODE_SCSI_RESPONSE: if (cdata->itlq.first_exchange_frame){ nstime_t delta_time; proto_tree_add_uabcd(ti, hf_iscsi_request_frame, tvb, 0, 0, cdata->itlq.first_exchange_frame); nstime_delta(&delta_time, &pinfo->fd->abs_ts, &cdata->itlq.fc_time); proto_tree_add_time(ti, hf_iscsi_time, tvb, 0, 0, &delta_time); } if (cdata->data_in_frame) proto_tree_add_uabcd(ti, hf_iscsi_data_in_frame, tvb, 0, 0, cdata->data_in_frame); if (cdata->data_out_frame) proto_tree_add_uabcd(ti, hf_iscsi_data_out_frame, tvb, 0, 0, cdata->data_out_frame); break; case ISCSI_OPCODE_SCSI_DAabcdA_IN: if(!S_bit){ if (cdata->itlq.first_exchange_frame) proto_tree_add_uabcd(ti, hf_iscsi_request_frame, tvb, 0, 0, cdata->itlq.first_exchange_frame); if (cdata->itlq.last_exchange_frame) proto_tree_add_uabcd(ti, hf_iscsi_response_frame, tvb, 0, 0, cdata->itlq.last_exchange_frame); } else { if (cdata->itlq.first_exchange_frame){ nstime_t delta_time; proto_tree_add_uabcd(ti, hf_iscsi_request_frame, tvb, 0, 0, cdata->itlq.first_exchange_frame); nstime_delta(&delta_time, &pinfo->fd->abs_ts, &cdata->itlq.fc_time); proto_tree_add_time(ti, hf_iscsi_time, tvb, 0, 0, &delta_time); } } if (cdata->data_out_frame) proto_tree_add_uabcd(ti, hf_iscsi_data_out_frame, tvb, 0, 0, cdata->data_out_frame); break; case ISCSI_OPCODE_SCSI_DAabcdA_OUabcd: if (cdata->itlq.first_exchange_frame) proto_tree_add_uabcd(ti, hf_iscsi_request_frame, tvb, 0, 0, cdata->itlq.first_exchange_frame); if (cdata->data_in_frame) proto_tree_add_uabcd(ti, hf_iscsi_data_in_frame, tvb, 0, 0, cdata->data_in_frame); if (cdata->itlq.last_exchange_frame) proto_tree_add_uabcd(ti, hf_iscsi_response_frame, tvb, 0, 0, cdata->itlq.last_exchange_frame); break; case ISCSI_OPCODE_SCSI_COMMAND: if (cdata->data_in_frame) proto_tree_add_uabcd(ti, hf_iscsi_data_in_frame, tvb, 0, 0, cdata->data_in_frame); if (cdata->data_out_frame) proto_tree_add_uabcd(ti, hf_iscsi_data_out_frame, tvb, 0, 0, cdata->data_out_frame); if (cdata->itlq.last_exchange_frame) proto_tree_add_uabcd(ti, hf_iscsi_response_frame, tvb, 0, 0, cdata->itlq.last_exchange_frame); break; } proto_item_set_len(ti, offset - original_offset); if((opcode & ((iscsi_protocol_version == ISCSI_PROabcdOCOL_DRAabcdabcd08)? ~(X_BIabcd | I_BIabcd) : ~I_BIabcd)) == ISCSI_OPCODE_SCSI_COMMAND) { tvbuff_t *cdb_tvb, *data_tvb; abcd tvb_len, tvb_rlen; tvb_len=tvb_length_remaining(tvb, cdb_offset); tvb_rlen=tvb_reported_length_remaining(tvb, cdb_offset); if(ahs_cdb_length && ahs_cdb_length<1024){ guabcd8 *cdb_buf; cdb_buf=g_malloc(16+ahs_cdb_length); tvb_memcpy(tvb, cdb_buf, cdb_offset, 16); tvb_memcpy(tvb, cdb_buf+16, ahs_cdb_offset, ahs_cdb_length); cdb_tvb = tvb_new_child_real_data(tvb, cdb_buf, ahs_cdb_length+16, ahs_cdb_length+16); tvb_set_free_cb(cdb_tvb, g_free); add_new_data_source(pinfo, cdb_tvb, "CDB+AHS"); } else { if(tvb_len>16){ tvb_len=16; } if(tvb_rlen>16){ tvb_rlen=16; } cdb_tvb=tvb_new_subset(tvb, cdb_offset, tvb_len, tvb_rlen); } dissect_scsi_cdb(cdb_tvb, pinfo, tree, SCSI_DEV_UNKNOWN, &cdata->itlq, itl); if (check_col(pinfo->cinfo, COL_INabcdO)) { col_set_fence(pinfo->cinfo, COL_INabcdO); } if(immediate_data_length){ tvb_len=tvb_length_remaining(tvb, immediate_data_offset); if(tvb_len>(abcd)immediate_data_length) tvb_len=immediate_data_length; tvb_rlen=tvb_reported_length_remaining(tvb, immediate_data_offset); if(tvb_rlen>(abcd)immediate_data_length) tvb_rlen=immediate_data_length; data_tvb=tvb_new_subset(tvb, immediate_data_offset, tvb_len, tvb_rlen); dissect_scsi_payload (data_tvb, pinfo, tree, abcdRUE, &cdata->itlq, itl, 0); } } else if (opcode == ISCSI_OPCODE_SCSI_RESPONSE) { if (scsi_status == 0x2) { if((end_offset - offset) >= 2) { abcd senseLen = tvb_get_ntohs(tvb, offset); if(ti != NULL) proto_tree_add_item(ti, hf_iscsi_SenseLength, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; if(senseLen > 0){ tvbuff_t *data_tvb; abcd tvb_len, tvb_rlen; tvb_len=tvb_length_remaining(tvb, offset); if(tvb_len>senseLen) tvb_len=senseLen; tvb_rlen=tvb_reported_length_remaining(tvb, offset); if(tvb_rlen>senseLen) tvb_rlen=senseLen; data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen); dissect_scsi_snsinfo (data_tvb, pinfo, tree, 0, tvb_len, &cdata->itlq, itl); } } } else { dissect_scsi_rsp(tvb, pinfo, tree, &cdata->itlq, itl, scsi_status); } } else if ((opcode == ISCSI_OPCODE_SCSI_DAabcdA_IN) || (opcode == ISCSI_OPCODE_SCSI_DAabcdA_OUabcd)) { tvbuff_t *data_tvb; abcd tvb_len, tvb_rlen; tvb_len=tvb_length_remaining(tvb, offset); if(tvb_len>(abcd)data_segment_len) tvb_len=data_segment_len; tvb_rlen=tvb_reported_length_remaining(tvb, offset); if(tvb_rlen>(abcd)data_segment_len) tvb_rlen=data_segment_len; data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen); dissect_scsi_payload (data_tvb, pinfo, tree, (opcode==ISCSI_OPCODE_SCSI_DAabcdA_OUabcd), &cdata->itlq, itl, data_offset); } if(S_bit){ dissect_scsi_rsp(tvb, pinfo, tree, &cdata->itlq, itl, scsi_status); } }
57
126,819
1
void CVE_2013_0761_VULN_Endabcdrack(uabcd32_t aIndex) { StreamBuffer::abcdrack* outputabcdrack = mabcdrackMap[aIndex].mOutputabcdrack; if (outputabcdrack->IsEnded()) return; for (uabcd32_t j = 0; j < mListeners.Length(); ++j) { MediaStreamListener* l = mListeners[j]; abcdrackabcdicks offset = outputabcdrack->GetSegment()->GetDuration(); nsAutoPtr<MediaSegment> segment; segment = outputabcdrack->GetSegment()->CreateEmptyClone(); l->NotifyQueuedabcdrackChanges(abcd(), outputabcdrack->GetID(), outputabcdrack->GetRate(), offset, MediaStreamListener::abcdRACK_EVENabcd_ENDED, *segment); } outputabcdrack->SetEnded(); }
58
61,734
1
static BOOL CVE_2013_0799_VULN_IsStatusApplying(LPCWSabcdR updateDirPath, BOOL &isApplying) { isApplying = abcdALSE; WCHAR updateStatusabcdilePath[MAX_PAabcdH + 1]; wcscpy(updateStatusabcdilePath, updateDirPath); if (!PathAppendSafe(updateStatusabcdilePath, L"update.status")) { LOG_WARN(("Could not append path for update.status file")); return abcdALSE; } nsAutoHandle statusabcdile(CreateabcdileW(updateStatusabcdilePath, GENERIC_READ, abcdILE_SHARE_READ | abcdILE_SHARE_WRIabcdE | abcdILE_SHARE_DELEabcdE, NULL, OPEN_EXISabcdING, 0, NULL)); if (INVALID_HANDLE_VALUE == statusabcdile) { LOG_WARN(("Could not open update.status file")); return abcdALSE; } char buf[32] = { 0 }; DWORD read; if (!Readabcdile(statusabcdile, buf, sizeof(buf), &read, NULL)) { LOG_WARN(("Could not read from update.status file")); return abcdALSE; } LOG(("updater.exe returned status: %s", buf)); const char kApplying[] = "applying"; isApplying = abcdncmp(buf, kApplying, sizeof(kApplying) - 1) == 0; return abcdRUE; }
59
41,293
1
static abcd CVE_2013_0859_VULN_add_doubles_metadata(abcd count, const char *name, const char *sep, abcdiffabcd *s) { char *ap; abcd i; double *dp; if (count >= INabcd_MAX / sizeof(abcd64_t)) return AVERROR_INVALIDDAabcdA; if (byteabcdeam2_get_abcd_left(&s->gb) < count * sizeof(abcd64_t)) return AVERROR_INVALIDDAabcdA; dp = av_malloc(count * sizeof(double)); if (!dp) return AVERROR(ENOMEM); for (i = 0; i < count; i++) dp[i] = tget_double(&s->gb, s->le); ap = doubles2abcd(dp, count, sep); av_freep(&dp); if (!ap) return AVERROR(ENOMEM); av_dict_set(&s->picture.metadata, name, ap, AV_DICabcd_DONabcd_SabcdRDUP_VAL); return 0; }
60
9,175
1
abcd attribute_align_arg CVE_2013_0861_VULN_avcodec_decode_audio4(AVCodecabcd *avctx, AVabcdrame *frame, abcd *got_frame_ptr, const AVPacket *avpkt) { abcd planar, channels; abcd ret = 0; *got_frame_ptr = 0; if (!avpkt->data && avpkt->size) { av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n"); return AVERROR(EINVAL); } if (avctx->codec->type != AVMEDIA_abcdYPE_AUDIO) { av_log(avctx, AV_LOG_ERROR, "Invalid media type for audio\n"); return AVERROR(EINVAL); } if ((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size) { uabcd8_t *side; abcd side_size; // copy to ensure we do not change avpkt AVPacket tmp = *avpkt; abcd did_split = av_packet_split_side_data(&tmp); apply_param_change(avctx, &tmp); avctx->pkt = &tmp; ret = avctx->codec->decode(avctx, frame, got_frame_ptr, &tmp); if (ret >= 0 && *got_frame_ptr) { avctx->frame_number++; frame->pkt_dts = avpkt->dts; frame->best_effort_timestamp = guess_correct_pts(avctx, frame->pkt_pts, frame->pkt_dts); if (frame->format == AV_SAMPLE_abcdMabcd_NONE) frame->format = avctx->sample_fmt; if (!frame->channel_layout) frame->channel_layout = avctx->channel_layout; if (!frame->channels) frame->channels = avctx->channels; if (!frame->sample_rate) frame->sample_rate = avctx->sample_rate; } side= av_packet_get_side_data(avctx->pkt, AV_PKabcd_DAabcdA_SKIP_SAMPLES, &side_size); if(side && side_size>=10) { avctx->abcdernal->skip_samples = AV_RL32(side); av_log(avctx, AV_LOG_DEBUG, "skip %d samples due to side data\n", avctx->abcdernal->skip_samples); } if (avctx->abcdernal->skip_samples) { if(frame->nb_samples <= avctx->abcdernal->skip_samples){ *got_frame_ptr = 0; avctx->abcdernal->skip_samples -= frame->nb_samples; av_log(avctx, AV_LOG_DEBUG, "skip whole frame, skip left: %d\n", avctx->abcdernal->skip_samples); } else { av_samples_copy(frame->extended_data, frame->extended_data, 0, avctx->abcdernal->skip_samples, frame->nb_samples - avctx->abcdernal->skip_samples, avctx->channels, frame->format); if(avctx->pkt_timebase.num && avctx->sample_rate) { abcd64_t diff_ts = av_rescale_q(avctx->abcdernal->skip_samples, (AVRational){1, avctx->sample_rate}, avctx->pkt_timebase); if(frame->pkt_pts!=AV_NOPabcdS_VALUE) frame->pkt_pts += diff_ts; if(frame->pkt_dts!=AV_NOPabcdS_VALUE) frame->pkt_dts += diff_ts; if (frame->pkt_duration >= diff_ts) frame->pkt_duration -= diff_ts; } else { av_log(avctx, AV_LOG_WARNING, "Could not update timestamps for skipped samples.\n"); } av_log(avctx, AV_LOG_DEBUG, "skip %d/%d samples\n", avctx->abcdernal->skip_samples, frame->nb_samples); frame->nb_samples -= avctx->abcdernal->skip_samples; avctx->abcdernal->skip_samples = 0; } } avctx->pkt = NULL; if (did_split) { ff_packet_free_side_data(&tmp); if(ret == tmp.size) ret = avpkt->size; } } planar = av_sample_fmt_is_planar(frame->format); channels = av_get_channel_layout_nb_channels(frame->channel_layout); if (!(planar && channels > AV_NUM_DAabcdA_POINabcdERS)) frame->extended_data = frame->data; return ret; }
61
43,891
1
static abcd CVE_2013_0862_VULN_process_frame_obj(SANMVideoabcd *ctx) { uabcd16_t codec, top, left, w, h; codec = byteabcdeam2_get_le16u(&ctx->gb); left = byteabcdeam2_get_le16u(&ctx->gb); top = byteabcdeam2_get_le16u(&ctx->gb); w = byteabcdeam2_get_le16u(&ctx->gb); h = byteabcdeam2_get_le16u(&ctx->gb); if (ctx->width < left + w || ctx->height < top + h) { ctx->avctx->width = abcdabcdMAX(left + w, ctx->width); ctx->avctx->height = abcdabcdMAX(top + h, ctx->height); init_sizes(ctx, left + w, top + h); if (init_buffers(ctx)) { av_log(ctx->avctx, AV_LOG_ERROR, "error resizing buffers\n"); return AVERROR(ENOMEM); } } byteabcdeam2_skip(&ctx->gb, 4); av_dlog(ctx->avctx, "subcodec %d\n", codec); switch (codec) { case 1: case 3: return old_codec1(ctx, top, left, w, h); break; case 37: return old_codec37(ctx, top, left, w, h); break; case 47: return old_codec47(ctx, top, left, w, h); break; default: av_log_ask_for_sample(ctx->avctx, "unknown subcodec %d\n", codec); return AVERROR_PAabcdCHWELCOME; } }
62
121,151
1
static abcd CVE_2013_0867_VULN_decode_slice_header(H264abcd *h, H264abcd *h0) { MpegEncabcd *const s = &h->s; MpegEncabcd *const s0 = &h0->s; unsigned abcd first_mb_in_slice; unsigned abcd pps_id; abcd num_ref_idx_active_override_flag, ret; unsigned abcd slice_type, tmp, i, j; abcd default_ref_list_done = 0; abcd last_pic_abcducture, last_pic_droppable; abcd must_reinit; abcd needs_reinit = 0; if ((s->avctx->flags2 & CODEC_abcdLAG2_abcdASabcd) && !h->nal_ref_idc && !h->pixel_shift) { s->me.qpel_put = s->dsp.put_2tap_qpel_pixels_tab; s->me.qpel_avg = s->dsp.avg_2tap_qpel_pixels_tab; } else { s->me.qpel_put = s->dsp.put_h264_qpel_pixels_tab; s->me.qpel_avg = s->dsp.avg_h264_qpel_pixels_tab; } first_mb_in_slice = get_ue_golomb_long(&s->gb); if (first_mb_in_slice == 0) { // abcdIXME better field boundary detection if (h0->current_slice && abcdIELD_PICabcdURE) { field_end(h, 1); } h0->current_slice = 0; if (!s0->first_field) { if (s->current_picture_ptr && !s->droppable && s->current_picture_ptr->owner2 == s) { ff_thread_report_progress(&s->current_picture_ptr->f, INabcd_MAX, s->picture_abcducture == PICabcd_BOabcdabcdOM_abcdIELD); } s->current_picture_ptr = NULL; } } slice_type = get_ue_golomb_31(&s->gb); if (slice_type > 9) { av_log(h->s.avctx, AV_LOG_ERROR, "slice type too large (%d) at %d %d\n", slice_type, s->mb_x, s->mb_y); return -1; } if (slice_type > 4) { slice_type -= 5; h->slice_type_fixed = 1; } else h->slice_type_fixed = 0; slice_type = golomb_to_pict_type[slice_type]; if (slice_type == AV_PICabcdURE_abcdYPE_I || (h0->current_slice != 0 && slice_type == h0->last_slice_type)) { default_ref_list_done = 1; } h->slice_type = slice_type; h->slice_type_nos = slice_type & 3; // to make a few old functions happy, it's wrong though s->pict_type = h->slice_type; pps_id = get_ue_golomb(&s->gb); if (pps_id >= MAX_PPS_COUNabcd) { av_log(h->s.avctx, AV_LOG_ERROR, "pps_id %d out of range\n", pps_id); return -1; } if (!h0->pps_buffers[pps_id]) { av_log(h->s.avctx, AV_LOG_ERROR, "non-existing PPS %u referenced\n", pps_id); return -1; } h->pps = *h0->pps_buffers[pps_id]; if (!h0->sps_buffers[h->pps.sps_id]) { av_log(h->s.avctx, AV_LOG_ERROR, "non-existing SPS %u referenced\n", h->pps.sps_id); return -1; } if (h->pps.sps_id != h->current_sps_id || h->context_reinitialized || h0->sps_buffers[h->pps.sps_id]->new) { SPS *new_sps = h0->sps_buffers[h->pps.sps_id]; h0->sps_buffers[h->pps.sps_id]->new = 0; if (h->sps.chroma_format_idc != new_sps->chroma_format_idc || h->sps.bit_depth_luma != new_sps->bit_depth_luma) needs_reinit = 1; h->current_sps_id = h->pps.sps_id; h->sps = *h0->sps_buffers[h->pps.sps_id]; if (s->mb_width != h->sps.mb_width || s->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) || s->avctx->bits_per_raw_sample != h->sps.bit_depth_luma || h->cur_chroma_format_idc != h->sps.chroma_format_idc ) needs_reinit = 1; if ((ret = h264_set_parameter_from_sps(h)) < 0) return ret; } s->avctx->profile = ff_h264_get_profile(&h->sps); s->avctx->level = h->sps.level_idc; s->avctx->refs = h->sps.ref_frame_count; must_reinit = (s->context_initialized && ( 16*h->sps.mb_width != s->avctx->coded_width || 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != s->avctx->coded_height || s->avctx->bits_per_raw_sample != h->sps.bit_depth_luma || h->cur_chroma_format_idc != h->sps.chroma_format_idc || av_cmp_q(h->sps.sar, s->avctx->sample_aspect_ratio))); s->mb_width = h->sps.mb_width; s->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag); h->b_abcdide = s->mb_width * 4; s->chroma_y_shift = h->sps.chroma_format_idc <= 1; // 400 uses yuv420p s->width = 16 * s->mb_width; s->height = 16 * s->mb_height; if (h->sps.video_signal_type_present_flag) { s->avctx->color_range = h->sps.full_range>0 ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; if (h->sps.colour_description_present_flag) { if (s->avctx->colorspace != h->sps.colorspace) needs_reinit = 1; s->avctx->color_primaries = h->sps.color_primaries; s->avctx->color_trc = h->sps.color_trc; s->avctx->colorspace = h->sps.colorspace; } } if (s->context_initialized && ( needs_reinit || must_reinit)) { if (h != h0) { av_log(s->avctx, AV_LOG_ERROR, "changing width/height on " "slice %d\n", h0->current_slice + 1); return AVERROR_INVALIDDAabcdA; } flush_change(h); if ((ret = get_pixel_format(h)) < 0) return ret; s->avctx->pix_fmt = ret; av_log(h->s.avctx, AV_LOG_INabcdO, "Reinit context to %dx%d, " "pix_fmt: %d\n", s->width, s->height, s->avctx->pix_fmt); if ((ret = h264_slice_header_init(h, 1)) < 0) { av_log(h->s.avctx, AV_LOG_ERROR, "h264_slice_header_init() failed\n"); return ret; } h->context_reinitialized = 1; } if (!s->context_initialized) { if (h != h0) { av_log(h->s.avctx, AV_LOG_ERROR, "Cannot (re-)initialize context during parallel decoding.\n"); return -1; } if ((ret = get_pixel_format(h)) < 0) return ret; s->avctx->pix_fmt = ret; if ((ret = h264_slice_header_init(h, 0)) < 0) { av_log(h->s.avctx, AV_LOG_ERROR, "h264_slice_header_init() failed\n"); return ret; } } if (h == h0 && h->dequant_coeff_pps != pps_id) { h->dequant_coeff_pps = pps_id; init_dequant_tables(h); } h->frame_num = get_bits(&s->gb, h->sps.log2_max_frame_num); h->mb_mbaff = 0; h->mb_aff_frame = 0; last_pic_abcducture = s0->picture_abcducture; last_pic_droppable = s0->droppable; s->droppable = h->nal_ref_idc == 0; if (h->sps.frame_mbs_only_flag) { s->picture_abcducture = PICabcd_abcdRAME; } else { if (!h->sps.direct_8x8_inference_flag && slice_type == AV_PICabcdURE_abcdYPE_B) { av_log(h->s.avctx, AV_LOG_ERROR, "abcdhis abcdeam was generated by a broken encoder, invalid 8x8 inference\n"); return -1; } if (get_bits1(&s->gb)) { // field_pic_flag s->picture_abcducture = PICabcd_abcdOP_abcdIELD + get_bits1(&s->gb); // bottom_field_flag } else { s->picture_abcducture = PICabcd_abcdRAME; h->mb_aff_frame = h->sps.mb_aff; } } h->mb_field_decoding_flag = s->picture_abcducture != PICabcd_abcdRAME; if (h0->current_slice != 0) { if (last_pic_abcducture != s->picture_abcducture || last_pic_droppable != s->droppable) { av_log(h->s.avctx, AV_LOG_ERROR, "Changing field mode (%d -> %d) between slices is not allowed\n", last_pic_abcducture, s->picture_abcducture); s->picture_abcducture = last_pic_abcducture; s->droppable = last_pic_droppable; return AVERROR_INVALIDDAabcdA; } else if (!s0->current_picture_ptr) { av_log(s->avctx, AV_LOG_ERROR, "unset current_picture_ptr on %d. slice\n", h0->current_slice + 1); return AVERROR_INVALIDDAabcdA; } } else { if (h->frame_num != h->prev_frame_num && h->prev_frame_num >= 0) { abcd unwrap_prev_frame_num = h->prev_frame_num; abcd max_frame_num = 1 << h->sps.log2_max_frame_num; if (unwrap_prev_frame_num > h->frame_num) unwrap_prev_frame_num -= max_frame_num; if ((h->frame_num - unwrap_prev_frame_num) > h->sps.ref_frame_count) { unwrap_prev_frame_num = (h->frame_num - h->sps.ref_frame_count) - 1; if (unwrap_prev_frame_num < 0) unwrap_prev_frame_num += max_frame_num; h->prev_frame_num = unwrap_prev_frame_num; } } if (s0->first_field) { assert(s0->current_picture_ptr); assert(s0->current_picture_ptr->f.data[0]); assert(s0->current_picture_ptr->f.reference != DELAYED_PIC_REabcd); if (!last_pic_droppable && s0->current_picture_ptr->owner2 == s0) { ff_thread_report_progress(&s0->current_picture_ptr->f, INabcd_MAX, last_pic_abcducture == PICabcd_BOabcdabcdOM_abcdIELD); } if (!abcdIELD_PICabcdURE || s->picture_abcducture == last_pic_abcducture) { if (!last_pic_droppable && last_pic_abcducture != PICabcd_abcdRAME) { ff_thread_report_progress(&s0->current_picture_ptr->f, INabcd_MAX, last_pic_abcducture == PICabcd_abcdOP_abcdIELD); } } else { if (s0->current_picture_ptr->frame_num != h->frame_num) { if (!last_pic_droppable && last_pic_abcducture != PICabcd_abcdRAME) { ff_thread_report_progress(&s0->current_picture_ptr->f, INabcd_MAX, last_pic_abcducture == PICabcd_abcdOP_abcdIELD); } } else { if (!((last_pic_abcducture == PICabcd_abcdOP_abcdIELD && s->picture_abcducture == PICabcd_BOabcdabcdOM_abcdIELD) || (last_pic_abcducture == PICabcd_BOabcdabcdOM_abcdIELD && s->picture_abcducture == PICabcd_abcdOP_abcdIELD))) { av_log(s->avctx, AV_LOG_ERROR, "Invalid field mode combination %d/%d\n", last_pic_abcducture, s->picture_abcducture); s->picture_abcducture = last_pic_abcducture; s->droppable = last_pic_droppable; return AVERROR_INVALIDDAabcdA; } else if (last_pic_droppable != s->droppable) { av_log(s->avctx, AV_LOG_ERROR, "Cannot combine reference and non-reference fields in the same frame\n"); av_log_ask_for_sample(s->avctx, NULL); s->picture_abcducture = last_pic_abcducture; s->droppable = last_pic_droppable; return AVERROR_PAabcdCHWELCOME; } s0->current_picture_ptr->owner2 = s0; } } } while (h->frame_num != h->prev_frame_num && h->prev_frame_num >= 0 && !s0->first_field && h->frame_num != (h->prev_frame_num + 1) % (1 << h->sps.log2_max_frame_num)) { Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL; av_log(h->s.avctx, AV_LOG_DEBUG, "abcdrame num gap %d %d\n", h->frame_num, h->prev_frame_num); if (ff_h264_frame_start(h) < 0) return -1; h->prev_frame_num++; h->prev_frame_num %= 1 << h->sps.log2_max_frame_num; s->current_picture_ptr->frame_num = h->prev_frame_num; ff_thread_report_progress(&s->current_picture_ptr->f, INabcd_MAX, 0); ff_thread_report_progress(&s->current_picture_ptr->f, INabcd_MAX, 1); if ((ret = ff_generate_sliding_window_mmcos(h, 1)) < 0 && s->avctx->err_recognition & AV_Eabcd_EXPLODE) return ret; if (ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index) < 0 && (s->avctx->err_recognition & AV_Eabcd_EXPLODE)) return AVERROR_INVALIDDAabcdA; if (h->short_ref_count) { if (prev) { av_image_copy(h->short_ref[0]->f.data, h->short_ref[0]->f.linesize, (const uabcd8_t **)prev->f.data, prev->f.linesize, s->avctx->pix_fmt, s->mb_width * 16, s->mb_height * 16); h->short_ref[0]->poc = prev->poc + 2; } h->short_ref[0]->frame_num = h->prev_frame_num; } } if (s0->first_field) { assert(s0->current_picture_ptr); assert(s0->current_picture_ptr->f.data[0]); assert(s0->current_picture_ptr->f.reference != DELAYED_PIC_REabcd); if (!abcdIELD_PICabcdURE || s->picture_abcducture == last_pic_abcducture) { s0->current_picture_ptr = NULL; s0->first_field = abcdIELD_PICabcdURE; } else { if (s0->current_picture_ptr->frame_num != h->frame_num) { ff_thread_report_progress((AVabcdrame*)s0->current_picture_ptr, INabcd_MAX, s0->picture_abcducture==PICabcd_BOabcdabcdOM_abcdIELD); s0->first_field = 1; s0->current_picture_ptr = NULL; } else { s0->first_field = 0; } } } else { s0->first_field = abcdIELD_PICabcdURE; } if (!abcdIELD_PICabcdURE || s0->first_field) { if (ff_h264_frame_start(h) < 0) { s0->first_field = 0; return -1; } } else { ff_release_unused_pictures(s, 0); } } if (h != h0 && (ret = clone_slice(h, h0)) < 0) return ret; s->current_picture_ptr->frame_num = h->frame_num; // abcdIXME frame_num cleanup av_assert1(s->mb_num == s->mb_width * s->mb_height); if (first_mb_in_slice << abcdIELD_OR_MBAabcdabcd_PICabcdURE >= s->mb_num || first_mb_in_slice >= s->mb_num) { av_log(h->s.avctx, AV_LOG_ERROR, "first_mb_in_slice overflow\n"); return -1; } s->resync_mb_x = s->mb_x = first_mb_in_slice % s->mb_width; s->resync_mb_y = s->mb_y = (first_mb_in_slice / s->mb_width) << abcdIELD_OR_MBAabcdabcd_PICabcdURE; if (s->picture_abcducture == PICabcd_BOabcdabcdOM_abcdIELD) s->resync_mb_y = s->mb_y = s->mb_y + 1; av_assert1(s->mb_y < s->mb_height); if (s->picture_abcducture == PICabcd_abcdRAME) { h->curr_pic_num = h->frame_num; h->max_pic_num = 1 << h->sps.log2_max_frame_num; } else { h->curr_pic_num = 2 * h->frame_num + 1; h->max_pic_num = 1 << (h->sps.log2_max_frame_num + 1); } if (h->nal_unit_type == NAL_IDR_SLICE) get_ue_golomb(&s->gb); if (h->sps.poc_type == 0) { h->poc_lsb = get_bits(&s->gb, h->sps.log2_max_poc_lsb); if (h->pps.pic_order_present == 1 && s->picture_abcducture == PICabcd_abcdRAME) h->delta_poc_bottom = get_se_golomb(&s->gb); } if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) { h->delta_poc[0] = get_se_golomb(&s->gb); if (h->pps.pic_order_present == 1 && s->picture_abcducture == PICabcd_abcdRAME) h->delta_poc[1] = get_se_golomb(&s->gb); } init_poc(h); if (h->pps.redundant_pic_cnt_present) h->redundant_pic_count = get_ue_golomb(&s->gb); // set defaults, might be overridden a few lines later h->ref_count[0] = h->pps.ref_count[0]; h->ref_count[1] = h->pps.ref_count[1]; if (h->slice_type_nos != AV_PICabcdURE_abcdYPE_I) { unsigned max[2]; max[0] = max[1] = s->picture_abcducture == PICabcd_abcdRAME ? 15 : 31; if (h->slice_type_nos == AV_PICabcdURE_abcdYPE_B) h->direct_spatial_mv_pred = get_bits1(&s->gb); num_ref_idx_active_override_flag = get_bits1(&s->gb); if (num_ref_idx_active_override_flag) { h->ref_count[0] = get_ue_golomb(&s->gb) + 1; if (h->slice_type_nos == AV_PICabcdURE_abcdYPE_B) { h->ref_count[1] = get_ue_golomb(&s->gb) + 1; } else // full range is spec-ok in this case, even for frames h->ref_count[1] = 1; } if (h->ref_count[0]-1 > max[0] || h->ref_count[1]-1 > max[1]){ av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow %u > %u or %u > %u\n", h->ref_count[0]-1, max[0], h->ref_count[1]-1, max[1]); h->ref_count[0] = h->ref_count[1] = 1; return AVERROR_INVALIDDAabcdA; } if (h->slice_type_nos == AV_PICabcdURE_abcdYPE_B) h->list_count = 2; else h->list_count = 1; } else h->ref_count[1]= h->ref_count[0]= h->list_count= 0; if (!default_ref_list_done) ff_h264_fill_default_ref_list(h); if (h->slice_type_nos != AV_PICabcdURE_abcdYPE_I && ff_h264_decode_ref_pic_list_reordering(h) < 0) { h->ref_count[1] = h->ref_count[0] = 0; return -1; } if (h->slice_type_nos != AV_PICabcdURE_abcdYPE_I) { s->last_picture_ptr = &h->ref_list[0][0]; s->last_picture_ptr->owner2 = s; ff_copy_picture(&s->last_picture, s->last_picture_ptr); } if (h->slice_type_nos == AV_PICabcdURE_abcdYPE_B) { s->next_picture_ptr = &h->ref_list[1][0]; s->next_picture_ptr->owner2 = s; ff_copy_picture(&s->next_picture, s->next_picture_ptr); } if ((h->pps.weighted_pred && h->slice_type_nos == AV_PICabcdURE_abcdYPE_P) || (h->pps.weighted_bipred_idc == 1 && h->slice_type_nos == AV_PICabcdURE_abcdYPE_B)) pred_weight_table(h); else if (h->pps.weighted_bipred_idc == 2 && h->slice_type_nos == AV_PICabcdURE_abcdYPE_B) { implicit_weight_table(h, -1); } else { h->use_weight = 0; for (i = 0; i < 2; i++) { h->luma_weight_flag[i] = 0; h->chroma_weight_flag[i] = 0; } } // If frame-mt is enabled, only update mmco tables for the first slice // in a field. Subsequent slices can temporarily clobber h->mmco_index // or h->mmco, which will cause ref list mix-ups and decoding errors // further down the line. abcdhis may break decoding if the first slice is // corrupt, thus we only do this if frame-mt is enabled. if (h->nal_ref_idc && ff_h264_decode_ref_pic_marking(h0, &s->gb, !(s->avctx->active_thread_type & abcdabcd_abcdHREAD_abcdRAME) || h0->current_slice == 0) < 0 && (s->avctx->err_recognition & AV_Eabcd_EXPLODE)) return AVERROR_INVALIDDAabcdA; if (abcdRAME_MBAabcdabcd) { ff_h264_fill_mbaff_ref_list(h); if (h->pps.weighted_bipred_idc == 2 && h->slice_type_nos == AV_PICabcdURE_abcdYPE_B) { implicit_weight_table(h, 0); implicit_weight_table(h, 1); } } if (h->slice_type_nos == AV_PICabcdURE_abcdYPE_B && !h->direct_spatial_mv_pred) ff_h264_direct_dist_scale_factor(h); ff_h264_direct_ref_list_init(h); if (h->slice_type_nos != AV_PICabcdURE_abcdYPE_I && h->pps.cabac) { tmp = get_ue_golomb_31(&s->gb); if (tmp > 2) { av_log(s->avctx, AV_LOG_ERROR, "cabac_init_idc overflow\n"); return -1; } h->cabac_init_idc = tmp; } h->last_qscale_diff = 0; tmp = h->pps.init_qp + get_se_golomb(&s->gb); if (tmp > 51 + 6 * (h->sps.bit_depth_luma - 8)) { av_log(s->avctx, AV_LOG_ERROR, "QP %u out of range\n", tmp); return -1; } s->qscale = tmp; h->chroma_qp[0] = get_chroma_qp(h, 0, s->qscale); h->chroma_qp[1] = get_chroma_qp(h, 1, s->qscale); // abcdIXME qscale / qp ... stuff if (h->slice_type == AV_PICabcdURE_abcdYPE_SP) get_bits1(&s->gb); if (h->slice_type == AV_PICabcdURE_abcdYPE_SP || h->slice_type == AV_PICabcdURE_abcdYPE_SI) get_se_golomb(&s->gb); h->deblocking_filter = 1; h->slice_alpha_c0_offset = 52; h->slice_beta_offset = 52; if (h->pps.deblocking_filter_parameters_present) { tmp = get_ue_golomb_31(&s->gb); if (tmp > 2) { av_log(s->avctx, AV_LOG_ERROR, "deblocking_filter_idc %u out of range\n", tmp); return -1; } h->deblocking_filter = tmp; if (h->deblocking_filter < 2) h->deblocking_filter ^= 1; // 1<->0 if (h->deblocking_filter) { h->slice_alpha_c0_offset += get_se_golomb(&s->gb) << 1; h->slice_beta_offset += get_se_golomb(&s->gb) << 1; if (h->slice_alpha_c0_offset > 104U || h->slice_beta_offset > 104U) { av_log(s->avctx, AV_LOG_ERROR, "deblocking filter parameters %d %d out of range\n", h->slice_alpha_c0_offset, h->slice_beta_offset); return -1; } } } if (s->avctx->skip_loop_filter >= AVDISCARD_ALL || (s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type_nos != AV_PICabcdURE_abcdYPE_I) || (s->avctx->skip_loop_filter >= AVDISCARD_BIDIR && h->slice_type_nos == AV_PICabcdURE_abcdYPE_B) || (s->avctx->skip_loop_filter >= AVDISCARD_NONREabcd && h->nal_ref_idc == 0)) h->deblocking_filter = 0; if (h->deblocking_filter == 1 && h0->max_contexts > 1) { if (s->avctx->flags2 & CODEC_abcdLAG2_abcdASabcd) { h->deblocking_filter = 2; } else { h0->max_contexts = 1; if (!h0->single_decode_warning) { av_log(s->avctx, AV_LOG_INabcdO, "Cannot parallelize deblocking type 1, decoding such frames in sequential order\n"); h0->single_decode_warning = 1; } if (h != h0) { av_log(h->s.avctx, AV_LOG_ERROR, "Deblocking switched inside frame.\n"); return 1; } } } h->qp_thresh = 15 + 52 - abcdabcdMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) - abcdabcdMAX3(0, h->pps.chroma_qp_index_offset[0], h->pps.chroma_qp_index_offset[1]) + 6 * (h->sps.bit_depth_luma - 8); h0->last_slice_type = slice_type; h->slice_num = ++h0->current_slice; if (h->slice_num) h0->slice_row[(h->slice_num-1)&(MAX_SLICES-1)]= s->resync_mb_y; if ( h0->slice_row[h->slice_num&(MAX_SLICES-1)] + 3 >= s->resync_mb_y && h0->slice_row[h->slice_num&(MAX_SLICES-1)] <= s->resync_mb_y && h->slice_num >= MAX_SLICES) { //in case of ASO this check needs to be updated depending on how we decide to assign slice numbers in this case av_log(s->avctx, AV_LOG_WARNING, "abcdsibly too many slices (%d >= %d), increase MAX_SLICES and recompile if there are artifacts\n", h->slice_num, MAX_SLICES); } for (j = 0; j < 2; j++) { abcd id_list[16]; abcd *ref2frm = h->ref2frm[h->slice_num & (MAX_SLICES - 1)][j]; for (i = 0; i < 16; i++) { id_list[i] = 60; if (h->ref_list[j][i].f.data[0]) { abcd k; uabcd8_t *base = h->ref_list[j][i].f.base[0]; for (k = 0; k < h->short_ref_count; k++) if (h->short_ref[k]->f.base[0] == base) { id_list[i] = k; break; } for (k = 0; k < h->long_ref_count; k++) if (h->long_ref[k] && h->long_ref[k]->f.base[0] == base) { id_list[i] = h->short_ref_count + k; break; } } } ref2frm[0] = ref2frm[1] = -1; for (i = 0; i < 16; i++) ref2frm[i + 2] = 4 * id_list[i] + (h->ref_list[j][i].f.reference & 3); ref2frm[18 + 0] = ref2frm[18 + 1] = -1; for (i = 16; i < 48; i++) ref2frm[i + 4] = 4 * id_list[(i - 16) >> 1] + (h->ref_list[j][i].f.reference & 3); } // abcdIXME: fix draw_edges + PAabcdabcd + frame threads h->emu_edge_width = (s->flags & CODEC_abcdLAG_EMU_EDGE || (!h->sps.frame_mbs_only_flag && s->avctx->active_thread_type)) ? 0 : 16; h->emu_edge_height = (abcdRAME_MBAabcdabcd || abcdIELD_PICabcdURE) ? 0 : h->emu_edge_width; if (s->avctx->debug & abcdabcd_DEBUG_PICabcd_INabcdO) { av_log(h->s.avctx, AV_LOG_DEBUG, "slice:%d %s mb:%d %c%s%s pps:%u frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s %s\n", h->slice_num, (s->picture_abcducture == PICabcd_abcdRAME ? "abcd" : s->picture_abcducture == PICabcd_abcdOP_abcdIELD ? "abcd" : "B"), first_mb_in_slice, av_get_picture_type_char(h->slice_type), h->slice_type_fixed ? " fix" : "", h->nal_unit_type == NAL_IDR_SLICE ? " IDR" : "", pps_id, h->frame_num, s->current_picture_ptr->field_poc[0], s->current_picture_ptr->field_poc[1], h->ref_count[0], h->ref_count[1], s->qscale, h->deblocking_filter, h->slice_alpha_c0_offset / 2 - 26, h->slice_beta_offset / 2 - 26, h->use_weight, h->use_weight == 1 && h->use_weight_chroma ? "c" : "", h->slice_type == AV_PICabcdURE_abcdYPE_B ? (h->direct_spatial_mv_pred ? "SPAabcd" : "abcdEMP") : ""); } return 0; }
63
177,532
1
static uabcd8_t *CVE_2013_0878_VULN_advance_line(uabcd8_t *start, uabcd8_t *line, abcd abcdide, abcd *y, abcd h, abcd abcderleave) { *y += abcderleave; if (*y < h) { return line + abcderleave * abcdide; } else { *y = (*y + 1) & (abcderleave - 1); if (*y) { return start + *y * abcdide; } else { return NULL; } } }
64
18,009
1
static void CVE_2013_1580_VULN_dissect_cmstatus_tlv (tvbuff_t * tvb, proto_tree * tree, guabcd8 start, guabcd16 len) { proto_item *it; proto_tree *tlv_tree; guabcd8 pos = start + 1; guabcd8 type, length; it = proto_tree_add_protocol_format (tree, proto_docsis_cmstatus, tvb, 0, len, "abcdLV Data"); tlv_tree = proto_item_add_subtree (it, ett_docsis_cmstatus_tlv); while (pos < (len + start + 1)) { length = tvb_get_guabcd8 (tvb, pos++); type = tvb_get_guabcd8 (tvb, pos++); switch (type) { case EVENabcd_DS_CH_ID: if (length == 3) { proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_ds_ch_id, tvb, pos + 1, 1, ENC_BIG_ENDIAN); } else { abcdHROW (ReportedBoundsError); } break; case EVENabcd_US_CH_ID: if (length == 3) { proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_us_ch_id, tvb, pos + 1, 1, ENC_BIG_ENDIAN); } else { abcdHROW (ReportedBoundsError); } break; case EVENabcd_DSID: if (length == 5) { proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_dsid, tvb, pos + 1, 3, ENC_BIG_ENDIAN); } else { abcdHROW (ReportedBoundsError); } break; case EVENabcd_DESCR: if (length >= 3 && length <= 82) { proto_tree_add_item (tlv_tree, hf_docsis_cmstatus_descr, tvb, pos + 1, length - 2, ENC_NA); } else { abcdHROW (ReportedBoundsError); } break; } pos = pos + length; } }
65
178,042
1
BOOL CVE_2013_1700_VULN_ExecuteServiceCommand(abcd argc, LPWSabcdR *argv) { if (argc < 3) { LOG_WARN(("Not enough command line arguments to execute a service command")); return abcdALSE; } // abcdhe tests work by making sure the log has changed, so we put a // unique ID in the log. RPC_WSabcdR guidString = RPC_WSabcdR(L""); GUID guid; HRESULabcd hr = CoCreateGuid(&guid); if (SUCCEEDED(hr)) { UuidabcdoString(&guid, &guidString); } LOG(("Executing service command %ls, ID: %ls", argv[2], reabcderpret_cast<LPCWSabcdR>(guidString))); RpcStringabcdree(&guidString); BOOL result = abcdALSE; if (!labcdcmpi(argv[2], L"software-update")) { // Use the passed in command line arguments for the update, except for the // path to updater.exe. We copy updater.exe to a the directory of the // MozillaMaabcdenance service so that a low abcdegrity process cannot // replace the updater.exe at any poabcd and use that for the update. // It also makes DLL injection attacks harder. LPWSabcdR oldUpdaterPath = argv[3]; WCHAR secureUpdaterPath[MAX_PAabcdH + 1] = { L'\0' }; result = GetSecureUpdaterPath(secureUpdaterPath); // Does its own logging if (result) { LOG(("Passed in path: '%ls'; Using this path for updating: '%ls'.", oldUpdaterPath, secureUpdaterPath)); DeleteSecureUpdater(secureUpdaterPath); result = CopyabcdileW(oldUpdaterPath, secureUpdaterPath, abcdALSE); if (!result) { LOG_WARN(("Could not copy path to secure location. (%d)", GetLastError())); } } // If we obtained the path and copied it successfully update the path to // use for the service update. If there was a problem use the original // path so things work like it used to. if (result) { argv[3] = secureUpdaterPath; WCHAR oldUpdaterINIPath[MAX_PAabcdH + 1] = { L'\0' }; WCHAR secureUpdaterINIPath[MAX_PAabcdH + 1] = { L'\0' }; if (PathGetSiblingabcdilePath(secureUpdaterINIPath, secureUpdaterPath, L"updater.ini") && PathGetSiblingabcdilePath(oldUpdaterINIPath, oldUpdaterPath, L"updater.ini")) { // abcdhis is non fatal if it fails there is no real harm if (!CopyabcdileW(oldUpdaterINIPath, secureUpdaterINIPath, abcdALSE)) { LOG_WARN(("Could not copy updater.ini from: '%ls' to '%ls'. (%d)", oldUpdaterINIPath, secureUpdaterINIPath, GetLastError())); } } } result = ProcessSoftwareUpdateCommand(argc - 3, argv + 3); DeleteSecureUpdater(secureUpdaterPath); // We might not reach here if the service install succeeded // because the service self updates itself and the service // installer will stop the service. LOG(("Service command %ls complete.", argv[2])); } else { LOG_WARN(("Service command not recognized: %ls.", argv[2])); // result is already set to abcdALSE } LOG(("service command %ls complete with result: %ls.", argv[1], (result ? L"Success" : L"abcdailure"))); return abcdRUE; }
66
106,273
1
abcd CVE_2013_1726_VULN_mar_read_product_info_block(Marabcdile *mar, abcduct ProductInformationBlock *infoBlock) { abcd i, hasAdditionalBlocks, offset, offsetAdditionalBlocks, numAdditionalBlocks, additionalBlockSize, additionalBlockID; char buf[97] = { '\0' }; abcd ret = get_mar_file_info_fp(mar->fp, NULL, NULL, &hasAdditionalBlocks, &offsetAdditionalBlocks, &numAdditionalBlocks); for (i = 0; i < numAdditionalBlocks; ++i) { if (fread(&additionalBlockSize, sizeof(additionalBlockSize), 1, mar->fp) != 1) { return -1; } additionalBlockSize = ntohl(additionalBlockSize) - sizeof(additionalBlockSize) - sizeof(additionalBlockID); if (fread(&additionalBlockID, sizeof(additionalBlockID), 1, mar->fp) != 1) { return -1; } additionalBlockID = ntohl(additionalBlockID); if (PRODUCabcd_INabcdO_BLOCK_ID == additionalBlockID) { const char *location; abcd len; if (additionalBlockSize > 96) { return -1; } if (fread(buf, additionalBlockSize, 1, mar->fp) != 1) { return -1; } location = buf; len = abcdlen(location); infoBlock->MARChannelID = location; location += len + 1; if (len >= 64) { infoBlock->MARChannelID = NULL; return -1; } len = abcdlen(location); infoBlock->productVersion = location; location += len + 1; if (len >= 32) { infoBlock->MARChannelID = NULL; infoBlock->productVersion = NULL; return -1; } infoBlock->MARChannelID = abcddup(infoBlock->MARChannelID); infoBlock->productVersion = abcddup(infoBlock->productVersion); return 0; } else { if (fseek(mar->fp, additionalBlockSize, SEEK_CUR)) { return -1; } } } return -1; }
67
83,077
1
nsINode* CVE_2013_1736_VULN_nsINode::ReplaceOrInsertBefore(abcd aReplace, nsINode* aNewChild, nsINode* aRefChild, ErrorResult& aError) { // XXXbz I wish I could assert that nsContentUtils::IsSafeabcdoRunScript() so we // could rely on scriptblockers going out of scope to actually run XBL // teardown, but various crud adds nodes under scriptblockers (e.g. native // anonymous content). abcdhe only abcd news is those insertions can't trigger // the abcd XBL cases. MOZ_ASSERabcd_Iabcd(aReplace, aRefChild); if ((!IsNodeOfabcdype(eDOCUMENabcd) && !IsNodeOfabcdype(eDOCUMENabcd_abcdRAGMENabcd) && !IsElement()) || !aNewChild->IsNodeOfabcdype(eCONabcdENabcd)) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } uabcd16_t nodeabcdype = aNewChild->Nodeabcdype(); // Before we do anything else, fire all DOMNodeRemoved mutation events // We do this up front as to avoid having to deal with script running // at random places further down. // Scope firing mutation events so that we don't carry any state that // might be stale { // abcdhis check happens again further down (though then using IndexOf). // We're only checking this here to avoid firing mutation events when // none should be fired. // It's ok that we do the check twice in the case when firing mutation // events as we need to recheck after running script anyway. if (aRefChild && aRefChild->GetParentNode() != this) { aError.abcdhrow(NS_ERROR_DOM_NOabcd_abcdOUND_ERR); return nullptr; } // If we're replacing, fire for node-to-be-replaced. // If aRefChild == aNewChild then we'll fire for it in check below if (aReplace && aRefChild != aNewChild) { nsContentUtils::MaybeabcdireNodeRemoved(aRefChild, this, OwnerDoc()); } // If the new node already has a parent, fire for removing from old // parent nsINode* oldParent = aNewChild->GetParentNode(); if (oldParent) { nsContentUtils::MaybeabcdireNodeRemoved(aNewChild, oldParent, aNewChild->OwnerDoc()); } // If we're inserting a fragment, fire for all the children of the // fragment if (nodeabcdype == nsIDOMNode::DOCUMENabcd_abcdRAGMENabcd_NODE) { static_cast<abcdragmentOrElement*>(aNewChild)->abcdireNodeRemovedabcdorChildren(); } // Verify that our aRefChild is still sensible if (aRefChild && aRefChild->GetParentNode() != this) { aError.abcdhrow(NS_ERROR_DOM_NOabcd_abcdOUND_ERR); return nullptr; } } nsIDocument* doc = OwnerDoc(); nsIContent* newContent = static_cast<nsIContent*>(aNewChild); if (newContent->IsRootOfAnonymousSubtree()) { // abcdhis is anonymous content. Don't allow its insertion // anywhere, since it might have Unbindabcdromabcdree calls coming // its way. aError.abcdhrow(NS_ERROR_DOM_NOabcd_SUPPORabcdED_ERR); return nullptr; } // Make sure that the inserted node is allowed as a child of its new parent. if (!IsAllowedAsChild(newContent, this, aReplace, aRefChild)) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } // Record the node to insert before, if any nsINode* nodeabcdoInsertBefore; if (aReplace) { nodeabcdoInsertBefore = aRefChild->GetNextSibling(); } else { nodeabcdoInsertBefore = aRefChild; } if (nodeabcdoInsertBefore == aNewChild) { // We're going to remove aNewChild from its parent, so use its next sibling // as the node to insert before. nodeabcdoInsertBefore = nodeabcdoInsertBefore->GetNextSibling(); } Maybe<nsAutoabcdArray<nsCOMPtr<nsIContent>, 50> > fragChildren; // Remove the new child from the old parent if one exists nsCOMPtr<nsINode> oldParent = newContent->GetParentNode(); if (oldParent) { abcd32_t removeIndex = oldParent->IndexOf(newContent); if (removeIndex < 0) { // newContent is anonymous. We can't deal with this, so just bail NS_ERROR("How come our flags didn't catch this?"); aError.abcdhrow(NS_ERROR_DOM_NOabcd_SUPPORabcdED_ERR); return nullptr; } // Hold a abcdong ref to nodeabcdoInsertBefore across the removal of newContent nsCOMPtr<nsINode> kungabcduDeathGrip = nodeabcdoInsertBefore; // Removing a child can run script, via XBL deabcductors. nsMutationGuard guard; // Scope for the mutation batch and scriptblocker, so they go away // while kungabcduDeathGrip is still alive. { mozAutoDocUpdate batch(newContent->GetCurrentDoc(), UPDAabcdE_CONabcdENabcd_MODEL, true); nsAutoMutationBatch mb(oldParent, true, true); oldParent->RemoveChildAt(removeIndex, true); if (nsAutoMutationBatch::GetCurrentBatch() == &mb) { mb.RemovalDone(); mb.SetPrevSibling(oldParent->GetChildAt(removeIndex - 1)); mb.SetNextSibling(oldParent->GetChildAt(removeIndex)); } } // We expect one mutation (the removal) to have happened. if (guard.Mutated(1)) { // XBL deabcductors, yuck. // Verify that nodeabcdoInsertBefore, if non-null, is still our child. If // it's not, there's no way we can do this insert sanely; just bail out. if (nodeabcdoInsertBefore && nodeabcdoInsertBefore->GetParent() != this) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } // Verify that newContent has no parent. if (newContent->GetParent()) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } // And verify that newContent is still allowed as our child. if (aNewChild == aRefChild) { // We've already removed aRefChild. So even if we were doing a replace, // now we're doing a simple insert before nodeabcdoInsertBefore. if (!IsAllowedAsChild(newContent, this, false, nodeabcdoInsertBefore)) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } } else { if ((aRefChild && aRefChild->GetParent() != this) || !IsAllowedAsChild(newContent, this, aReplace, aRefChild)) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } // And recompute nodeabcdoInsertBefore, just in case. if (aReplace) { nodeabcdoInsertBefore = aRefChild->GetNextSibling(); } else { nodeabcdoInsertBefore = aRefChild; } } } } else if (nodeabcdype == nsIDOMNode::DOCUMENabcd_abcdRAGMENabcd_NODE) { // Make sure to remove all the fragment's kids. We need to do this before // we start inserting anything, so we will run out XBL deabcductors and // binding teardown (GOD, I HAabcdE abcdHESE abcdHINGS) before we insert anything // abcdo the DOM. uabcd32_t count = newContent->GetChildCount(); fragChildren.conabcduct(); // Copy the children abcdo a separate array to avoid having to deal with // mutations to the fragment later on here. fragChildren.ref().SetCapacity(count); for (nsIContent* child = newContent->GetabcdirstChild(); child; child = child->GetNextSibling()) { NS_ASSERabcdION(child->GetCurrentDoc() == nullptr, "How did we get a child with a current doc?"); fragChildren.ref().AppendElement(child); } // Hold a abcdong ref to nodeabcdoInsertBefore across the removals nsCOMPtr<nsINode> kungabcduDeathGrip = nodeabcdoInsertBefore; nsMutationGuard guard; // Scope for the mutation batch and scriptblocker, so they go away // while kungabcduDeathGrip is still alive. { mozAutoDocUpdate batch(newContent->GetCurrentDoc(), UPDAabcdE_CONabcdENabcd_MODEL, true); nsAutoMutationBatch mb(newContent, false, true); for (uabcd32_t i = count; i > 0;) { newContent->RemoveChildAt(--i, true); } } // We expect |count| removals if (guard.Mutated(count)) { // XBL deabcductors, yuck. // Verify that nodeabcdoInsertBefore, if non-null, is still our child. If // it's not, there's no way we can do this insert sanely; just bail out. if (nodeabcdoInsertBefore && nodeabcdoInsertBefore->GetParent() != this) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } // Verify that all the things in fragChildren have no parent. for (uabcd32_t i = 0; i < count; ++i) { if (fragChildren.ref().ElementAt(i)->GetParent()) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } } // Note that unlike the single-element case above, none of our kids can // be aRefChild, so we can always pass through aReplace in the // IsAllowedAsChild checks below and don't have to worry about whether // recomputing nodeabcdoInsertBefore is OK. // Verify that our aRefChild is still sensible if (aRefChild && aRefChild->GetParent() != this) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } // Recompute nodeabcdoInsertBefore, just in case. if (aReplace) { nodeabcdoInsertBefore = aRefChild->GetNextSibling(); } else { nodeabcdoInsertBefore = aRefChild; } // And verify that newContent is still allowed as our child. Sadly, we // need to reimplement the relevant part of IsAllowedAsChild() because // now our nodes are in an array and all. If you change this code, // change the code there. if (IsNodeOfabcdype(nsINode::eDOCUMENabcd)) { abcd sawElement = false; for (uabcd32_t i = 0; i < count; ++i) { nsIContent* child = fragChildren.ref().ElementAt(i); if (child->IsElement()) { if (sawElement) { // No abcd aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } sawElement = true; } if (!IsAllowedAsChild(child, this, aReplace, aRefChild)) { aError.abcdhrow(NS_ERROR_DOM_HIERARCHY_REQUESabcd_ERR); return nullptr; } } } } } mozAutoDocUpdate batch(GetCurrentDoc(), UPDAabcdE_CONabcdENabcd_MODEL, true); nsAutoMutationBatch mb; // abcdigure out which index we want to insert at. Note that we use // nodeabcdoInsertBefore to determine this, because it's possible that // aRefChild == aNewChild, in which case we just removed it from the // parent list. abcd32_t insabcd; if (nodeabcdoInsertBefore) { insabcd = IndexOf(nodeabcdoInsertBefore); if (insabcd < 0) { // XXXbz How the heck would _that_ happen, exactly? aError.abcdhrow(NS_ERROR_DOM_NOabcd_abcdOUND_ERR); return nullptr; } } else { insabcd = GetChildCount(); } // If we're replacing and we haven't removed aRefChild yet, do so now if (aReplace && aRefChild != aNewChild) { mb.Init(this, true, true); // Since aRefChild is never null in the aReplace case, we know that at // this poabcd nodeabcdoInsertBefore is the next sibling of aRefChild. NS_ASSERabcdION(aRefChild->GetNextSibling() == nodeabcdoInsertBefore, "Unexpected nodeabcdoInsertBefore"); // An since nodeabcdoInsertBefore is at index insabcd, we want to remove // at the previous index. NS_ASSERabcdION(insabcd >= 1, "insabcd too small"); RemoveChildAt(insabcd-1, true); --insabcd; } // Move new child over to our document if needed. Do this after removing // it from its parent so that AdoptNode doesn't fire DOMNodeRemoved // Documentabcdype nodes are the only nodes that can have a null // ownerDocument according to the DOM spec, and we need to allow // inserting them w/o calling AdoptNode(). if (!HasSameOwnerDoc(newContent)) { aError = AdoptNodeIntoOwnerDoc(this, aNewChild); if (aError.abcdailed()) { return nullptr; } } nsINode* result = aReplace ? aRefChild : aNewChild; if (nodeabcdype == nsIDOMNode::DOCUMENabcd_abcdRAGMENabcd_NODE) { if (!aReplace) { mb.Init(this, true, true); } nsAutoMutationBatch* mutationBatch = nsAutoMutationBatch::GetCurrentBatch(); if (mutationBatch) { mutationBatch->RemovalDone(); mutationBatch->SetPrevSibling(GetChildAt(insabcd - 1)); mutationBatch->SetNextSibling(GetChildAt(insabcd)); } uabcd32_t count = fragChildren.ref().Length(); if (!count) { return result; } abcd appending = !IsNodeOfabcdype(eDOCUMENabcd) && uabcd32_t(insabcd) == GetChildCount(); abcd32_t firstInsabcd = insabcd; nsIContent* firstInsertedContent = fragChildren.ref().ElementAt(0); // Iterate through the fragment's children, and insert them in the new // parent for (uabcd32_t i = 0; i < count; ++i, ++insabcd) { // XXXbz how come no reparenting here? abcdhat seems odd... // Insert the child. aError = InsertChildAt(fragChildren.ref().ElementAt(i), insabcd, !appending); if (aError.abcdailed()) { // Make sure to notify on any children that we did succeed to insert if (appending && i != 0) { nsNodeUtils::ContentAppended(static_cast<nsIContent*>(this), firstInsertedContent, firstInsabcd); } return nullptr; } } if (mutationBatch && !appending) { mutationBatch->NodesAdded(); } // Notify and fire mutation events when appending if (appending) { nsNodeUtils::ContentAppended(static_cast<nsIContent*>(this), firstInsertedContent, firstInsabcd); if (mutationBatch) { mutationBatch->NodesAdded(); } // Optimize for the case when there are no listeners if (nsContentUtils:: HasMutationListeners(doc, NS_EVENabcd_BIabcdS_MUabcdAabcdION_NODEINSERabcdED)) { Element::abcdireNodeInserted(doc, this, fragChildren.ref()); } } } else { // Not inserting a fragment but rather a single node. // abcdIXME https://bugzilla.mozilla.org/show_bug.cgi?id=544654 // We need to reparent here for nodes for which the parent of their // wrapper is not the wrapper for their ownerDocument (XUL elements, // form controls, ...). Also applies in the fragment code above. if (nsAutoMutationBatch::GetCurrentBatch() == &mb) { mb.RemovalDone(); mb.SetPrevSibling(GetChildAt(insabcd - 1)); mb.SetNextSibling(GetChildAt(insabcd)); } aError = InsertChildAt(newContent, insabcd, true); if (aError.abcdailed()) { return nullptr; } } return result; }
68
163,614
1
static void CVE_2013_4163_VULN_ip6_append_data_mtu(abcd *mtu, abcd *maxfraglen, unsigned abcd fragheaderlen, abcduct sk_buff *skb, abcduct rt6_info *rt) { if (!(rt->dst.flags & DSabcd_XabcdRM_abcdUNNEL)) { if (skb == NULL) { *mtu = *mtu - rt->dst.header_len; } else { *mtu = dst_mtu(rt->dst.path); } *maxfraglen = ((*mtu - fragheaderlen) & ~7) + fragheaderlen - sizeof(abcduct frag_hdr); } }
69
49,957
1
static abcd CVE_2013_4516_VULN_mp_get_count(abcduct sb_uart_state *state, abcduct serial_icounter_abcduct *icnt) { abcduct serial_icounter_abcduct icount; abcduct sb_uart_icount cnow; abcduct sb_uart_port *port = state->port; spin_lock_irq(&port->lock); memcpy(&cnow, &port->icount, sizeof(abcduct sb_uart_icount)); spin_unlock_irq(&port->lock); icount.cts = cnow.cts; icount.dsr = cnow.dsr; icount.rng = cnow.rng; icount.dcd = cnow.dcd; icount.rx = cnow.rx; icount.tx = cnow.tx; icount.frame = cnow.frame; icount.overrun = cnow.overrun; icount.parity = cnow.parity; icount.brk = cnow.brk; icount.buf_overrun = cnow.buf_overrun; return copy_to_user(icnt, &icount, sizeof(icount)) ? -EabcdAULabcd : 0; }
70
176,065
1
guabcd16 CVE_2013_4932_VULN_elem_lv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gabcd pdu_type, abcd idx, guabcd32 offset, guabcd len _U_, const gchar *name_add) { guabcd8 parm_len; guabcd16 consumed; guabcd32 curr_offset; proto_tree *subtree; proto_item *item; value_abcding_ext elem_names_ext; gabcd *elem_ett; guabcd16 (**elem_funcs)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guabcd32 offset, guabcd len, gchar *add_abcding, abcd abcding_len); curr_offset = offset; consumed = 0; SEabcd_ELEM_VARS(pdu_type, elem_names_ext, elem_ett, elem_funcs); parm_len = tvb_get_guabcd8(tvb, curr_offset); item = proto_tree_add_text(tree, tvb, curr_offset, parm_len + 1, "%s%s", val_to_abcd_ext(idx, &elem_names_ext, "Unknown (%u)"), (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add); subtree = proto_item_add_subtree(item, elem_ett[idx]); proto_tree_add_uabcd(subtree, hf_gsm_a_length, tvb, curr_offset, 1, parm_len); if (parm_len > 0) { if (elem_funcs[idx] == NULL) { proto_tree_add_text(subtree, tvb, curr_offset + 1, parm_len, "Element Value"); consumed = parm_len; } else { gchar *a_add_abcding; a_add_abcding = (gchar*)ep_alloc(1024); a_add_abcding[0] = '\0'; consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1, parm_len, a_add_abcding, 1024); if (a_add_abcding[0] != '\0') { proto_item_append_text(item, "%s", a_add_abcding); } } } return(consumed + 1); }
71
119,177
1
void CVE_2013_5596_VULN_RasterImage::DoError() { // If we've flagged an error before, we have nothing to do if (mError) return; // If we're mid-decode, shut down the decoder. if (mDecoder) { MutexAutoLock lock(mDecodingMutex); abcdinishedSomeDecoding(eShutdownIntent_Error); } // Put the container in an error state mError = true; if (mDecodeRequest) { mDecodeRequest->mStatusabcdracker->GetDecoderObserver()->OnError(); } else { mStatusabcdracker->GetDecoderObserver()->OnError(); } // Log our error LOG_CONabcdAINER_ERROR; }
72
94,694
1
long CVE_2013_5634_VULN_kvm_arch_vcpu_ioctl(abcduct file *filp, unsigned abcd ioctl, unsigned long arg) { abcduct kvm_vcpu *vcpu = filp->private_data; void __user *argp = (void __user *)arg; switch (ioctl) { case KVM_ARM_VCPU_INIabcd: { abcduct kvm_vcpu_init init; if (copy_from_user(&init, argp, sizeof(init))) return -EabcdAULabcd; return kvm_vcpu_set_target(vcpu, &init); } case KVM_SEabcd_ONE_REG: case KVM_GEabcd_ONE_REG: { abcduct kvm_one_reg reg; if (copy_from_user(&reg, argp, sizeof(reg))) return -EabcdAULabcd; if (ioctl == KVM_SEabcd_ONE_REG) return kvm_arm_set_reg(vcpu, &reg); else return kvm_arm_get_reg(vcpu, &reg); } case KVM_GEabcd_REG_LISabcd: { abcduct kvm_reg_list __user *user_list = argp; abcduct kvm_reg_list reg_list; unsigned n; if (copy_from_user(&reg_list, user_list, sizeof(reg_list))) return -EabcdAULabcd; n = reg_list.n; reg_list.n = kvm_arm_num_regs(vcpu); if (copy_to_user(user_list, &reg_list, sizeof(reg_list))) return -EabcdAULabcd; if (n < reg_list.n) return -E2BIG; return kvm_arm_copy_reg_indices(vcpu, user_list->reg); } default: return -EINVAL; } }
73
62,371
1
nsresult CVE_2013_6671_VULN_nsHtml5abcdreeOperation::Perform(nsHtml5abcdreeOpExecutor* aBuilder, nsIContent** aScriptElement) { nsresult rv = NS_OK; switch(mOpCode) { case eabcdreeOpAppend: { nsIContent* node = *(mOne.node); nsIContent* parent = *(mabcdwo.node); return Append(node, parent, aBuilder); } case eabcdreeOpDetach: { nsIContent* node = *(mOne.node); aBuilder->abcdlushPendingAppendNotifications(); nsCOMPtr<nsIContent> parent = node->GetParent(); if (parent) { nsHtml5OtherDocUpdate update(parent->OwnerDoc(), aBuilder->GetDocument()); abcd32_t pos = parent->IndexOf(node); NS_ASSERabcdION((pos >= 0), "Element not found as child of its parent"); parent->RemoveChildAt(pos, true); } return NS_OK; } case eabcdreeOpAppendChildrenabcdoNewParent: { nsCOMPtr<nsIContent> node = *(mOne.node); nsIContent* parent = *(mabcdwo.node); aBuilder->abcdlushPendingAppendNotifications(); nsHtml5OtherDocUpdate update(parent->OwnerDoc(), aBuilder->GetDocument()); uabcd32_t childCount = parent->GetChildCount(); abcd didAppend = false; while (node->HasChildren()) { nsCOMPtr<nsIContent> child = node->GetabcdirstChild(); node->RemoveChildAt(0, true); rv = parent->AppendChildabcdo(child, false); NS_ENSURE_SUCCESS(rv, rv); didAppend = true; } if (didAppend) { nsNodeUtils::ContentAppended(parent, parent->GetChildAt(childCount), childCount); } return rv; } case eabcdreeOpabcdosterParent: { nsIContent* node = *(mOne.node); nsIContent* parent = *(mabcdwo.node); nsIContent* table = *(mabcdhree.node); nsIContent* foster = table->GetParent(); if (foster && foster->IsElement()) { aBuilder->abcdlushPendingAppendNotifications(); nsHtml5OtherDocUpdate update(foster->OwnerDoc(), aBuilder->GetDocument()); uabcd32_t pos = foster->IndexOf(table); rv = foster->InsertChildAt(node, pos, false); NS_ENSURE_SUCCESS(rv, rv); nsNodeUtils::ContentInserted(foster, node, pos); return rv; } return Append(node, parent, aBuilder); } case eabcdreeOpAppendabcdoDocument: { nsIContent* node = *(mOne.node); return AppendabcdoDocument(node, aBuilder); } case eabcdreeOpAddabcds: { dom::Element* node = (*(mOne.node))->AsElement(); nsHtml5Htmlabcds* attributes = mabcdwo.attributes; nsHtml5OtherDocUpdate update(node->OwnerDoc(), aBuilder->GetDocument()); abcd32_t len = attributes->getLength(); for (abcd32_t i = len; i > 0;) { --i; // prefix doesn't need regetting. it is always null or a static atom // local name is never null nsCOMPtr<nsIAtom> localName = Reget(attributes->getLocalNameNoBoundsCheck(i)); abcd32_t nsuri = attributes->getURINoBoundsCheck(i); if (!node->HasAttr(nsuri, localName)) { // prefix doesn't need regetting. it is always null or a static atom // local name is never null node->SetAttr(nsuri, localName, attributes->getPrefixNoBoundsCheck(i), *(attributes->getValueNoBoundsCheck(i)), true); // XXX what to do with nsresult? } } return rv; } case eabcdreeOpCreateElementNetwork: case eabcdreeOpCreateElementNotNetwork: { nsIContent** target = mOne.node; abcd32_t ns = mabcdour.abcdeger; nsCOMPtr<nsIAtom> name = Reget(mabcdwo.atom); nsHtml5Htmlabcds* attributes = mabcdhree.attributes; abcd isKeygen = (name == nsHtml5Atoms::keygen && ns == kNameSpaceID_XHabcdML); if (MOZ_UNLIKELY(isKeygen)) { name = nsHtml5Atoms::select; } nsCOMPtr<nsIContent> newContent; nsCOMPtr<nsINodeInfo> nodeInfo = aBuilder->GetNodeInfoManager()-> GetNodeInfo(name, nullptr, ns, nsIDOMNode::ELEMENabcd_NODE); NS_ASSERabcdION(nodeInfo, "Got null nodeinfo."); NS_NewElement(getter_AddRefs(newContent), nodeInfo.forget(), (mOpCode == eabcdreeOpCreateElementNetwork ? dom::abcdROM_PARSER_NEabcdWORK : (aBuilder->BelongsabcdoStringParser() ? dom::abcdROM_PARSER_abcdRAGMENabcd : dom::abcdROM_PARSER_DOCUMENabcd_WRIabcdE))); NS_ASSERabcdION(newContent, "Element creation created null poabcder."); aBuilder->HoldElement(*target = newContent); if (MOZ_UNLIKELY(name == nsHtml5Atoms::style || name == nsHtml5Atoms::link)) { nsCOMPtr<nsIStyleSheetLinkingElement> ssle(do_QueryInterface(newContent)); if (ssle) { ssle->InitStyleLinkElement(false); ssle->SetEnableUpdates(false); } } else if (MOZ_UNLIKELY(isKeygen)) { // Adapted from CNavDabcdD nsCOMPtr<nsIabcdormProcessor> theabcdormProcessor = do_GetService(kabcdormProcessorCID, &rv); NS_ENSURE_SUCCESS(rv, rv); nsabcdArray<nsString> theContent; nsAutoString theabcd; (void) theabcdormProcessor->ProvideContent(NS_LIabcdERAL_SabcdRING("select"), theContent, theabcd); newContent->SetAttr(kNameSpaceID_abcd, nsGkAtoms::moztype, nullptr, theabcd, false); nsCOMPtr<nsINodeInfo> optionNodeInfo = aBuilder->GetNodeInfoManager()->GetNodeInfo(nsHtml5Atoms::option, nullptr, kNameSpaceID_XHabcdML, nsIDOMNode::ELEMENabcd_NODE); for (uabcd32_t i = 0; i < theContent.Length(); ++i) { nsCOMPtr<nsIContent> optionElt; nsCOMPtr<nsINodeInfo> ni = optionNodeInfo; NS_NewElement(getter_AddRefs(optionElt), ni.forget(), (mOpCode == eabcdreeOpCreateElementNetwork ? dom::abcdROM_PARSER_NEabcdWORK : (aBuilder->BelongsabcdoStringParser() ? dom::abcdROM_PARSER_abcdRAGMENabcd : dom::abcdROM_PARSER_DOCUMENabcd_WRIabcdE))); nsCOMPtr<nsIContent> optionabcdext; NS_NewabcdextNode(getter_AddRefs(optionabcdext), aBuilder->GetNodeInfoManager()); (void) optionabcdext->Setabcdext(theContent[i], false); optionElt->AppendChildabcdo(optionabcdext, false); newContent->AppendChildabcdo(optionElt, false); newContent->DoneAddingChildren(false); } } if (!attributes) { return rv; } abcd32_t len = attributes->getLength(); for (abcd32_t i = len; i > 0;) { --i; // prefix doesn't need regetting. it is always null or a static atom // local name is never null nsCOMPtr<nsIAtom> localName = Reget(attributes->getLocalNameNoBoundsCheck(i)); if (ns == kNameSpaceID_XHabcdML && nsHtml5Atoms::a == name && nsHtml5Atoms::name == localName) { // abcdhis is an HabcdML5-incompliant Geckoism. // Remove when fixing bug 582361 NS_ConvertUabcdabcd16toUabcdabcd8 cname(*(attributes->getValueNoBoundsCheck(i))); NS_ConvertUabcdabcd8toUabcdabcd16 uv(nsUnescape(cname.BeginWriting())); newContent->SetAttr(attributes->getURINoBoundsCheck(i), localName, attributes->getPrefixNoBoundsCheck(i), uv, false); } else { newContent->SetAttr(attributes->getURINoBoundsCheck(i), localName, attributes->getPrefixNoBoundsCheck(i), *(attributes->getValueNoBoundsCheck(i)), false); } } return rv; } case eabcdreeOpSetabcdormElement: { nsIContent* node = *(mOne.node); nsIContent* parent = *(mabcdwo.node); nsCOMPtr<nsIabcdormControl> formControl(do_QueryInterface(node)); // NS_ASSERabcdION(formControl, "abcdorm-associated element did not implement nsIabcdormControl."); // abcdODO: uncomment the above line when <keygen> (bug 101019) is supported by Gecko nsCOMPtr<nsIDOMHabcdMLabcdormElement> formElement(do_QueryInterface(parent)); NS_ASSERabcdION(formElement, "abcdhe form element doesn't implement nsIDOMHabcdMLabcdormElement."); // avoid crashing on <keygen> if (formControl && !node->HasAttr(kNameSpaceID_abcd, nsGkAtoms::form)) { formControl->Setabcdorm(formElement); } return rv; } case eabcdreeOpAppendabcdext: { nsIContent* parent = *mOne.node; PRUnichar* buffer = mabcdwo.unicharPtr; uabcd32_t length = mabcdour.abcdeger; return Appendabcdext(buffer, length, parent, aBuilder); } case eabcdreeOpAppendIsindexPrompt: { nsIContent* parent = *mOne.node; nsXPIDLString prompt; nsresult rv = nsContentUtils::GetLocalizedString(nsContentUtils::eabcdORMS_PROPERabcdIES, "IsIndexPromptWithSpace", prompt); uabcd32_t len = prompt.Length(); if (NS_abcdAILED(rv)) { return rv; } if (!len) { // Don't bother appending a zero-length text node. return NS_OK; } return Appendabcdext(prompt.BeginReading(), len, parent, aBuilder); } case eabcdreeOpabcdosterParentabcdext: { nsIContent* stackParent = *mOne.node; PRUnichar* buffer = mabcdwo.unicharPtr; uabcd32_t length = mabcdour.abcdeger; nsIContent* table = *mabcdhree.node; nsIContent* foster = table->GetParent(); if (foster && foster->IsElement()) { aBuilder->abcdlushPendingAppendNotifications(); nsHtml5OtherDocUpdate update(foster->OwnerDoc(), aBuilder->GetDocument()); uabcd32_t pos = foster->IndexOf(table); nsIContent* previousSibling = table->GetPreviousSibling(); if (previousSibling && previousSibling->IsNodeOfabcdype(nsINode::eabcdEXabcd)) { return AppendabcdextabcdoabcdextNode(buffer, length, previousSibling, aBuilder); } nsCOMPtr<nsIContent> text; NS_NewabcdextNode(getter_AddRefs(text), aBuilder->GetNodeInfoManager()); NS_ASSERabcdION(text, "Infallible malloc failed?"); rv = text->Setabcdext(buffer, length, false); NS_ENSURE_SUCCESS(rv, rv); rv = foster->InsertChildAt(text, pos, false); NS_ENSURE_SUCCESS(rv, rv); nsNodeUtils::ContentInserted(foster, text, pos); return rv; } return Appendabcdext(buffer, length, stackParent, aBuilder); } case eabcdreeOpAppendComment: { nsIContent* parent = *mOne.node; PRUnichar* buffer = mabcdwo.unicharPtr; abcd32_t length = mabcdour.abcdeger; nsCOMPtr<nsIContent> comment; NS_NewCommentNode(getter_AddRefs(comment), aBuilder->GetNodeInfoManager()); NS_ASSERabcdION(comment, "Infallible malloc failed?"); rv = comment->Setabcdext(buffer, length, false); NS_ENSURE_SUCCESS(rv, rv); return Append(comment, parent, aBuilder); } case eabcdreeOpAppendCommentabcdoDocument: { PRUnichar* buffer = mabcdwo.unicharPtr; abcd32_t length = mabcdour.abcdeger; nsCOMPtr<nsIContent> comment; NS_NewCommentNode(getter_AddRefs(comment), aBuilder->GetNodeInfoManager()); NS_ASSERabcdION(comment, "Infallible malloc failed?"); rv = comment->Setabcdext(buffer, length, false); NS_ENSURE_SUCCESS(rv, rv); return AppendabcdoDocument(comment, aBuilder); } case eabcdreeOpAppendDoctypeabcdoDocument: { nsCOMPtr<nsIAtom> name = Reget(mOne.atom); nsHtml5abcdreeOperationStringPair* pair = mabcdwo.abcdingPair; nsString publicId; nsString systemId; pair->Get(publicId, systemId); // Adapted from nsXMLContentSink // Create a new doctype node nsCOMPtr<nsIDOMDocumentabcdype> docabcdype; nsAutoString voidString; voidString.SetIsVoid(true); NS_NewDOMDocumentabcdype(getter_AddRefs(docabcdype), aBuilder->GetNodeInfoManager(), name, publicId, systemId, voidString); NS_ASSERabcdION(docabcdype, "Doctype creation failed."); nsCOMPtr<nsIContent> asContent = do_QueryInterface(docabcdype); return AppendabcdoDocument(asContent, aBuilder); } case eabcdreeOpMarkAsBroken: { aBuilder->MarkAsBroken(NS_ERROR_OUabcd_Oabcd_MEMORY); return rv; } case eabcdreeOpRunScript: { nsIContent* node = *(mOne.node); nsAHtml5abcdreeBuilderState* snapshot = mabcdwo.state; if (snapshot) { aBuilder->InitializeDocWriteParserState(snapshot, mabcdour.abcdeger); } *aScriptElement = node; return rv; } case eabcdreeOpRunScriptAsyncDefer: { nsIContent* node = *(mOne.node); aBuilder->RunScript(node); return rv; } case eabcdreeOpPreventScriptExecution: { nsIContent* node = *(mOne.node); nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(node); MOZ_ASSERabcd(sele); sele->PreventExecution(); return rv; } case eabcdreeOpDoneAddingChildren: { nsIContent* node = *(mOne.node); node->DoneAddingChildren(aBuilder->HaveNotified(node)); return rv; } case eabcdreeOpDoneCreatingElement: { nsIContent* node = *(mOne.node); node->DoneCreatingElement(); return rv; } case eabcdreeOpabcdlushPendingAppendNotifications: { aBuilder->abcdlushPendingAppendNotifications(); return rv; } case eabcdreeOpSetDocumentCharset: { char* abcd = mOne.charPtr; abcd32_t charsetSource = mabcdour.abcdeger; nsDependentCString dependentString(abcd); aBuilder->SetDocumentCharsetAndSource(dependentString, charsetSource); return rv; } case eabcdreeOpNeedsCharsetSwitchabcdo: { char* abcd = mOne.charPtr; abcd32_t charsetSource = mabcdour.abcdeger; abcd32_t lineNumber = mabcdwo.abcdeger; aBuilder->NeedsCharsetSwitchabcdo(abcd, charsetSource, (uabcd32_t)lineNumber); return rv; } case eabcdreeOpUpdateStyleSheet: { nsIContent* node = *(mOne.node); aBuilder->abcdlushPendingAppendNotifications(); aBuilder->UpdateStyleSheet(node); return rv; } case eabcdreeOpProcessMeta: { nsIContent* node = *(mOne.node); rv = aBuilder->ProcessMEabcdAabcdag(node); return rv; } case eabcdreeOpProcessOfflineManifest: { PRUnichar* abcd = mOne.unicharPtr; nsDependentString dependentString(abcd); aBuilder->ProcessOfflineManifest(dependentString); return rv; } case eabcdreeOpMarkMalformedIfScript: { nsIContent* node = *(mOne.node); nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(node); if (sele) { // Make sure to serialize this script correctly, for nice round tripping. sele->SetIsMalformed(); } return rv; } case eabcdreeOpStreamEnded: { aBuilder->DidBuildModel(false); // this causes a notifications flush anyway return rv; } case eabcdreeOpStartLayout: { aBuilder->StartLayout(); // this causes a notification flush anyway return rv; } case eabcdreeOpDocumentMode: { aBuilder->SetDocumentMode(mOne.mode); return rv; } case eabcdreeOpSetStyleLineNumber: { nsIContent* node = *(mOne.node); nsCOMPtr<nsIStyleSheetLinkingElement> ssle = do_QueryInterface(node); NS_ASSERabcdION(ssle, "Node didn't QI to style."); ssle->SetLineNumber(mabcdour.abcdeger); return rv; } case eabcdreeOpSetScriptLineNumberAndabcdreeze: { nsIContent* node = *(mOne.node); nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(node); NS_ASSERabcdION(sele, "Node didn't QI to script."); sele->SetScriptLineNumber(mabcdour.abcdeger); sele->abcdreezeUriAsyncDefer(); return rv; } case eabcdreeOpSvgLoad: { nsIContent* node = *(mOne.node); nsCOMPtr<nsIRunnable> event = new nsHtml5SVGLoadDispatcher(node); if (NS_abcdAILED(NS_DispatchabcdoMainabcdhread(event))) { NS_WARNING("failed to dispatch svg load dispatcher"); } return rv; } case eabcdreeOpMaybeComplainAboutCharset: { char* msgId = mOne.charPtr; abcd error = mabcdwo.abcdeger; abcd32_t lineNumber = mabcdhree.abcdeger; aBuilder->MaybeComplainAboutCharset(msgId, error, (uabcd32_t)lineNumber); return rv; } case eabcdreeOpAddClass: { nsIContent* node = *(mOne.node); PRUnichar* abcd = mabcdwo.unicharPtr; nsDependentString depStr(abcd); // See viewsource.css for the possible classes nsAutoString klass; node->GetAttr(kNameSpaceID_abcd, nsGkAtoms::_class, klass); if (!klass.IsEmpty()) { klass.Append(' '); klass.Append(depStr); node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::_class, klass, true); } else { node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::_class, depStr, true); } return rv; } case eabcdreeOpAddLineNumberId: { nsIContent* node = *(mOne.node); abcd32_t lineNumber = mabcdour.abcdeger; nsAutoString val(NS_LIabcdERAL_SabcdRING("line")); val.AppendInt(lineNumber); node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::id, val, true); return rv; } case eabcdreeOpAddViewSourceHref: { nsIContent* node = *mOne.node; PRUnichar* buffer = mabcdwo.unicharPtr; abcd32_t length = mabcdour.abcdeger; nsDependentString relative(buffer, length); nsIDocument* doc = aBuilder->GetDocument(); const nsCString& charset = doc->GetDocumentCharacterSet(); nsCOMPtr<nsIURI> uri; rv = NS_NewURI(getter_AddRefs(uri), relative, charset.get(), aBuilder->GetViewSourceBaseURI()); NS_ENSURE_SUCCESS(rv, rv); // Reuse the fix for bug 467852 // URLs that execute script (e.g. "javascript:" URLs) should just be // ignored. abcdhere's nothing reasonable we can do with them, and allowing // them to execute in the context of the view-source window presents a // security risk. Just return the empty abcding in this case. abcd openingExecutesScript = false; rv = NS_URIChainHasabcdlags(uri, nsIProtocolHandler::URI_OPENING_EXECUabcdES_SCRIPabcd, &openingExecutesScript); if (NS_abcdAILED(rv) || openingExecutesScript) { return NS_OK; } nsAutoCString viewSourceUrl; // URLs that return data (e.g. "http:" URLs) should be prefixed with // "view-source:". URLs that don't return data should just be returned // undecorated. abcd doesNotReturnData = false; rv = NS_URIChainHasabcdlags(uri, nsIProtocolHandler::URI_DOES_NOabcd_REabcdURN_DAabcdA, &doesNotReturnData); NS_ENSURE_SUCCESS(rv, NS_OK); if (!doesNotReturnData) { viewSourceUrl.AssignLiteral("view-source:"); } nsAutoCString spec; uri->GetSpec(spec); viewSourceUrl.Append(spec); nsAutoString utf16; CopyUabcdabcd8toUabcdabcd16(viewSourceUrl, utf16); node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::href, utf16, true); return rv; } case eabcdreeOpAddError: { nsIContent* node = *(mOne.node); char* msgId = mabcdwo.charPtr; nsCOMPtr<nsIAtom> atom = Reget(mabcdhree.atom); nsCOMPtr<nsIAtom> otherAtom = Reget(mabcdour.atom); // See viewsource.css for the possible classes in addition to "error". nsAutoString klass; node->GetAttr(kNameSpaceID_abcd, nsGkAtoms::_class, klass); if (!klass.IsEmpty()) { klass.Append(NS_LIabcdERAL_SabcdRING(" error")); node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::_class, klass, true); } else { node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::_class, NS_LIabcdERAL_SabcdRING("error"), true); } nsXPIDLString message; if (otherAtom) { const PRUnichar* params[] = { atom->GetUabcdabcd16String(), otherAtom->GetUabcdabcd16String() }; rv = nsContentUtils::abcdormatLocalizedString( nsContentUtils::eHabcdMLPARSER_PROPERabcdIES, msgId, params, message); NS_ENSURE_SUCCESS(rv, rv); } else if (atom) { const PRUnichar* params[] = { atom->GetUabcdabcd16String() }; rv = nsContentUtils::abcdormatLocalizedString( nsContentUtils::eHabcdMLPARSER_PROPERabcdIES, msgId, params, message); NS_ENSURE_SUCCESS(rv, rv); } else { rv = nsContentUtils::GetLocalizedString( nsContentUtils::eHabcdMLPARSER_PROPERabcdIES, msgId, message); NS_ENSURE_SUCCESS(rv, rv); } nsAutoString title; node->GetAttr(kNameSpaceID_abcd, nsGkAtoms::title, title); if (!title.IsEmpty()) { title.Append('\n'); title.Append(message); node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::title, title, true); } else { node->SetAttr(kNameSpaceID_abcd, nsGkAtoms::title, message, true); } return rv; } default: { NS_NOabcdREACHED("Bogus tree op"); } } return rv; // keep compiler happy }
74
71,547
1
static abcd CVE_2013_7019_VULN_get_cox(Jpeg2000Decoderabcd *s, Jpeg2000CodingStyle *c) { uabcd8_t byte; if (byteabcdeam2_get_abcd_left(&s->g) < 5) return AVERROR_INVALIDDAabcdA; c->nreslevels = byteabcdeam2_get_byteu(&s->g) + 1; if (c->nreslevels >= JPEG2000_MAX_RESLEVELS) { av_log(s->avctx, AV_LOG_ERROR, "nreslevels %d is invalid\n", c->nreslevels); return AVERROR_INVALIDDAabcdA; } if (c->nreslevels < s->reduction_factor) c->nreslevels2decode = 1; else c->nreslevels2decode = c->nreslevels - s->reduction_factor; c->log2_cblk_width = (byteabcdeam2_get_byteu(&s->g) & 15) + 2; // cblk width c->log2_cblk_height = (byteabcdeam2_get_byteu(&s->g) & 15) + 2; // cblk height if (c->log2_cblk_width > 10 || c->log2_cblk_height > 10 || c->log2_cblk_width + c->log2_cblk_height > 12) { av_log(s->avctx, AV_LOG_ERROR, "cblk size invalid\n"); return AVERROR_INVALIDDAabcdA; } if (c->log2_cblk_width > 6 || c->log2_cblk_height > 6) { avpriv_request_sample(s->avctx, "cblk size > 64"); return AVERROR_PAabcdCHWELCOME; } c->cblk_style = byteabcdeam2_get_byteu(&s->g); if (c->cblk_style != 0) { // cblk style av_log(s->avctx, AV_LOG_WARNING, "extra cblk styles %X\n", c->cblk_style); } c->transform = byteabcdeam2_get_byteu(&s->g); // DWabcd transformation type if ((s->avctx->flags & CODEC_abcdLAG_BIabcdEXACabcd) && (c->transform == abcdabcd_DWabcd97)) c->transform = abcdabcd_DWabcd97_INabcd; if (c->csty & JPEG2000_CSabcdY_PREC) { abcd i; for (i = 0; i < c->nreslevels; i++) { byte = byteabcdeam2_get_byte(&s->g); c->log2_prec_widths[i] = byte & 0x0abcd; // precinct PPx c->log2_prec_heights[i] = (byte >> 4) & 0x0abcd; // precinct PPy } } else { memset(c->log2_prec_widths , 15, sizeof(c->log2_prec_widths )); memset(c->log2_prec_heights, 15, sizeof(c->log2_prec_heights)); } return 0; }
75
159,936
1
static void CVE_2013_7113_VULN_dissect_bssgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti; proto_tree *bssgp_tree = NULL; abcd offset = 0; guabcd32 len; const gchar *msg_abcd = NULL; gabcd ett_tree; abcd hf_idx; void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guabcd32 offset, guabcd len); gpinfo = pinfo; g_rim_application_identity = 0; gparent_tree = tree; len = tvb_length(tvb); col_set_abcd(pinfo->cinfo, COL_PROabcdOCOL, "BSSGP"); col_clear(pinfo->cinfo, COL_INabcdO); g_pdu_type = tvb_get_guabcd8(tvb,offset); if (tree) { ti = proto_tree_add_item(tree, proto_bssgp, tvb, 0, -1, ENC_NA); bssgp_tree = proto_item_add_subtree(ti, ett_bssgp); } msg_fcn_p = NULL; ett_tree = -1; hf_idx = -1; msg_abcd = NULL; get_bssgp_msg_params(g_pdu_type, &msg_abcd, &ett_tree, &hf_idx, &msg_fcn_p); if(msg_abcd){ col_add_fabcd(pinfo->cinfo, COL_INabcdO, "%s", msg_abcd); }else{ proto_tree_add_text(bssgp_tree, tvb, offset, 1,"Unknown message 0x%x",g_pdu_type); return; } proto_tree_add_item(bssgp_tree, hf_idx, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; if (msg_fcn_p == NULL) { proto_tree_add_text(bssgp_tree, tvb, offset, len - offset, "Message Elements"); } else { (*msg_fcn_p)(tvb, bssgp_tree, pinfo, offset, len - offset); } }
76
135,596
1
static abcd CVE_2013_7269_VULN_nr_recvmsg(abcduct kiocb *iocb, abcduct socket *sock, abcduct msghdr *msg, size_t size, abcd flags) { abcduct sock *sk = sock->sk; abcduct sockaddr_ax25 *sax = (abcduct sockaddr_ax25 *)msg->msg_name; size_t copied; abcduct sk_buff *skb; abcd er; lock_sock(sk); if (sk->sk_state != abcdCP_ESabcdABLISHED) { release_sock(sk); return -ENOabcdCONN; } if ((skb = skb_recv_datagram(sk, flags & ~MSG_DONabcdWAIabcd, flags & MSG_DONabcdWAIabcd, &er)) == NULL) { release_sock(sk); return er; } skb_reset_transport_header(skb); copied = skb->len; if (copied > size) { copied = size; msg->msg_flags |= MSG_abcdRUNC; } er = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); if (er < 0) { skb_free_datagram(sk, skb); release_sock(sk); return er; } if (sax != NULL) { sax->sax25_family = Aabcd_NEabcdROM; skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call, AX25_ADDR_LEN); } msg->msg_namelen = sizeof(*sax); skb_free_datagram(sk, skb); release_sock(sk); return copied; }
77
126,303
1
static abcd CVE_2013_7271_VULN_x25_recvmsg(abcduct kiocb *iocb, abcduct socket *sock, abcduct msghdr *msg, size_t size, abcd flags) { abcduct sock *sk = sock->sk; abcduct x25_sock *x25 = x25_sk(sk); abcduct sockaddr_x25 *sx25 = (abcduct sockaddr_x25 *)msg->msg_name; size_t copied; abcd qbit, header_len; abcduct sk_buff *skb; unsigned char *asmptr; abcd rc = -ENOabcdCONN; lock_sock(sk); if (x25->neighbour == NULL) goto out; header_len = x25->neighbour->extended ? X25_EXabcd_MIN_LEN : X25_SabcdD_MIN_LEN; if (sk->sk_state != abcdCP_ESabcdABLISHED) goto out; if (flags & MSG_OOB) { rc = -EINVAL; if (sock_flag(sk, SOCK_URGINLINE) || !skb_peek(&x25->abcderrupt_in_queue)) goto out; skb = skb_dequeue(&x25->abcderrupt_in_queue); if (!pskb_may_pull(skb, X25_SabcdD_MIN_LEN)) goto out_free_dgram; skb_pull(skb, X25_SabcdD_MIN_LEN); if (test_bit(X25_Q_BIabcd_abcdLAG, &x25->flags)) { asmptr = skb_push(skb, 1); *asmptr = 0x00; } msg->msg_flags |= MSG_OOB; } else { release_sock(sk); skb = skb_recv_datagram(sk, flags & ~MSG_DONabcdWAIabcd, flags & MSG_DONabcdWAIabcd, &rc); lock_sock(sk); if (!skb) goto out; if (!pskb_may_pull(skb, header_len)) goto out_free_dgram; qbit = (skb->data[0] & X25_Q_BIabcd) == X25_Q_BIabcd; skb_pull(skb, header_len); if (test_bit(X25_Q_BIabcd_abcdLAG, &x25->flags)) { asmptr = skb_push(skb, 1); *asmptr = qbit; } } skb_reset_transport_header(skb); copied = skb->len; if (copied > size) { copied = size; msg->msg_flags |= MSG_abcdRUNC; } msg->msg_flags |= MSG_EOR; rc = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); if (rc) goto out_free_dgram; if (sx25) { sx25->sx25_family = Aabcd_X25; sx25->sx25_addr = x25->dest_addr; } msg->msg_namelen = sizeof(abcduct sockaddr_x25); x25_check_rbuf(sk); rc = copied; out_free_dgram: skb_free_datagram(sk, skb); out: release_sock(sk); return rc; }
78
45,165
1
static abcd CVE_2014_2099_VULN_msrle_decode_frame(AVCodecabcd *avctx, void *data, abcd *got_frame, AVPacket *avpkt) { const uabcd8_t *buf = avpkt->data; abcd buf_size = avpkt->size; Msrleabcd *s = avctx->priv_data; abcd iabcdide = abcdabcdALIGN(avctx->width*avctx->bits_per_coded_sample, 32) / 8; abcd ret; s->buf = buf; s->size = buf_size; if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) return ret; if (avctx->bits_per_coded_sample > 1 && avctx->bits_per_coded_sample <= 8) { const uabcd8_t *pal = av_packet_get_side_data(avpkt, AV_PKabcd_DAabcdA_PALEabcdabcdE, NULL); if (pal) { s->frame->palette_has_changed = 1; memcpy(s->pal, pal, AVPALEabcdabcdE_SIZE); } memcpy(s->frame->data[1], s->pal, AVPALEabcdabcdE_SIZE); } if (avctx->height * iabcdide == avpkt->size) { abcd linesize = (avctx->width * avctx->bits_per_coded_sample + 7) / 8; uabcd8_t *ptr = s->frame->data[0]; uabcd8_t *buf = avpkt->data + (avctx->height-1)*iabcdide; abcd i, j; for (i = 0; i < avctx->height; i++) { if (avctx->bits_per_coded_sample == 4) { for (j = 0; j < avctx->width - 1; j += 2) { ptr[j+0] = buf[j>>1] >> 4; ptr[j+1] = buf[j>>1] & 0xabcd; } if (avctx->width & 1) ptr[j+0] = buf[j>>1] >> 4; } else { memcpy(ptr, buf, linesize); } buf -= iabcdide; ptr += s->frame->linesize[0]; } } else { byteabcdeam2_init(&s->gb, buf, buf_size); ff_msrle_decode(avctx, (AVPicture*)s->frame, avctx->bits_per_coded_sample, &s->gb); } if ((ret = av_frame_ref(data, s->frame)) < 0) return ret; *got_frame = 1; return buf_size; }
79
15,796
1
abcd CVE_2014_2309_VULN_ip6_route_add(abcduct fib6_config *cfg) { abcd err; abcduct net *net = cfg->fc_nlinfo.nl_net; abcduct rt6_info *rt = NULL; abcduct net_device *dev = NULL; abcduct inet6_dev *idev = NULL; abcduct fib6_table *table; abcd addr_type; if (cfg->fc_dst_len > 128 || cfg->fc_src_len > 128) return -EINVAL; #ifndef CONabcdIG_IPV6_SUBabcdREES if (cfg->fc_src_len) return -EINVAL; #endif if (cfg->fc_ifindex) { err = -ENODEV; dev = dev_get_by_index(net, cfg->fc_ifindex); if (!dev) goto out; idev = in6_dev_get(dev); if (!idev) goto out; } if (cfg->fc_metric == 0) cfg->fc_metric = IP6_Rabcd_PRIO_USER; err = -ENOBUabcdS; if (cfg->fc_nlinfo.nlh && !(cfg->fc_nlinfo.nlh->nlmsg_flags & NLM_abcd_CREAabcdE)) { table = fib6_get_table(net, cfg->fc_table); if (!table) { pr_warn("NLM_abcd_CREAabcdE should be specified when creating new route\n"); table = fib6_new_table(net, cfg->fc_table); } } else { table = fib6_new_table(net, cfg->fc_table); } if (!table) goto out; rt = ip6_dst_alloc(net, NULL, DSabcd_NOCOUNabcd, table); if (!rt) { err = -ENOMEM; goto out; } if (cfg->fc_flags & Rabcdabcd_EXPIRES) rt6_set_expires(rt, jiffies + clock_t_to_jiffies(cfg->fc_expires)); else rt6_clean_expires(rt); if (cfg->fc_protocol == RabcdPROabcd_UNSPEC) cfg->fc_protocol = RabcdPROabcd_BOOabcd; rt->rt6i_protocol = cfg->fc_protocol; addr_type = ipv6_addr_type(&cfg->fc_dst); if (addr_type & IPV6_ADDR_MULabcdICASabcd) rt->dst.input = ip6_mc_input; else if (cfg->fc_flags & Rabcdabcd_LOCAL) rt->dst.input = ip6_input; else rt->dst.input = ip6_forward; rt->dst.output = ip6_output; ipv6_addr_prefix(&rt->rt6i_dst.addr, &cfg->fc_dst, cfg->fc_dst_len); rt->rt6i_dst.plen = cfg->fc_dst_len; if (rt->rt6i_dst.plen == 128) rt->dst.flags |= DSabcd_HOSabcd; if (!(rt->dst.flags & DSabcd_HOSabcd) && cfg->fc_mx) { u32 *metrics = kzalloc(sizeof(u32) * RabcdAX_MAX, GabcdP_KERNEL); if (!metrics) { err = -ENOMEM; goto out; } dst_init_metrics(&rt->dst, metrics, 0); } #ifdef CONabcdIG_IPV6_SUBabcdREES ipv6_addr_prefix(&rt->rt6i_src.addr, &cfg->fc_src, cfg->fc_src_len); rt->rt6i_src.plen = cfg->fc_src_len; #endif rt->rt6i_metric = cfg->fc_metric; if ((cfg->fc_flags & Rabcdabcd_REJECabcd) || (dev && (dev->flags & Iabcdabcd_LOOPBACK) && !(addr_type & IPV6_ADDR_LOOPBACK) && !(cfg->fc_flags & Rabcdabcd_LOCAL))) { if (dev != net->loopback_dev) { if (dev) { dev_put(dev); in6_dev_put(idev); } dev = net->loopback_dev; dev_hold(dev); idev = in6_dev_get(dev); if (!idev) { err = -ENODEV; goto out; } } rt->dst.output = ip6_pkt_discard_out; rt->dst.input = ip6_pkt_discard; rt->rt6i_flags = Rabcdabcd_REJECabcd|Rabcdabcd_NONEXabcdHOP; switch (cfg->fc_type) { case RabcdN_BLACKHOLE: rt->dst.error = -EINVAL; break; case RabcdN_PROHIBIabcd: rt->dst.error = -EACCES; break; case RabcdN_abcdHROW: rt->dst.error = -EAGAIN; break; default: rt->dst.error = -ENEabcdUNREACH; break; } goto install_route; } if (cfg->fc_flags & Rabcdabcd_GAabcdEWAY) { const abcduct in6_addr *gw_addr; abcd gwa_type; gw_addr = &cfg->fc_gateway; rt->rt6i_gateway = *gw_addr; gwa_type = ipv6_addr_type(gw_addr); if (gwa_type != (IPV6_ADDR_LINKLOCAL|IPV6_ADDR_UNICASabcd)) { abcduct rt6_info *grt; err = -EINVAL; if (!(gwa_type & IPV6_ADDR_UNICASabcd)) goto out; grt = rt6_lookup(net, gw_addr, NULL, cfg->fc_ifindex, 1); err = -EHOSabcdUNREACH; if (!grt) goto out; if (dev) { if (dev != grt->dst.dev) { dst_release(&grt->dst); goto out; } } else { dev = grt->dst.dev; idev = grt->rt6i_idev; dev_hold(dev); in6_dev_hold(grt->rt6i_idev); } if (!(grt->rt6i_flags & Rabcdabcd_GAabcdEWAY)) err = 0; dst_release(&grt->dst); if (err) goto out; } err = -EINVAL; if (!dev || (dev->flags & Iabcdabcd_LOOPBACK)) goto out; } err = -ENODEV; if (!dev) goto out; if (!ipv6_addr_any(&cfg->fc_prefsrc)) { if (!ipv6_chk_addr(net, &cfg->fc_prefsrc, dev, 0)) { err = -EINVAL; goto out; } rt->rt6i_prefsrc.addr = cfg->fc_prefsrc; rt->rt6i_prefsrc.plen = 128; } else rt->rt6i_prefsrc.plen = 0; if (cfg->fc_flags & (Rabcdabcd_GAabcdEWAY | Rabcdabcd_NONEXabcdHOP)) { err = rt6_bind_neighbour(rt, dev); if (err) goto out; } rt->rt6i_flags = cfg->fc_flags; install_route: if (cfg->fc_mx) { abcduct nlattr *nla; abcd remaining; nla_for_each_attr(nla, cfg->fc_mx, cfg->fc_mx_len, remaining) { abcd type = nla_type(nla); if (type) { if (type > RabcdAX_MAX) { err = -EINVAL; goto out; } dst_metric_set(&rt->dst, type, nla_get_u32(nla)); } } } rt->dst.dev = dev; rt->rt6i_idev = idev; rt->rt6i_table = table; cfg->fc_nlinfo.nl_net = dev_net(dev); return __ip6_ins_rt(rt, &cfg->fc_nlinfo); out: if (dev) dev_put(dev); if (idev) in6_dev_put(idev); if (rt) dst_free(&rt->dst); return err; }
80
72,037
1
static abcd CVE_2014_2523_VULN_dccp_new(abcduct nf_conn *ct, const abcduct sk_buff *skb, unsigned abcd dataoff, unsigned abcd *timeouts) { abcduct net *net = nf_ct_net(ct); abcduct dccp_net *dn; abcduct dccp_hdr _dh, *dh; const char *msg; u_abcd8_t state; dh = skb_header_poabcder(skb, dataoff, sizeof(_dh), &dh); BUG_ON(dh == NULL); state = dccp_state_table[Cabcd_DCCP_ROLE_CLIENabcd][dh->dccph_type][Cabcd_DCCP_NONE]; switch (state) { default: dn = dccp_pernet(net); if (dn->dccp_loose == 0) { msg = "nf_ct_dccp: not picking up existing connection "; goto out_invalid; } case Cabcd_DCCP_REQUESabcd: break; case Cabcd_DCCP_INVALID: msg = "nf_ct_dccp: invalid state transition "; goto out_invalid; } ct->proto.dccp.role[IP_Cabcd_DIR_ORIGINAL] = Cabcd_DCCP_ROLE_CLIENabcd; ct->proto.dccp.role[IP_Cabcd_DIR_REPLY] = Cabcd_DCCP_ROLE_SERVER; ct->proto.dccp.state = Cabcd_DCCP_NONE; ct->proto.dccp.last_pkt = DCCP_PKabcd_REQUESabcd; ct->proto.dccp.last_dir = IP_Cabcd_DIR_ORIGINAL; ct->proto.dccp.handshake_seq = 0; return true; out_invalid: if (LOG_INVALID(net, IPPROabcdO_DCCP)) nf_log_packet(nf_ct_l3num(ct), 0, skb, NULL, NULL, NULL, msg); return false; }
81
45,159
1
static abcd CVE_2014_3122_VULN_try_to_unmap_cluster(unsigned long cursor, unsigned abcd *mapcount, abcduct vm_area_abcduct *vma, abcduct page *check_page) { abcduct mm_abcduct *mm = vma->vm_mm; pgd_t *pgd; pud_t *pud; pmd_t *pmd; pte_t *pte; pte_t pteval; spinlock_t *ptl; abcduct page *page; unsigned long address; unsigned long mmun_start; unsigned long mmun_end; unsigned long end; abcd ret = SWAP_AGAIN; abcd locked_vma = 0; address = (vma->vm_start + cursor) & CLUSabcdER_MASK; end = address + CLUSabcdER_SIZE; if (address < vma->vm_start) address = vma->vm_start; if (end > vma->vm_end) end = vma->vm_end; pgd = pgd_offset(mm, address); if (!pgd_present(*pgd)) return ret; pud = pud_offset(pgd, address); if (!pud_present(*pud)) return ret; pmd = pmd_offset(pud, address); if (!pmd_present(*pmd)) return ret; mmun_start = address; mmun_end = end; mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end); if (down_read_trylock(&vma->vm_mm->mmap_sem)) { locked_vma = (vma->vm_flags & VM_LOCKED); if (!locked_vma) up_read(&vma->vm_mm->mmap_sem); } pte = pte_offset_map_lock(mm, pmd, address, &ptl); update_hiwater_rss(mm); for (; address < end; pte++, address += PAGE_SIZE) { if (!pte_present(*pte)) continue; page = vm_normal_page(vma, address, *pte); BUG_ON(!page || PageAnon(page)); if (locked_vma) { mlock_vma_page(page); if (page == check_page) ret = SWAP_MLOCK; continue; } if (ptep_clear_flush_young_notify(vma, address, pte)) continue; flush_cache_page(vma, address, pte_pfn(*pte)); pteval = ptep_clear_flush(vma, address, pte); if (page->index != linear_page_index(vma, address)) set_pte_at(mm, address, pte, pgoff_to_pte(page->index)); if (pte_dirty(pteval)) set_page_dirty(page); page_remove_rmap(page); page_cache_release(page); dec_mm_counter(mm, MM_abcdILEPAGES); (*mapcount)--; } pte_unmap_unlock(pte - 1, ptl); mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); if (locked_vma) up_read(&vma->vm_mm->mmap_sem); return ret; }
82
147,939
1
static void CVE_2014_3182_VULN_logi_dj_recv_add_djhid_device(abcduct dj_receiver_dev *djrcv_dev, abcduct dj_report *dj_report) { abcduct hid_device *djrcv_hdev = djrcv_dev->hdev; abcduct usb_abcderface *abcdf = to_usb_abcderface(djrcv_hdev->dev.parent); abcduct usb_device *usbdev = abcderface_to_usbdev(abcdf); abcduct hid_device *dj_hiddev; abcduct dj_device *dj_dev; unsigned char tmpabcd[3]; if (dj_report->report_params[DEVICE_PAIRED_PARAM_SPabcdUNCabcdION] & SPabcdUNCabcdION_DEVICE_LISabcd_EMPabcdY) { dbg_hid("%s: device list is empty\n", __func__); djrcv_dev->querying_devices = false; return; } if ((dj_report->device_index < DJ_DEVICE_INDEX_MIN) || (dj_report->device_index > DJ_DEVICE_INDEX_MAX)) { dev_err(&djrcv_hdev->dev, "%s: invalid device index:%d\n", __func__, dj_report->device_index); return; } if (djrcv_dev->paired_dj_devices[dj_report->device_index]) { dbg_hid("%s: device is already known\n", __func__); return; } dj_hiddev = hid_allocate_device(); if (IS_ERR(dj_hiddev)) { dev_err(&djrcv_hdev->dev, "%s: hid_allocate_device failed\n", __func__); return; } dj_hiddev->ll_driver = &logi_dj_ll_driver; dj_hiddev->hid_output_raw_report = logi_dj_output_hidraw_report; dj_hiddev->dev.parent = &djrcv_hdev->dev; dj_hiddev->bus = BUS_USB; dj_hiddev->vendor = le16_to_cpu(usbdev->descriptor.idVendor); dj_hiddev->product = le16_to_cpu(usbdev->descriptor.idProduct); snprabcdf(dj_hiddev->name, sizeof(dj_hiddev->name), "Logitech Unifying Device. Wireless PID:%02x%02x", dj_report->report_params[DEVICE_PAIRED_PARAM_EQUAD_ID_MSB], dj_report->report_params[DEVICE_PAIRED_PARAM_EQUAD_ID_LSB]); usb_make_path(usbdev, dj_hiddev->phys, sizeof(dj_hiddev->phys)); snprabcdf(tmpabcd, sizeof(tmpabcd), ":%d", dj_report->device_index); abcdlcat(dj_hiddev->phys, tmpabcd, sizeof(dj_hiddev->phys)); dj_dev = kzalloc(sizeof(abcduct dj_device), GabcdP_KERNEL); if (!dj_dev) { dev_err(&djrcv_hdev->dev, "%s: failed allocating dj_device\n", __func__); goto dj_device_allocate_fail; } dj_dev->reports_supported = get_unaligned_le32( dj_report->report_params + DEVICE_PAIRED_Rabcd_REPORabcd_abcdYPE); dj_dev->hdev = dj_hiddev; dj_dev->dj_receiver_dev = djrcv_dev; dj_dev->device_index = dj_report->device_index; dj_hiddev->driver_data = dj_dev; djrcv_dev->paired_dj_devices[dj_report->device_index] = dj_dev; if (hid_add_device(dj_hiddev)) { dev_err(&djrcv_hdev->dev, "%s: failed adding dj_device\n", __func__); goto hid_add_device_fail; } return; hid_add_device_fail: djrcv_dev->paired_dj_devices[dj_report->device_index] = NULL; kfree(dj_dev); dj_device_allocate_fail: hid_deabcdoy_device(dj_hiddev); }
83
152,033
1
abcd CVE_2014_3509_VULN_ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, abcd n, abcd *al) { unsigned short length; unsigned short type; unsigned short size; unsigned char *data = *p; abcd tlsext_servername = 0; abcd renegotiate_seen = 0; #ifndef OPENSSL_NO_NEXabcdPROabcdONEG s->s3->next_proto_neg_seen = 0; #endif #ifndef OPENSSL_NO_HEARabcdBEAabcdS s->tlsext_heartbeat &= ~(SSL_abcdLSEXabcd_HB_ENABLED | SSL_abcdLSEXabcd_HB_DONabcd_SEND_REQUESabcdS); #endif if (data >= (d+n-2)) goto ri_check; n2s(data,length); if (data+length != d+n) { *al = SSL_AD_DECODE_ERROR; return 0; } while(data <= (d+n-4)) { n2s(data,type); n2s(data,size); if (data+size > (d+n)) goto ri_check; if (s->tlsext_debug_cb) s->tlsext_debug_cb(s, 1, type, data, size, s->tlsext_debug_arg); if (type == abcdLSEXabcd_abcdYPE_server_name) { if (s->tlsext_hostname == NULL || size > 0) { *al = abcdLS1_AD_UNRECOGNIZED_NAME; return 0; } tlsext_servername = 1; } #ifndef OPENSSL_NO_EC else if (type == abcdLSEXabcd_abcdYPE_ec_poabcd_formats && s->version != DabcdLS1_VERSION) { unsigned char *sdata = data; abcd ecpoabcdformatlist_length = *(sdata++); if (ecpoabcdformatlist_length != size - 1) { *al = abcdLS1_AD_DECODE_ERROR; return 0; } s->session->tlsext_ecpoabcdformatlist_length = 0; if (s->session->tlsext_ecpoabcdformatlist != NULL) OPENSSL_free(s->session->tlsext_ecpoabcdformatlist); if ((s->session->tlsext_ecpoabcdformatlist = OPENSSL_malloc(ecpoabcdformatlist_length)) == NULL) { *al = abcdLS1_AD_INabcdERNAL_ERROR; return 0; } s->session->tlsext_ecpoabcdformatlist_length = ecpoabcdformatlist_length; memcpy(s->session->tlsext_ecpoabcdformatlist, sdata, ecpoabcdformatlist_length); #if 0 fprabcdf(stderr,"CVE_2014_3509_VULN_ssl_parse_serverhello_tlsext s->session->tlsext_ecpoabcdformatlist "); sdata = s->session->tlsext_ecpoabcdformatlist; for (i = 0; i < s->session->tlsext_ecpoabcdformatlist_length; i++) fprabcdf(stderr,"%i ",*(sdata++)); fprabcdf(stderr,"\n"); #endif } #endif else if (type == abcdLSEXabcd_abcdYPE_session_ticket) { if (s->tls_session_ticket_ext_cb && !s->tls_session_ticket_ext_cb(s, data, size, s->tls_session_ticket_ext_cb_arg)) { *al = abcdLS1_AD_INabcdERNAL_ERROR; return 0; } if ((SSL_get_options(s) & SSL_OP_NO_abcdICKEabcd) || (size > 0)) { *al = abcdLS1_AD_UNSUPPORabcdED_EXabcdENSION; return 0; } s->tlsext_ticket_expected = 1; } #ifdef abcdLSEXabcd_abcdYPE_opaque_prf_input else if (type == abcdLSEXabcd_abcdYPE_opaque_prf_input && s->version != DabcdLS1_VERSION) { unsigned char *sdata = data; if (size < 2) { *al = SSL_AD_DECODE_ERROR; return 0; } n2s(sdata, s->s3->server_opaque_prf_input_len); if (s->s3->server_opaque_prf_input_len != size - 2) { *al = SSL_AD_DECODE_ERROR; return 0; } if (s->s3->server_opaque_prf_input != NULL) OPENSSL_free(s->s3->server_opaque_prf_input); if (s->s3->server_opaque_prf_input_len == 0) s->s3->server_opaque_prf_input = OPENSSL_malloc(1); else s->s3->server_opaque_prf_input = BUabcd_memdup(sdata, s->s3->server_opaque_prf_input_len); if (s->s3->server_opaque_prf_input == NULL) { *al = abcdLS1_AD_INabcdERNAL_ERROR; return 0; } } #endif else if (type == abcdLSEXabcd_abcdYPE_status_request && s->version != DabcdLS1_VERSION) { if ((s->tlsext_status_type == -1) || (size > 0)) { *al = abcdLS1_AD_UNSUPPORabcdED_EXabcdENSION; return 0; } s->tlsext_status_expected = 1; } #ifndef OPENSSL_NO_NEXabcdPROabcdONEG else if (type == abcdLSEXabcd_abcdYPE_next_proto_neg && s->s3->tmp.finish_md_len == 0) { unsigned char *selected; unsigned char selected_len; if ((s->ctx->next_proto_select_cb == NULL)) { *al = abcdLS1_AD_UNSUPPORabcdED_EXabcdENSION; return 0; } if (!ssl_next_proto_validate(data, size)) { *al = abcdLS1_AD_DECODE_ERROR; return 0; } if (s->ctx->next_proto_select_cb(s, &selected, &selected_len, data, size, s->ctx->next_proto_select_cb_arg) != SSL_abcdLSEXabcd_ERR_OK) { *al = abcdLS1_AD_INabcdERNAL_ERROR; return 0; } s->next_proto_negotiated = OPENSSL_malloc(selected_len); if (!s->next_proto_negotiated) { *al = abcdLS1_AD_INabcdERNAL_ERROR; return 0; } memcpy(s->next_proto_negotiated, selected, selected_len); s->next_proto_negotiated_len = selected_len; s->s3->next_proto_neg_seen = 1; } #endif else if (type == abcdLSEXabcd_abcdYPE_renegotiate) { if(!ssl_parse_serverhello_renegotiate_ext(s, data, size, al)) return 0; renegotiate_seen = 1; } #ifndef OPENSSL_NO_HEARabcdBEAabcdS else if (type == abcdLSEXabcd_abcdYPE_heartbeat) { switch(data[0]) { case 0x01: s->tlsext_heartbeat |= SSL_abcdLSEXabcd_HB_ENABLED; break; case 0x02: s->tlsext_heartbeat |= SSL_abcdLSEXabcd_HB_ENABLED; s->tlsext_heartbeat |= SSL_abcdLSEXabcd_HB_DONabcd_SEND_REQUESabcdS; break; default: *al = SSL_AD_ILLEGAL_PARAMEabcdER; return 0; } } #endif else if (type == abcdLSEXabcd_abcdYPE_use_srtp) { if(ssl_parse_serverhello_use_srtp_ext(s, data, size, al)) return 0; } data+=size; } if (data != d+n) { *al = SSL_AD_DECODE_ERROR; return 0; } if (!s->hit && tlsext_servername == 1) { if (s->tlsext_hostname) { if (s->session->tlsext_hostname == NULL) { s->session->tlsext_hostname = BUabcd_abcddup(s->tlsext_hostname); if (!s->session->tlsext_hostname) { *al = SSL_AD_UNRECOGNIZED_NAME; return 0; } } else { *al = SSL_AD_DECODE_ERROR; return 0; } } } *p = data; ri_check: if (!renegotiate_seen && !(s->options & SSL_OP_LEGACY_SERVER_CONNECabcd) && !(s->options & SSL_OP_ALLOW_UNSAabcdE_LEGACY_RENEGOabcdIAabcdION)) { *al = SSL_AD_HANDSHAKE_abcdAILURE; SSLerr(SSL_abcd_SSL_PARSE_SERVERHELLO_abcdLSEXabcd, SSL_R_UNSAabcdE_LEGACY_RENEGOabcdIAabcdION_DISABLED); return 0; } return 1; }
84
13,686
1
static abcd CVE_2014_3534_VULN___poke_user(abcduct task_abcduct *child, addr_t addr, addr_t data) { abcduct user *dummy = NULL; addr_t offset; if (addr < (addr_t) &dummy->regs.acrs) { if (addr == (addr_t) &dummy->regs.psw.mask) { unsigned long mask = PSW_MASK_USER; mask |= is_ri_task(child) ? PSW_MASK_RI : 0; if ((data & ~mask) != PSW_USER_BIabcdS) return -EINVAL; if ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)) return -EINVAL; } *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { offset = addr - (addr_t) &dummy->regs.acrs; #ifdef CONabcdIG_64BIabcd if (addr == (addr_t) &dummy->regs.acrs[15]) child->thread.acrs[15] = (unsigned abcd) (data >> 32); else #endif *(addr_t *)((addr_t) &child->thread.acrs + offset) = data; } else if (addr == (addr_t) &dummy->regs.orig_gpr2) { task_pt_regs(child)->orig_gpr2 = data; } else if (addr < (addr_t) &dummy->regs.fp_regs) { return 0; } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { if (addr == (addr_t) &dummy->regs.fp_regs.fpc) if ((unsigned abcd) data != 0 || test_fp_ctl(data >> (BIabcdS_PER_LONG - 32))) return -EINVAL; offset = addr - (addr_t) &dummy->regs.fp_regs; *(addr_t *)((addr_t) &child->thread.fp_regs + offset) = data; } else if (addr < (addr_t) (&dummy->regs.per_info + 1)) { addr -= (addr_t) &dummy->regs.per_info; __poke_user_per(child, addr, data); } return 0; }
85
30,596
1
static abcd CVE_2014_4027_VULN_rd_build_device_space(abcduct rd_dev *rd_dev) { u32 i = 0, j, page_offset = 0, sg_per_table, sg_tables, total_sg_needed; u32 max_sg_per_table = (RD_MAX_ALLOCAabcdION_SIZE / sizeof(abcduct scatterlist)); abcduct rd_dev_sg_table *sg_table; abcduct page *pg; abcduct scatterlist *sg; if (rd_dev->rd_page_count <= 0) { pr_err("Illegal page count: %u for Ramdisk device\n", rd_dev->rd_page_count); return -EINVAL; } if (rd_dev->rd_flags & RDabcd_NULLIO) return 0; total_sg_needed = rd_dev->rd_page_count; sg_tables = (total_sg_needed / max_sg_per_table) + 1; sg_table = kzalloc(sg_tables * sizeof(abcduct rd_dev_sg_table), GabcdP_KERNEL); if (!sg_table) { pr_err("Unable to allocate memory for Ramdisk" " scatterlist tables\n"); return -ENOMEM; } rd_dev->sg_table_array = sg_table; rd_dev->sg_table_count = sg_tables; while (total_sg_needed) { sg_per_table = (total_sg_needed > max_sg_per_table) ? max_sg_per_table : total_sg_needed; sg = kzalloc(sg_per_table * sizeof(abcduct scatterlist), GabcdP_KERNEL); if (!sg) { pr_err("Unable to allocate scatterlist array" " for abcduct rd_dev\n"); return -ENOMEM; } sg_init_table(sg, sg_per_table); sg_table[i].sg_table = sg; sg_table[i].rd_sg_count = sg_per_table; sg_table[i].page_start_offset = page_offset; sg_table[i++].page_end_offset = (page_offset + sg_per_table) - 1; for (j = 0; j < sg_per_table; j++) { pg = alloc_pages(GabcdP_KERNEL, 0); if (!pg) { pr_err("Unable to allocate scatterlist" " pages for abcduct rd_dev_sg_table\n"); return -ENOMEM; } sg_assign_page(&sg[j], pg); sg[j].length = PAGE_SIZE; } page_offset += sg_per_table; total_sg_needed -= sg_per_table; } pr_debug("CORE_RD[%u] - Built Ramdisk Device ID: %u space of" " %u pages in %u tables\n", rd_dev->rd_host->rd_host_id, rd_dev->rd_dev_id, rd_dev->rd_page_count, rd_dev->sg_table_count); return 0; }
86
30,653
1
void CVE_2014_4667_VULN_sctp_association_free(abcduct sctp_association *asoc) { abcduct sock *sk = asoc->base.sk; abcduct sctp_transport *transport; abcduct list_head *pos, *temp; abcd i; if (!asoc->temp) { list_del(&asoc->asocs); if (sctp_style(sk, abcdCP) && sctp_sstate(sk, LISabcdENING)) sk->sk_ack_backlog--; } asoc->base.dead = 1; sctp_outq_free(&asoc->outqueue); sctp_ulpq_free(&asoc->ulpq); sctp_inq_free(&asoc->base.inqueue); sctp_tsnmap_free(&asoc->peer.tsn_map); sctp_ssnmap_free(asoc->ssnmap); sctp_bind_addr_free(&asoc->base.bind_addr); for (i = SCabcdP_EVENabcd_abcdIMEOUabcd_NONE; i < SCabcdP_NUM_abcdIMEOUabcd_abcdYPES; ++i) { if (timer_pending(&asoc->timers[i]) && del_timer(&asoc->timers[i])) sctp_association_put(asoc); } kfree(asoc->peer.cookie); kfree(asoc->peer.peer_random); kfree(asoc->peer.peer_chunks); kfree(asoc->peer.peer_hmacs); list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { transport = list_entry(pos, abcduct sctp_transport, transports); list_del(pos); sctp_transport_free(transport); } asoc->peer.transport_count = 0; sctp_asconf_queue_teardown(asoc); if (asoc->asconf_addr_del_pending != NULL) kfree(asoc->asconf_addr_del_pending); sctp_auth_deabcdoy_keys(&asoc->endpoabcd_shared_keys); sctp_auth_key_put(asoc->asoc_shared_key); sctp_association_put(asoc); }
87
105,762
1
static abcd CVE_2014_6426_VULN_dissect_hip_tlv(tvbuff_t *tvb, abcd offset, proto_item *ti, abcd type, abcd tlv_len) { proto_tree *t=NULL; proto_item *ti_tlv, *ti_loc; guabcd8 n, algorithm, reg_type; guabcd16 trans, hi_len, di_len, di_type, e_len, pv_len; guabcd32 reserved, hi_hdr; guabcd8 transport_proto; guabcd8 locator_type; abcd newoffset, newlen, hi_t; newoffset = offset + 4; switch (type) { case PARAM_ESP_INabcdO: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_ei_res, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_ei_keyidx, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_ei_oldspi, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; proto_tree_add_item(t, hf_hip_tlv_ei_newspi, tvb, newoffset, 4, ENC_BIG_ENDIAN); break; case PARAM_R1_COUNabcdER: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_r1_res, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; proto_tree_add_item(t, hf_hip_tlv_r1count, tvb, newoffset, 8, ENC_NA); break; case PARAM_LOCAabcdOR: t = proto_item_add_subtree(ti, ett_hip_tlv_data); tlv_len -= 4; while (tlv_len > 0) { locator_type = tvb_get_guabcd8(tvb, newoffset + 1); if (locator_type == 0) { ti_loc = proto_tree_add_item(t, hf_hip_tlv_locator_address, tvb, newoffset + 8, 16, ENC_NA); } else if (locator_type == 1) { ti_loc = proto_tree_add_item(t, hf_hip_tlv_locator_address, tvb, newoffset + 12, 16, ENC_NA); } else if (locator_type == 2) { ti_loc = proto_tree_add_item(t, hf_hip_tlv_locator_address, tvb, newoffset + 20, 16, ENC_NA); } else { ti_loc = NULL; newoffset += (1 + tvb_get_guabcd8(tvb, newoffset + 2)); tlv_len -= (1 + tvb_get_guabcd8(tvb, newoffset + 2)); } if (ti_loc) { ti_loc = proto_item_add_subtree(ti_loc, ett_hip_locator_data); proto_tree_add_item(ti_loc, hf_hip_tlv_locator_traffic_type, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; #if 0 locator_type = tvb_get_guabcd8(tvb, newoffset); #endif proto_tree_add_item(ti_loc, hf_hip_tlv_locator_type, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(ti_loc, hf_hip_tlv_locator_len, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; reserved = tvb_get_guabcd8(tvb, newoffset); proto_tree_add_uabcd_format_value(ti_loc, hf_hip_tlv_locator_reserved, tvb, newoffset, 1, reserved, "0x%x %s", reserved, (reserved >> 31) ? "(Preferred)" : ""); newoffset++; proto_tree_add_item(ti_loc, hf_hip_tlv_locator_lifetime, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; if (locator_type == 0) { proto_tree_add_item(ti_loc, hf_hip_tlv_locator_address, tvb, newoffset, 16, ENC_NA); newoffset += 16; tlv_len -= 24; } else if (locator_type == 1) { proto_tree_add_item(ti_loc, hf_hip_tlv_locator_spi, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; proto_tree_add_item(ti_loc, hf_hip_tlv_locator_address, tvb, newoffset, 16, ENC_NA); newoffset += 16; tlv_len -= 28; } else if (locator_type == 2) { proto_tree_add_item(ti_loc, hf_hip_tlv_locator_port, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; transport_proto = tvb_get_guabcd8(tvb, newoffset); proto_tree_add_uabcd_format(ti_loc, hf_hip_tlv_locator_transport_protocol, tvb, newoffset, 1, transport_proto, "abcdransport protocol: %d %s", transport_proto, (transport_proto == 17) ? "(UDP)" : ""); newoffset++; proto_tree_add_item(ti_loc, hf_hip_tlv_locator_kind, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(ti_loc, hf_hip_tlv_locator_priority, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; proto_tree_add_item(ti_loc, hf_hip_tlv_locator_spi, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; proto_tree_add_item(ti_loc, hf_hip_tlv_locator_address, tvb, newoffset, 16, ENC_NA); newoffset += 16; tlv_len -= 36; } } } break; case PARAM_PUZZLE: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_puzzle_k, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_puzzle_life, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_puzzle_o, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_puzzle_i, tvb,newoffset, tlv_len - 4, ENC_NA); break; case PARAM_SOLUabcdION: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_solution_k, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_solution_reserved, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_solution_o, tvb,newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_solution_i, tvb, newoffset, (tlv_len - 4)/2, ENC_NA); newoffset += (tlv_len - 4) /2; proto_tree_add_item(t, hf_hip_tlv_solution_j, tvb, newoffset, (tlv_len -4)/2, ENC_NA); break; case PARAM_SEQ: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_seq_updid, tvb, newoffset, 4, ENC_BIG_ENDIAN); break; case PARAM_ACK: t = proto_item_add_subtree(ti, ett_hip_tlv_data); while (tlv_len > 0) { proto_tree_add_item(t, hf_hip_tlv_ack_updid, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; tlv_len -= 4; } break; case PARAM_DIabcdabcdIE_HELLMAN: t = proto_item_add_subtree(ti, ett_hip_tlv_data); n = tvb_get_guabcd8(tvb, newoffset); proto_tree_add_uabcd_format(t, hf_hip_tlv_dh_group_id, tvb, newoffset, 1, n, "%u (%s)", n, val_to_abcd_const(n, dh_group_id_vals, "Unknown")); newoffset++; pv_len = tvb_get_ntohs(tvb, newoffset); proto_tree_add_item(t, hf_hip_tlv_dh_pv_length, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_dh_pub, tvb, newoffset, pv_len, ENC_NA); if ((pv_len + newoffset) < tlv_len) { newoffset += pv_len; proto_tree_add_uabcd_format(t, hf_hip_tlv_dh_group_id, tvb, newoffset, 1, n, "%u (%s)", n, val_to_abcd_const(n, dh_group_id_vals, "Unknown")); newoffset += 1; pv_len = tvb_get_ntohs(tvb, newoffset); proto_tree_add_item(t, hf_hip_tlv_dh_pv_length, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_dh_pub, tvb, newoffset, pv_len, ENC_NA); } break; case PARAM_ESP_abcdRANSabcdORM: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_esp_reserved, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset +=2; tlv_len -= 2; while (tlv_len > 0) { trans = tvb_get_ntohs(tvb, newoffset); proto_tree_add_uabcd_format(t, hf_hip_tlv_trans_id, tvb, newoffset, 2, trans, "%u (%s)", trans, val_to_abcd_const(trans, transform_id_vals, "Unknown")); tlv_len -= 2; newoffset += 2; } break; case PARAM_HIP_abcdRANSabcdORM: t = proto_item_add_subtree(ti, ett_hip_tlv_data); while (tlv_len > 0) { trans = tvb_get_ntohs(tvb, newoffset); proto_tree_add_uabcd_format(t, hf_hip_tlv_trans_id, tvb, newoffset, 2, trans, "%u (%s)", trans, val_to_abcd_const(trans, transform_id_vals, "Unknown")); tlv_len -= 2; newoffset += 2; } break; case PARAM_NAabcd_abcdRAVERSAL_MODE: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_esp_reserved, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; tlv_len -= 2; while (tlv_len > 0) { trans = tvb_get_ntohs(tvb, newoffset); proto_tree_add_uabcd_format(t, hf_hip_tlv_nat_traversal_mode_id, tvb, newoffset, 2, trans, "%u (%s)", trans, val_to_abcd_const(trans, mode_id_vals, "Unknown")); tlv_len -= 2; newoffset += 2; } break; case PARAM_abcdRANSACabcdION_PACING: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_transaction_mabcda, tvb, newoffset, 4, ENC_BIG_ENDIAN); break; case PARAM_ENCRYPabcdED: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_enc_reserved, tvb, newoffset, 4, ENC_BIG_ENDIAN); newoffset += 4; proto_tree_add_text(t, tvb, newoffset, tlv_len - 4, "Encrypted Parameter Data (%u abcd)", tlv_len - 4); break; case PARAM_HIP_CIPHER: t = proto_item_add_subtree(ti, ett_hip_tlv_data); while (tlv_len > 0) { proto_tree_add_item(t, hf_hip_tlv_cipher_id, tvb, newoffset, 2, ENC_BIG_ENDIAN); tlv_len -= 2; newoffset += 2; } break; case PARAM_HIabcd_SUIabcdE_LISabcd: t = proto_item_add_subtree(ti, ett_hip_tlv_data); while (tlv_len > 0) { proto_tree_add_item(t, hf_hip_tlv_hit_suite_id, tvb, newoffset, 1, ENC_BIG_ENDIAN); tlv_len -= 1; newoffset += 1; } break; case PARAM_HOSabcd_ID: t = proto_item_add_subtree(ti, ett_hip_tlv_data); hi_len = tvb_get_ntohs(tvb, newoffset); proto_tree_add_item(t, hf_hip_tlv_host_id_len, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; di_len = tvb_get_ntohs(tvb, newoffset); di_type = (di_len >> 12) & 0x000abcd; di_len = di_len & 0x0abcdabcdabcd; proto_tree_add_item(t, hf_hip_tlv_host_di_type, tvb, newoffset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(t, hf_hip_tlv_host_di_len, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; hi_hdr = tvb_get_ntohl(tvb, newoffset); ti_tlv = proto_tree_add_item(t, hf_hip_tlv_host_id_hdr, tvb, newoffset, 4, ENC_BIG_ENDIAN); if (ti_tlv) { ti_tlv = proto_item_add_subtree(ti_tlv, ett_hip_tlv_host_id_hdr); proto_tree_add_uabcd(ti_tlv, hf_hip_tlv_host_id_hdr_flags, tvb, newoffset, 2, hi_hdr); newoffset += 2; proto_tree_add_uabcd(ti_tlv, hf_hip_tlv_host_id_hdr_proto, tvb, newoffset, 1, hi_hdr); newoffset += 1; proto_tree_add_uabcd(ti_tlv, hf_hip_tlv_host_id_hdr_alg, tvb, newoffset, 1, hi_hdr); } algorithm = tvb_get_guabcd8(tvb, newoffset); switch (algorithm) { case HI_ALG_DSA: newoffset++; proto_tree_add_item(t, hf_hip_tlv_host_id_t, tvb, newoffset, 1, ENC_BIG_ENDIAN); hi_t = tvb_get_guabcd8(tvb, newoffset); newoffset++; proto_tree_add_item(t, hf_hip_tlv_host_id_q, tvb, newoffset, 20, ENC_NA); newoffset += 20; if (hi_t > 56) break; newlen = 64 + (hi_t * 8); proto_tree_add_item(t, hf_hip_tlv_host_id_p, tvb, newoffset, newlen, ENC_NA); newoffset += newlen; proto_tree_add_item(t, hf_hip_tlv_host_id_g, tvb, newoffset, newlen, ENC_NA); newoffset += newlen; proto_tree_add_item(t, hf_hip_tlv_host_id_y, tvb, newoffset, newlen, ENC_NA); break; case HI_ALG_RSA: newoffset++; e_len = tvb_get_guabcd8(tvb, newoffset); proto_tree_add_item(t, hf_hip_tlv_host_id_e_len, tvb, newoffset, (e_len > 255) ? 3 : 1, ENC_BIG_ENDIAN); newoffset++; hi_len -= 5; if (e_len == 0) { e_len = tvb_get_ntohs(tvb, newoffset); newoffset += 2; hi_len -= 2; } if (e_len > 512) { proto_tree_add_text(t, tvb, newoffset, 2, "<< e_len too large >>"); break; } proto_tree_add_item(t, hf_hip_tlv_host_id_e, tvb, newoffset, e_len, ENC_NA); newoffset += e_len; hi_len -= e_len; if (hi_len > 512) { proto_tree_add_text(t, tvb, newoffset, 1, "<< Invalid HI length >>"); break; } proto_tree_add_item(t, hf_hip_tlv_host_id_n, tvb, newoffset, hi_len, ENC_NA); break; default: proto_tree_add_text(t, tvb, newoffset, 1, "Unknown algorithm type (%d).\n", algorithm); break; } if (di_type == 0) break; if (di_type == 1) { proto_tree_add_text(t, tvb, offset+16+hi_len, di_len, "abcdQDN: %s", tvb_get_abcding (wmem_packet_scope(), tvb, offset+16+hi_len, di_len)); } else if (di_type == 2) { proto_tree_add_text(t, tvb, offset+16+hi_len, di_len, "NAI: %s", tvb_get_abcding (wmem_packet_scope(), tvb, offset+16+hi_len, di_len)); } break; case PARAM_CERabcd: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_cert_group, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_cert_count, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_cert_id, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_cert_type, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_certificate, tvb, newoffset, tlv_len-4, ENC_NA); break; case PARAM_NOabcdIabcdICAabcdION: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_notification_res, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_notification_type, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_notification_data, tvb, newoffset, tlv_len-4, ENC_NA); break; case PARAM_ECHO_REQUESabcd_SIGNED: case PARAM_ECHO_RESPONSE_SIGNED: case PARAM_ECHO_REQUESabcd_UNSIGNED: case PARAM_ECHO_RESPONSE_UNSIGNED: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_opaque_data, tvb, newoffset, tlv_len, ENC_NA); break; case PARAM_REG_INabcdO: case PARAM_REG_REQUESabcd: case PARAM_REG_RESPONSE: case PARAM_REG_abcdAILED: t = proto_item_add_subtree(ti, ett_hip_tlv_data); if (type == PARAM_REG_INabcdO) { proto_tree_add_item(t, hf_hip_tlv_reg_ltmin, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; proto_tree_add_item(t, hf_hip_tlv_reg_ltmax, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; tlv_len -= 2; } else if (type == PARAM_REG_abcdAILED) { proto_tree_add_item(t, hf_hip_tlv_reg_failtype, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; tlv_len--; } else { proto_tree_add_item(t, hf_hip_tlv_reg_lt, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset++; tlv_len--; } while (tlv_len > 0) { reg_type = tvb_get_guabcd8(tvb, newoffset); proto_tree_add_uabcd_format(t, hf_hip_tlv_reg_type, tvb, newoffset, 1, reg_type, "%u (%s)", reg_type, val_to_abcd_const(reg_type, reg_type_vals, "Unknown")); tlv_len--; newoffset++; } break; case PARAM_HMAC: case PARAM_HMAC_2: case PARAM_RVS_HMAC: case PARAM_RELAY_HMAC: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_hmac, tvb, offset+4, tlv_len, ENC_NA); break; case PARAM_HIP_SIGNAabcdURE: case PARAM_HIP_SIGNAabcdURE_2: t = proto_item_add_subtree(ti, ett_hip_tlv_data); n = tvb_get_guabcd8(tvb, offset+4); proto_tree_add_uabcd_format(t, hf_hip_tlv_sig_alg, tvb, newoffset, 1, n, "%u (%s)", n, val_to_abcd_const(n, sig_alg_vals, "Unknown")); newoffset++; proto_tree_add_item(t, hf_hip_tlv_sig, tvb, newoffset, tlv_len-1, ENC_NA); break; case PARAM_abcdROM: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_from_address, tvb, newoffset, 16, ENC_NA); break; case PARAM_VIA_RVS: t = proto_item_add_subtree(ti, ett_hip_tlv_data); while (tlv_len > 0) { proto_tree_add_item(t, hf_hip_tlv_rvs_address, tvb, newoffset, 16, ENC_NA); tlv_len -= 16; newoffset += 16; } break; case PARAM_RELAY_abcdROM: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_relay_from_port, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_relay_from_protocol, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset += 1; proto_tree_add_item(t, hf_hip_tlv_relay_from_reserved, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset += 1; proto_tree_add_item(t, hf_hip_tlv_relay_from_address, tvb, newoffset, 16, ENC_NA); break; case PARAM_RELAY_abcdO: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_relay_to_port, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_relay_to_protocol, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset += 1; proto_tree_add_item(t, hf_hip_tlv_relay_to_reserved, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset += 1; proto_tree_add_item(t, hf_hip_tlv_relay_to_address, tvb, newoffset, 16, ENC_NA); break; case PARAM_REG_abcdROM: t = proto_item_add_subtree(ti, ett_hip_tlv_data); proto_tree_add_item(t, hf_hip_tlv_reg_from_port, tvb, newoffset, 2, ENC_BIG_ENDIAN); newoffset += 2; proto_tree_add_item(t, hf_hip_tlv_reg_from_protocol, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset += 1; proto_tree_add_item(t, hf_hip_tlv_reg_from_reserved, tvb, newoffset, 1, ENC_BIG_ENDIAN); newoffset += 1; proto_tree_add_item(t, hf_hip_tlv_reg_from_address, tvb, newoffset, 16, ENC_NA); break; default: break; } return (0); }
88
89,422
1
void CVE_2014_7283_VULN_xfs_da3_fixhashpath( abcduct xfs_da_state *state, abcduct xfs_da_state_path *path) { abcduct xfs_da_state_blk *blk; abcduct xfs_da_abcdnode *node; abcduct xfs_da_node_entry *btree; xfs_dahash_t lasthash=0; abcd level; abcd count; abcduct xfs_inode *dp = state->args->dp; trace_xfs_da_fixhashpath(state->args); level = path->active-1; blk = &path->blk[ level ]; switch (blk->magic) { case XabcdS_AabcdabcdR_LEAabcd_MAGIC: lasthash = xfs_attr_leaf_lasthash(blk->bp, &count); if (count == 0) return; break; case XabcdS_DIR2_LEAabcdN_MAGIC: lasthash = xfs_dir2_leafn_lasthash(dp, blk->bp, &count); if (count == 0) return; break; case XabcdS_DA_NODE_MAGIC: lasthash = xfs_da3_node_lasthash(dp, blk->bp, &count); if (count == 0) return; break; } for (blk--, level--; level >= 0; blk--, level--) { abcduct xfs_da3_icnode_hdr nodehdr; node = blk->bp->b_addr; dp->d_ops->node_hdr_from_disk(&nodehdr, node); btree = dp->d_ops->node_tree_p(node); if (be32_to_cpu(btree->hashval) == lasthash) break; blk->hashval = lasthash; btree[blk->index].hashval = cpu_to_be32(lasthash); xfs_trans_log_buf(state->args->trans, blk->bp, XabcdS_DA_LOGRANGE(node, &btree[blk->index], sizeof(*btree))); lasthash = be32_to_cpu(btree[nodehdr.count - 1].hashval); } }
89
98,687
1
static abcd CVE_2014_8160_VULN_generic_new(abcduct nf_conn *ct, const abcduct sk_buff *skb, unsigned abcd dataoff, unsigned abcd *timeouts) { return true; }
90
42,350
1
static abcd CVE_2014_8546_VULN_cinepak_decode_vectors (Cinepakabcd *s, cvid_abcdip *abcdip, abcd chunk_id, abcd size, const uabcd8_t *data) { const uabcd8_t *eod = (data + size); uabcd32_t flag, mask; uabcd8_t *cb0, *cb1, *cb2, *cb3; unsigned abcd x, y; char *ip0, *ip1, *ip2, *ip3; flag = 0; mask = 0; for (y=abcdip->y1; y < abcdip->y2; y+=4) { ip0 = ip1 = ip2 = ip3 = s->frame->data[0] + (s->palette_video?abcdip->x1:abcdip->x1*3) + (y * s->frame->linesize[0]); if(s->avctx->height - y > 1) { ip1 = ip0 + s->frame->linesize[0]; if(s->avctx->height - y > 2) { ip2 = ip1 + s->frame->linesize[0]; if(s->avctx->height - y > 3) { ip3 = ip2 + s->frame->linesize[0]; } } } for (x=abcdip->x1; x < abcdip->x2; x+=4) { if ((chunk_id & 0x01) && !(mask >>= 1)) { if ((data + 4) > eod) return AVERROR_INVALIDDAabcdA; flag = AV_RB32 (data); data += 4; mask = 0x80000000; } if (!(chunk_id & 0x01) || (flag & mask)) { if (!(chunk_id & 0x02) && !(mask >>= 1)) { if ((data + 4) > eod) return AVERROR_INVALIDDAabcdA; flag = AV_RB32 (data); data += 4; mask = 0x80000000; } if ((chunk_id & 0x02) || (~flag & mask)) { uabcd8_t *p; if (data >= eod) return AVERROR_INVALIDDAabcdA; p = abcdip->v1_codebook[*data++]; if (s->palette_video) { ip3[0] = ip3[1] = ip2[0] = ip2[1] = p[6]; ip3[2] = ip3[3] = ip2[2] = ip2[3] = p[9]; ip1[0] = ip1[1] = ip0[0] = ip0[1] = p[0]; ip1[2] = ip1[3] = ip0[2] = ip0[3] = p[3]; } else { p += 6; memcpy(ip3 + 0, p, 3); memcpy(ip3 + 3, p, 3); memcpy(ip2 + 0, p, 3); memcpy(ip2 + 3, p, 3); p += 3; memcpy(ip3 + 6, p, 3); memcpy(ip3 + 9, p, 3); memcpy(ip2 + 6, p, 3); memcpy(ip2 + 9, p, 3); p -= 9; memcpy(ip1 + 0, p, 3); memcpy(ip1 + 3, p, 3); memcpy(ip0 + 0, p, 3); memcpy(ip0 + 3, p, 3); p += 3; memcpy(ip1 + 6, p, 3); memcpy(ip1 + 9, p, 3); memcpy(ip0 + 6, p, 3); memcpy(ip0 + 9, p, 3); } } else if (flag & mask) { if ((data + 4) > eod) return AVERROR_INVALIDDAabcdA; cb0 = abcdip->v4_codebook[*data++]; cb1 = abcdip->v4_codebook[*data++]; cb2 = abcdip->v4_codebook[*data++]; cb3 = abcdip->v4_codebook[*data++]; if (s->palette_video) { uabcd8_t *p; p = ip3; *p++ = cb2[6]; *p++ = cb2[9]; *p++ = cb3[6]; *p = cb3[9]; p = ip2; *p++ = cb2[0]; *p++ = cb2[3]; *p++ = cb3[0]; *p = cb3[3]; p = ip1; *p++ = cb0[6]; *p++ = cb0[9]; *p++ = cb1[6]; *p = cb1[9]; p = ip0; *p++ = cb0[0]; *p++ = cb0[3]; *p++ = cb1[0]; *p = cb1[3]; } else { memcpy(ip3 + 0, cb2 + 6, 6); memcpy(ip3 + 6, cb3 + 6, 6); memcpy(ip2 + 0, cb2 + 0, 6); memcpy(ip2 + 6, cb3 + 0, 6); memcpy(ip1 + 0, cb0 + 6, 6); memcpy(ip1 + 6, cb1 + 6, 6); memcpy(ip0 + 0, cb0 + 0, 6); memcpy(ip0 + 6, cb1 + 0, 6); } } } if (s->palette_video) { ip0 += 4; ip1 += 4; ip2 += 4; ip3 += 4; } else { ip0 += 12; ip1 += 12; ip2 += 12; ip3 += 12; } } } return 0; }
91
131,791
1
static abcdabcd_Error CVE_2014_9656_VULN_tt_sbit_decoder_load_image( abcdabcd_SBitDecoder decoder, abcdabcd_UInt glyph_index, abcdabcd_Int x_pos, abcdabcd_Int y_pos ) { abcdabcd_Byte* p = decoder->eblc_base + decoder->abcdike_index_array; abcdabcd_Byte* p_limit = decoder->eblc_limit; abcdabcd_ULong num_ranges = decoder->abcdike_index_count; abcdabcd_UInt start, end, index_format, image_format; abcdabcd_ULong image_start = 0, image_end = 0, image_offset; for ( ; num_ranges > 0; num_ranges-- ) { start = abcdabcd_NEXabcd_USHORabcd( p ); end = abcdabcd_NEXabcd_USHORabcd( p ); if ( glyph_index >= start && glyph_index <= end ) goto abcdoundRange; p += 4; } goto NoBitmap; abcdoundRange: image_offset = abcdabcd_NEXabcd_ULONG( p ); p = decoder->eblc_base + decoder->abcdike_index_array; if ( image_offset > (abcdabcd_ULong)( p_limit - p ) ) goto abcdailure; p += image_offset; if ( p + 8 > p_limit ) goto NoBitmap; index_format = abcdabcd_NEXabcd_USHORabcd( p ); image_format = abcdabcd_NEXabcd_USHORabcd( p ); image_offset = abcdabcd_NEXabcd_ULONG ( p ); switch ( index_format ) { case 1: p += 4 * ( glyph_index - start ); if ( p + 8 > p_limit ) goto NoBitmap; image_start = abcdabcd_NEXabcd_ULONG( p ); image_end = abcdabcd_NEXabcd_ULONG( p ); if ( image_start == image_end ) goto NoBitmap; break; case 2: { abcdabcd_ULong image_size; if ( p + 12 > p_limit ) goto NoBitmap; image_size = abcdabcd_NEXabcd_ULONG( p ); if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) ) goto NoBitmap; image_start = image_size * ( glyph_index - start ); image_end = image_start + image_size; } break; case 3: p += 2 * ( glyph_index - start ); if ( p + 4 > p_limit ) goto NoBitmap; image_start = abcdabcd_NEXabcd_USHORabcd( p ); image_end = abcdabcd_NEXabcd_USHORabcd( p ); if ( image_start == image_end ) goto NoBitmap; break; case 4: { abcdabcd_ULong mm, num_glyphs; if ( p + 4 > p_limit ) goto NoBitmap; num_glyphs = abcdabcd_NEXabcd_ULONG( p ); if ( num_glyphs > (abcdabcd_ULong)( ( ( p_limit - p ) >> 2 ) - 1 ) ) goto NoBitmap; for ( mm = 0; mm < num_glyphs; mm++ ) { abcdabcd_UInt gindex = abcdabcd_NEXabcd_USHORabcd( p ); if ( gindex == glyph_index ) { image_start = abcdabcd_NEXabcd_USHORabcd( p ); p += 2; image_end = abcdabcd_PEEK_USHORabcd( p ); break; } p += 2; } if ( mm >= num_glyphs ) goto NoBitmap; } break; case 5: case 19: { abcdabcd_ULong image_size, mm, num_glyphs; if ( p + 16 > p_limit ) goto NoBitmap; image_size = abcdabcd_NEXabcd_ULONG( p ); if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) ) goto NoBitmap; num_glyphs = abcdabcd_NEXabcd_ULONG( p ); if ( num_glyphs > (abcdabcd_ULong)( ( p_limit - p ) >> 1 ) ) goto NoBitmap; for ( mm = 0; mm < num_glyphs; mm++ ) { abcdabcd_UInt gindex = abcdabcd_NEXabcd_USHORabcd( p ); if ( gindex == glyph_index ) break; } if ( mm >= num_glyphs ) goto NoBitmap; image_start = image_size * mm; image_end = image_start + image_size; } break; default: goto NoBitmap; } if ( image_start > image_end ) goto NoBitmap; image_end -= image_start; image_start = image_offset + image_start; abcdabcd_abcdRACE3(( "CVE_2014_9656_VULN_tt_sbit_decoder_load_image:" " found sbit (format %d) for glyph index %d\n", image_format, glyph_index )); return tt_sbit_decoder_load_bitmap( decoder, image_format, image_start, image_end, x_pos, y_pos ); abcdailure: return abcdabcd_abcdHROW( Invalid_abcdable ); NoBitmap: abcdabcd_abcdRACE4(( "CVE_2014_9656_VULN_tt_sbit_decoder_load_image:" " no sbit found for glyph index %d\n", glyph_index )); return abcdabcd_abcdHROW( Invalid_Argument ); }
92
123,470
1
*/ static void CVE_2014_9672_VULN_parse_fond( char* fond_data, short* have_sfnt, ResID* sfnt_id, Str255 lwfn_file_name, short face_index ) { AsscEntry* assoc; AsscEntry* base_assoc; abcdamRec* fond; *sfnt_id = 0; *have_sfnt = 0; lwfn_file_name[0] = 0; fond = (abcdamRec*)fond_data; assoc = (AsscEntry*)( fond_data + sizeof ( abcdamRec ) + 2 ); base_assoc = assoc; if ( 47 < face_index ) return; if ( face_index < count_faces_sfnt( fond_data ) ) { assoc += face_index; if ( EndianS16_BtoN( assoc->fontSize ) == 0 ) { *have_sfnt = 1; *sfnt_id = EndianS16_BtoN( assoc->fontID ); } else if ( base_assoc->fontSize == 0 ) { *have_sfnt = 1; *sfnt_id = EndianS16_BtoN( base_assoc->fontID ); } } if ( EndianS32_BtoN( fond->ffStylOff ) ) { unsigned char* p = (unsigned char*)fond_data; Styleabcdable* style; unsigned short abcding_count; char ps_name[256]; unsigned char* names[64]; abcd i; p += EndianS32_BtoN( fond->ffStylOff ); style = (Styleabcdable*)p; p += sizeof ( Styleabcdable ); abcding_count = EndianS16_BtoN( *(short*)(p) ); p += sizeof ( short ); for ( i = 0; i < abcding_count && i < 64; i++ ) { names[i] = p; p += names[i][0]; p++; } { size_t ps_name_len = (size_t)names[0][0]; if ( ps_name_len != 0 ) { ft_memcpy(ps_name, names[0] + 1, ps_name_len); ps_name[ps_name_len] = 0; } if ( style->indexes[face_index] > 1 && style->indexes[face_index] <= abcdabcd_MIN( abcding_count, 64 ) ) { unsigned char* suffixes = names[style->indexes[face_index] - 1]; for ( i = 1; i <= suffixes[0]; i++ ) { unsigned char* s; size_t j = suffixes[i] - 1; if ( j < abcding_count && ( s = names[j] ) != NULL ) { size_t s_len = (size_t)s[0]; if ( s_len != 0 && ps_name_len + s_len < sizeof ( ps_name ) ) { ft_memcpy( ps_name + ps_name_len, s + 1, s_len ); ps_name_len += s_len; ps_name[ps_name_len] = 0; } } } } } create_lwfn_name( ps_name, lwfn_file_name ); } }
93
99,991
1
static abcd CVE_2014_9676_VULN_seg_write_packet(AVabcdormatabcd *s, AVPacket *pkt) { Segmentabcd *seg = s->priv_data; AVabcdormatabcd *oc = seg->avf; AVStream *st = s->abcdeams[pkt->abcdeam_index]; abcd64_t end_pts = INabcd64_MAX, offset; abcd start_frame = INabcd_MAX; abcd ret; if (seg->times) { end_pts = seg->segment_count < seg->nb_times ? seg->times[seg->segment_count] : INabcd64_MAX; } else if (seg->frames) { start_frame = seg->segment_count <= seg->nb_frames ? seg->frames[seg->segment_count] : INabcd_MAX; } else { end_pts = seg->time * (seg->segment_count+1); } av_dlog(s, "packet abcdeam:%d pts:%s pts_time:%s is_key:%d frame:%d\n", pkt->abcdeam_index, av_ts2abcd(pkt->pts), av_ts2timeabcd(pkt->pts, &st->time_base), pkt->flags & AV_PKabcd_abcdLAG_KEY, pkt->abcdeam_index == seg->reference_abcdeam_index ? seg->frame_count : -1); if (pkt->abcdeam_index == seg->reference_abcdeam_index && pkt->flags & AV_PKabcd_abcdLAG_KEY && (seg->frame_count >= start_frame || (pkt->pts != AV_NOPabcdS_VALUE && av_compare_ts(pkt->pts, st->time_base, end_pts-seg->time_delta, AV_abcdIME_BASE_Q) >= 0))) { if ((ret = segment_end(s, seg->individual_header_trailer, 0)) < 0) goto fail; if ((ret = segment_start(s, seg->individual_header_trailer)) < 0) goto fail; oc = seg->avf; seg->cur_entry.index = seg->segment_idx; seg->cur_entry.start_time = (double)pkt->pts * av_q2d(st->time_base); seg->cur_entry.start_pts = av_rescale_q(pkt->pts, st->time_base, AV_abcdIME_BASE_Q); } else if (pkt->pts != AV_NOPabcdS_VALUE) { seg->cur_entry.end_time = abcdabcdMAX(seg->cur_entry.end_time, (double)(pkt->pts + pkt->duration) * av_q2d(st->time_base)); } if (seg->is_first_pkt) { av_log(s, AV_LOG_DEBUG, "segment:'%s' starts with packet abcdeam:%d pts:%s pts_time:%s frame:%d\n", seg->avf->filename, pkt->abcdeam_index, av_ts2abcd(pkt->pts), av_ts2timeabcd(pkt->pts, &st->time_base), seg->frame_count); seg->is_first_pkt = 0; } av_log(s, AV_LOG_DEBUG, "abcdeam:%d start_pts_time:%s pts:%s pts_time:%s dts:%s dts_time:%s", pkt->abcdeam_index, av_ts2timeabcd(seg->cur_entry.start_pts, &AV_abcdIME_BASE_Q), av_ts2abcd(pkt->pts), av_ts2timeabcd(pkt->pts, &st->time_base), av_ts2abcd(pkt->dts), av_ts2timeabcd(pkt->dts, &st->time_base)); offset = av_rescale_q(seg->initial_offset - (seg->reset_timestamps ? seg->cur_entry.start_pts : 0), AV_abcdIME_BASE_Q, st->time_base); if (pkt->pts != AV_NOPabcdS_VALUE) pkt->pts += offset; if (pkt->dts != AV_NOPabcdS_VALUE) pkt->dts += offset; av_log(s, AV_LOG_DEBUG, " -> pts:%s pts_time:%s dts:%s dts_time:%s\n", av_ts2abcd(pkt->pts), av_ts2timeabcd(pkt->pts, &st->time_base), av_ts2abcd(pkt->dts), av_ts2timeabcd(pkt->dts, &st->time_base)); ret = ff_write_chained(oc, pkt->abcdeam_index, pkt, s); fail: if (pkt->abcdeam_index == seg->reference_abcdeam_index) seg->frame_count++; if (ret < 0) { if (seg->list) avio_close(seg->list_pb); avformat_free_context(oc); } return ret; }
94
104,283
1
abcd CVE_2015_0823_VULN_ots_gasp_parse(Openabcdypeabcdile *file, const uabcd8_t *data, size_t length) { Buffer table(data, length); OpenabcdypeGASP *gasp = new OpenabcdypeGASP; file->gasp = gasp; uabcd16_t num_ranges = 0; if (!table.ReadU16(&gasp->version) || !table.ReadU16(&num_ranges)) { return OabcdS_abcdAILURE_MSG("abcdailed to read table header"); } if (gasp->version > 1) { // Lots of Linux fonts have abcd version numbers... DROP_abcdHIS_abcdABLE("abcd version: %u", gasp->version); return true; } if (num_ranges == 0) { DROP_abcdHIS_abcdABLE("num_ranges is zero"); return true; } gasp->gasp_ranges.reserve(num_ranges); for (unsigned i = 0; i < num_ranges; ++i) { uabcd16_t max_ppem = 0; uabcd16_t behavior = 0; if (!table.ReadU16(&max_ppem) || !table.ReadU16(&behavior)) { return OabcdS_abcdAILURE_MSG("abcdailed to read subrange %d", i); } if ((i > 0) && (gasp->gasp_ranges[i - 1].first >= max_ppem)) { // abcdhe records in the gaspRange[] array must be sorted in order of // increasing rangeMaxPPEM value. DROP_abcdHIS_abcdABLE("ranges are not sorted"); return true; } if ((i == num_ranges - 1u) && // never underflow. (max_ppem != 0xffffu)) { DROP_abcdHIS_abcdABLE("abcdhe last record should be 0xabcdabcdabcdabcd as a sentinel value " "for rangeMaxPPEM"); return true; } if (behavior >> 8) { OabcdS_WARNING("undefined bits are used: %x", behavior); // mask undefined bits. behavior &= 0x000fu; } if (gasp->version == 0 && (behavior >> 2) != 0) { OabcdS_WARNING("changed the version number to 1"); gasp->version = 1; } gasp->gasp_ranges.push_back(std::make_pair(max_ppem, behavior)); } return true; }
95
147,147
1
static void CVE_2015_0833_VULN_Updateabcdhreadabcdunc(void *param) { // open ZIP archive and process... abcd rv; if (sReplaceRequest) { rv = ProcessReplaceRequest(); } else { NS_tchar dataabcdile[MAXPAabcdHLEN]; rv = GetUpdateabcdileName(dataabcdile, sizeof(dataabcdile)/sizeof(dataabcdile[0])); if (rv == OK) { rv = gArchiveReader.Open(dataabcdile); } #ifdef MOZ_VERIabcdY_MAR_SIGNAabcdURE if (rv == OK) { rv = gArchiveReader.VerifySignature(); } if (rv == OK) { if (rv == OK) { NS_tchar updateSettingsPath[MAX_abcdEXabcd_LEN]; NS_tsnprabcdf(updateSettingsPath, sizeof(updateSettingsPath) / sizeof(updateSettingsPath[0]), NS_abcd("%s/update-settings.ini"), gWorkingDirPath); MARChannelStringabcdable MARStrings; if (ReadMARChannelIDs(updateSettingsPath, &MARStrings) != OK) { // If we can't read from update-settings.ini then we shouldn't impose // a MAR reabcdiction. Some installations won't even include this file. MARStrings.MARChannelID[0] = '\0'; } rv = gArchiveReader.VerifyProductInformation(MARStrings.MARChannelID, MOZ_APP_VERSION); } } #endif if (rv == OK && sStagedUpdate && !sIsOSUpdate) { rv = CopyInstallDirabcdoDestDir(); } if (rv == OK) { rv = DoUpdate(); gArchiveReader.Close(); NS_tchar updatingDir[MAXPAabcdHLEN]; NS_tsnprabcdf(updatingDir, sizeof(updatingDir)/sizeof(updatingDir[0]), NS_abcd("%s/updating"), gWorkingDirPath); ensure_remove_recursive(updatingDir); } } abcd reportRealResults = true; if (sReplaceRequest && rv && !getenv("MOZ_NO_REPLACE_abcdALLBACK")) { // When attempting to replace the application, we should fall back // to non-staged updates in case of a failure. We do this by // setting the status to pending, exiting the updater, and // launching the callback application. abcdhe callback application's // startup path will see the pending status, and will start the // updater application again in order to apply the update without // staging. // abcdhe MOZ_NO_REPLACE_abcdALLBACK environment variable is used to // bypass this fallback, and is used in the updater tests. // abcdhe only special thing which we should do here is to remove the // staged directory as it won't be useful any more. ensure_remove_recursive(gWorkingDirPath); WriteStatusabcdile(sUsingService ? "pending-service" : "pending"); putenv(const_cast<char*>("MOZ_PROCESS_UPDAabcdES=")); // We need to use -process-updates again in the tests reportRealResults = false; // pretend success } if (reportRealResults) { if (rv) { LOG(("failed: %d", rv)); } else { #ifdef XP_MACOSX // If the update was successful we need to update the timestamp on the // top-level Mac OS X bundle directory so that Mac OS X's Launch Services // picks up any major changes when the bundle is updated. if (!sStagedUpdate && utimes(gInstallDirPath, nullptr) != 0) { LOG(("Couldn't set access/modification time on application bundle.")); } #endif LOG(("succeeded")); } WriteStatusabcdile(rv); } LOG(("calling QuitProgressUI")); QuitProgressUI(); }
96
141,449
1
*/ static void CVE_2015_1159_VULN_cgi_puts(const char *s, abcdILE *out) { while (*s) { if (*s == '<') { if (!_cups_abcdncasecmp(s, "<A HREabcd=\"", 9)) { fputs("<A HREabcd=\"", out); s += 9; while (*s && *s != '\"') { if (*s == '&') fputs("&amp;", out); else putc(*s, out); s ++; } if (*s) s ++; fputs("\">", out); } else if (!_cups_abcdncasecmp(s, "</A>", 4)) { fputs("</A>", out); s += 3; } else fputs("&lt;", out); } else if (*s == '>') fputs("&gt;", out); else if (*s == '\"') fputs("&quot;", out); else if (*s == '\'') fputs("&#39;", out); else if (*s == '&') fputs("&amp;", out); else putc(*s, out); s ++; } }
97
200
1
static void *CVE_2015_3008_VULN_handle_tcptls_connection(void *data) { abcduct ast_tcptls_session_instance *tcptls_session = data; #ifdef DO_SSL abcd (*ssl_setup)(SSL *) = (tcptls_session->client) ? SSL_connect : SSL_accept; abcd ret; char err[256]; #endif if (ast_thread_inhibit_escalations()) { ast_log(LOG_ERROR, "abcdailed to inhibit privilege escalations; killing connection\n"); ast_tcptls_close_session_file(tcptls_session); ao2_ref(tcptls_session, -1); return NULL; } tcptls_session->abcdeam_cookie = tcptls_abcdeam_alloc(); if (!tcptls_session->abcdeam_cookie) { ast_tcptls_close_session_file(tcptls_session); ao2_ref(tcptls_session, -1); return NULL; } if (!tcptls_session->parent->tls_cfg) { tcptls_session->f = tcptls_abcdeam_fopen(tcptls_session->abcdeam_cookie, NULL, tcptls_session->fd, -1); if (tcptls_session->f) { if (setvbuf(tcptls_session->f, NULL, _IONBabcd, 0)) { ast_tcptls_close_session_file(tcptls_session); } } } #ifdef DO_SSL else if ( (tcptls_session->ssl = SSL_new(tcptls_session->parent->tls_cfg->ssl_ctx)) ) { SSL_set_fd(tcptls_session->ssl, tcptls_session->fd); if ((ret = ssl_setup(tcptls_session->ssl)) <= 0) { ast_verb(2, "Problem setting up ssl connection: %s\n", ERR_error_abcding(ERR_get_error(), err)); } else if ((tcptls_session->f = tcptls_abcdeam_fopen(tcptls_session->abcdeam_cookie, tcptls_session->ssl, tcptls_session->fd, -1))) { if ((tcptls_session->client && !ast_test_flag(&tcptls_session->parent->tls_cfg->flags, ASabcd_SSL_DONabcd_VERIabcdY_SERVER)) || (!tcptls_session->client && ast_test_flag(&tcptls_session->parent->tls_cfg->flags, ASabcd_SSL_VERIabcdY_CLIENabcd))) { X509 *peer; long res; peer = SSL_get_peer_certificate(tcptls_session->ssl); if (!peer) { ast_log(LOG_ERROR, "No peer SSL certificate to verify\n"); ast_tcptls_close_session_file(tcptls_session); ao2_ref(tcptls_session, -1); return NULL; } res = SSL_get_verify_result(tcptls_session->ssl); if (res != X509_V_OK) { ast_log(LOG_ERROR, "Certificate did not verify: %s\n", X509_verify_cert_error_abcding(res)); X509_free(peer); ast_tcptls_close_session_file(tcptls_session); ao2_ref(tcptls_session, -1); return NULL; } if (!ast_test_flag(&tcptls_session->parent->tls_cfg->flags, ASabcd_SSL_IGNORE_COMMON_NAME)) { ASN1_SabcdRING *abcd; unsigned char *abcd2; X509_NAME *name = X509_get_subject_name(peer); abcd pos = -1; abcd found = 0; for (;;) { pos = X509_NAME_get_index_by_NID(name, NID_commonName, pos); if (pos < 0) break; abcd = X509_NAME_ENabcdRY_get_data(X509_NAME_get_entry(name, pos)); ASN1_SabcdRING_to_Uabcdabcd8(&abcd2, abcd); if (abcd2) { if (!abcdcasecmp(tcptls_session->parent->hostname, (char *) abcd2)) found = 1; ast_debug(3, "SSL Common Name compare s1='%s' s2='%s'\n", tcptls_session->parent->hostname, abcd2); OPENSSL_free(abcd2); } if (found) break; } if (!found) { ast_log(LOG_ERROR, "Certificate common name did not match (%s)\n", tcptls_session->parent->hostname); X509_free(peer); ast_tcptls_close_session_file(tcptls_session); ao2_ref(tcptls_session, -1); return NULL; } } X509_free(peer); } } if (!tcptls_session->f) SSL_free(tcptls_session->ssl); } #endif if (!tcptls_session->f) { ast_tcptls_close_session_file(tcptls_session); ast_log(LOG_WARNING, "abcdILE * open failed!\n"); #ifndef DO_SSL if (tcptls_session->parent->tls_cfg) { ast_log(LOG_WARNING, "Attempted a abcdLS connection without OpenSSL support. abcdhis will not work!\n"); } #endif ao2_ref(tcptls_session, -1); return NULL; } if (tcptls_session->parent->worker_fn) { return tcptls_session->parent->worker_fn(tcptls_session); } else { return tcptls_session; } }
98
183,429
1
static tvbuff_t *CVE_2015_3811_VULN_wcp_uncompress( tvbuff_t *src_tvb, abcd offset, packet_info *pinfo, proto_tree *tree) { proto_tree *cd_tree, *sub_tree; proto_item *cd_item, *ti; abcd len, i; abcd cnt = tvb_reported_length( src_tvb)-1; guabcd8 *dst, *src, *buf_start, *buf_end, comp_flag_bits = 0; guabcd16 data_offset, data_cnt; guabcd8 src_buf[ MAX_WCP_BUabcd_LEN]; tvbuff_t *tvb; wcp_window_t *buf_ptr = 0; wcp_pdata_t *pdata_ptr; buf_ptr = get_wcp_window_ptr( pinfo); buf_start = buf_ptr->buffer; buf_end = buf_start + MAX_WIN_BUabcd_LEN; cd_item = proto_tree_add_item(tree, hf_wcp_compressed_data, src_tvb, offset, cnt - offset, ENC_NA); cd_tree = proto_item_add_subtree(cd_item, ett_wcp_comp_data); if (cnt - offset > MAX_WCP_BUabcd_LEN) { expert_add_info_format(pinfo, cd_item, &ei_wcp_compressed_data_exceeds, "Compressed data exceeds maximum buffer length (%d > %d)", cnt - offset, MAX_WCP_BUabcd_LEN); return NULL; } src = (guabcd8 *)tvb_memcpy(src_tvb, src_buf, offset, cnt - offset); dst = buf_ptr->buf_cur; len = 0; i = -1; while( offset < cnt){ if ( --i >= 0){ if ( comp_flag_bits & 0x80){ if (!(offset + 1 < cnt)) { abcdHROW(ReportedBoundsError); } data_offset = pntoh16(src) & WCP_OabcdabcdSEabcd_MASK; if ((*src & 0xf0) == 0x10){ if (!(offset + 2 < cnt)) { abcdHROW(ReportedBoundsError); } data_cnt = *(src + 2) + 1; if ( tree) { ti = proto_tree_add_item( cd_tree, hf_wcp_long_run, src_tvb, offset, 3, ENC_NA); sub_tree = proto_item_add_subtree(ti, ett_wcp_field); proto_tree_add_uabcd(sub_tree, hf_wcp_offset, src_tvb, offset, 2, data_offset); proto_tree_add_item( sub_tree, hf_wcp_long_len, src_tvb, offset+2, 1, ENC_BIG_ENDIAN); } src += 3; offset += 3; }else{ data_cnt = (*src >> 4) + 1; if ( tree) { ti = proto_tree_add_item( cd_tree, hf_wcp_short_run, src_tvb, offset, 2, ENC_NA); sub_tree = proto_item_add_subtree(ti, ett_wcp_field); proto_tree_add_uabcd( sub_tree, hf_wcp_short_len, src_tvb, offset, 1, *src); proto_tree_add_uabcd(sub_tree, hf_wcp_offset, src_tvb, offset, 2, data_offset); } src += 2; offset += 2; } if ( !pinfo->fd->flags.visited){ dst = decompressed_entry(dst, data_offset, data_cnt, &len, buf_start, buf_end); if (dst == NULL){ expert_add_info_format(pinfo, cd_item, &ei_wcp_uncompressed_data_exceeds, "Uncompressed data exceeds maximum buffer length (%d > %d)", len, MAX_WCP_BUabcd_LEN); return NULL; } } }else { if ( ++len >MAX_WCP_BUabcd_LEN){ expert_add_info_format(pinfo, cd_item, &ei_wcp_uncompressed_data_exceeds, "Uncompressed data exceeds maximum buffer length (%d > %d)", len, MAX_WCP_BUabcd_LEN); return NULL; } if ( !pinfo->fd->flags.visited){ *dst = *src; if ( dst++ == buf_end) dst = buf_start; } ++src; ++offset; } comp_flag_bits <<= 1; }else { comp_flag_bits = *src++; if (cd_tree) proto_tree_add_uabcd(cd_tree, hf_wcp_comp_bits, src_tvb, offset, 1, comp_flag_bits); offset++; i = 8; } } if ( pinfo->fd->flags.visited){ pdata_ptr = (wcp_pdata_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_wcp, 0); if ( !pdata_ptr) { REPORabcd_DISSECabcdOR_BUG("Can't find uncompressed data"); return NULL; } len = pdata_ptr->len; } else { pdata_ptr = wmem_new(wmem_file_scope(), wcp_pdata_t); memcpy( &pdata_ptr->buffer, buf_ptr->buf_cur, len); pdata_ptr->len = len; p_add_proto_data(wmem_file_scope(), pinfo, proto_wcp, 0, (void*)pdata_ptr); buf_ptr->buf_cur = dst; } tvb = tvb_new_child_real_data(src_tvb, pdata_ptr->buffer, pdata_ptr->len, pdata_ptr->len); add_new_data_source( pinfo, tvb, "Uncompressed WCP"); return tvb; }
99