search for: sizeof

Displaying 20 results from an estimated 12450 matches for "sizeof".

2000 Nov 08
0
vq diffs
...er=(char*)_ogg_malloc(lbufsize); }else{ lbufsize*=2; - linebuffer=_ogg_realloc(linebuffer,lbufsize); + linebuffer=(char*)_ogg_realloc(linebuffer,lbufsize); } } @@ -179,6 +179,7 @@ codebook *codebook_load(char *filename){ - codebook *b=_ogg_calloc(1,sizeof(codebook)); - static_codebook *c=(static_codebook *)(b->c=_ogg_calloc(1,sizeof(static_codebook))); + codebook *b=(codebook*)_ogg_calloc(1,sizeof(codebook)); + static_codebook *c=(static_codebook*) + (b->c=(const static_codebook*)_ogg_calloc(1,sizeof(static_codebook))); encode_aux_n...
2015 Feb 10
6
[PATCH 0/6] fix some compiler warnings
These patches fix a few compiler warnings. Tested on top of commit aee0dc5565711ef5be7c30fb5fc1c5f3f98db09f Jonathan Boeing (6): Use z width specifier when printing size_t variable pxe: fix truncation warning gpllib: fix sizeof(char *) misuse hdt: fix sizeof(char *) misuse hdt: fix sizeof(char *) misuse hdt: fix sizeof(char *) misuse com32/gpllib/dmi/dmi.c | 24 +++--- com32/hdt/hdt-cli-cpu.c | 178 ++++++++++++++++++++-------------------- com32/hdt/hdt-cli.c | 5 +- com32/hdt/hdt-m...
2015 Feb 10
0
[PATCH 4/6] hdt: fix sizeof(char *) misuse
The code was passing sizeof(char *) - not the length of the buffer - to memset. Change the function to take the length of the buffer as a parameter. Fixes the warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to provide an explicit length? Signed-off-by:...
2010 Jul 04
5
dovecot-1.2.12 fails to build on Solaris 8 and 10
configure fails with : configure: error: Unsupported off_t type I am not too sure what off_t is needed but this is a pretty standard thing. My configure line : ./configure --build=i386-pc-solaris2.10 --host=i386-pc-solaris2.10 --prefix=/opt/csw --with-zlib --with-ssl=openssl --with-storages=mbox,maildir --with-libiconv-prefix=/opt/csw Yes, the openssl libs are in /opt/csw/lib Not sure what
2020 Sep 15
0
[PATCH 11/18] lib82596: convert to dma_alloc_noncoherent
...NT_DMA 1 + #include "lib82596.c" MODULE_AUTHOR("Richard Hirst"); @@ -184,9 +177,9 @@ lan_init_chip(struct parisc_device *dev) lp = netdev_priv(netdevice); lp->options = dev->id.sversion == 0x72 ? OPT_SWAP_PORT : 0; - lp->dma = dma_alloc_attrs(&dev->dev, sizeof(struct i596_dma), - &lp->dma_addr, GFP_KERNEL, - DMA_ATTR_NON_CONSISTENT); + lp->dma = dma_alloc_noncoherent(&dev->dev, + sizeof(struct i596_dma), &lp->dma_addr, + DMA_BIDIRECTIONAL, GFP_KERNEL); if (!lp->dma) goto out_free_netdev; @@ -196,8 +18...
2020 Aug 19
0
[PATCH 23/28] lib82596: convert from dma_cache_sync to dma_sync_single_for_device
...d *addr, + size_t len) +{ +} +static inline void dma_sync_cpu(struct net_device *ndev, volatile void *addr, + size_t len) +{ +} +#endif /* NONCOHERENT_DMA */ static inline int wait_istat(struct net_device *dev, struct i596_dma *dma, int delcnt, char *str) { - DMA_INV(dev, &(dma->iscp), sizeof(struct i596_iscp)); + dma_sync_cpu(dev, &(dma->iscp), sizeof(struct i596_iscp)); while (--delcnt && dma->iscp.stat) { udelay(10); - DMA_INV(dev, &(dma->iscp), sizeof(struct i596_iscp)); + dma_sync_cpu(dev, &(dma->iscp), sizeof(struct i596_iscp)); } if (!de...
2018 Mar 26
2
murmurhash3 test failures on big-endian systems
Hi, The dovecot 2.3.0.1 Debian package currently fails to build on all big-endian architectures[1], due to murmurhash3 tests failing. The relevant output from e.g. s390x is: test-murmurhash3.c:22: Assert(#8) failed: memcmp(result, vectors[i].result, sizeof(result)) == 0 test-murmurhash3.c:22: Assert(#11) failed: memcmp(result, vectors[i].result, sizeof(result)) == 0 test-murmurhash3.c:22: Assert(#12) failed: memcmp(result, vectors[i].result, sizeof(result)) == 0 murmurhash3 (murmurhash3_32) ......................................... : FAILED test-...
2020 Sep 14
2
[PATCH 11/17] sgiseeq: convert to dma_alloc_noncoherent
...NT_DMA 1 + #include "lib82596.c" MODULE_AUTHOR("Richard Hirst"); @@ -184,9 +177,9 @@ lan_init_chip(struct parisc_device *dev) lp = netdev_priv(netdevice); lp->options = dev->id.sversion == 0x72 ? OPT_SWAP_PORT : 0; - lp->dma = dma_alloc_attrs(&dev->dev, sizeof(struct i596_dma), - &lp->dma_addr, GFP_KERNEL, - DMA_ATTR_NON_CONSISTENT); + lp->dma = dma_alloc_noncoherent(&dev->dev, + sizeof(struct i596_dma), &lp->dma_addr, + DMA_BIDIRECTIONAL, GFP_KERNEL); if (!lp->dma) goto out_free_netdev; @@ -196,8 +18...
2001 Mar 13
5
is this null block OK?
...eservation offset * */ static void presto_free_reservation(struct presto_log_fd *fd, struct presto_reservation_data *rd, int freemem) { ENTRY; write_lock(&fd->fd_lock); list_del(&rd->ri_list); /* XXX */ if(freemem) PRESTO_FREE(rd, sizeof(*rd)); write_unlock(&fd->fd_lock); EXIT; return; } static int presto_do_truncate(struct presto_file_set *fset, struct dentry *dentry, loff_t length, loff_t size_check) { struct inode *inode = dentry->d_inode;...
2010 Oct 11
2
[patch 1/2] vhost: potential integer overflows
...drivers/vhost/vhost.c b/drivers/vhost/vhost.c index dd3d6f7..c2aa12c 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -429,6 +429,14 @@ static int vq_access_ok(unsigned int num, struct vring_avail __user *avail, struct vring_used __user *used) { + + if (num > UINT_MAX / sizeof *desc) + return 0; + if (num > UINT_MAX / sizeof *avail->ring - sizeof *avail) + return 0; + if (num > UINT_MAX / sizeof *used->ring - sizeof *used) + return 0; + return access_ok(VERIFY_READ, desc, num * sizeof *desc) && access_ok(VERIFY_READ, avail, sizeof *...
2010 Oct 11
2
[patch 1/2] vhost: potential integer overflows
...drivers/vhost/vhost.c b/drivers/vhost/vhost.c index dd3d6f7..c2aa12c 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -429,6 +429,14 @@ static int vq_access_ok(unsigned int num, struct vring_avail __user *avail, struct vring_used __user *used) { + + if (num > UINT_MAX / sizeof *desc) + return 0; + if (num > UINT_MAX / sizeof *avail->ring - sizeof *avail) + return 0; + if (num > UINT_MAX / sizeof *used->ring - sizeof *used) + return 0; + return access_ok(VERIFY_READ, desc, num * sizeof *desc) && access_ok(VERIFY_READ, avail, sizeof *...
2006 May 04
2
xmalloc(foo*bar) -> xcalloc(foo, bar) for Portable
...While wandering in auth-pam.c I noticed that there's a few Portable-specific escapees from the xmalloc(foo * bar) cleanup. There's also a "probably can't happen" integer overflow in ssh-rand-helper.c with the memset: num_cmds = 64; - entcmd = xmalloc(num_cmds * sizeof(entropy_cmd_t)); + entcmd = xcalloc(num_cmds, sizeof(entropy_cmd_t)); memset(entcmd, '\0', num_cmds * sizeof(entropy_cmd_t)); Unless sizeof(entropy_cmd_t) is *really* big, it ought to safe :-) Index: auth-pam.c ===============================================================...
2019 Jun 06
0
[PATCH v4 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...ndicators2; + return &vcdev->dma_area->indicators2; } struct vq_info_block_legacy { @@ -336,8 +340,8 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev, struct airq_info *airq_info = vcdev->airq_info; if (vcdev->is_thinint) { - thinint_area = kzalloc(sizeof(*thinint_area), - GFP_DMA | GFP_KERNEL); + thinint_area = ccw_device_dma_zalloc(vcdev->cdev, + sizeof(*thinint_area)); if (!thinint_area) return; thinint_area->summary_indicator = @@ -348,8 +352,8 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device...
2019 Jun 12
0
[PATCH v5 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...ndicators2; + return &vcdev->dma_area->indicators2; } struct vq_info_block_legacy { @@ -336,8 +340,8 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev, struct airq_info *airq_info = vcdev->airq_info; if (vcdev->is_thinint) { - thinint_area = kzalloc(sizeof(*thinint_area), - GFP_DMA | GFP_KERNEL); + thinint_area = ccw_device_dma_zalloc(vcdev->cdev, + sizeof(*thinint_area)); if (!thinint_area) return; thinint_area->summary_indicator = @@ -348,8 +352,8 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device...
2013 Nov 27
20
[PATCH 0/4] efi: PE header generation fix
The PE headers of the generated efi file were quite buggy. And since OVMF perform a few consistency checks, syslinux was unable to run on it. I don't pretend to have a thorough understanding of the PE+ headers, some bugs may remain. :) Celelibi (4): efi: Fix PE header field rva_and_sizes_nr efi: Location, size and alignment of .text section efi: Useless relocations in PE file efi: PE
2000 Jun 19
1
configure problem on UnixWare 7.1.1
...lz -lgen -lsocket -lcrypto 1>&5 configure:2571: openssl/rand.h: No such file or directory configure: failed program was: #line 2568 "configure" #include "confdefs.h" #include <string.h> #include <openssl/rand.h> int main(void) { char a[2048]; memset(a, 0, sizeof(a)); RAND_add(a, sizeof(a), sizeof(a)); return(RAND_status() <= 0); } configure:2582: gcc -o conftest -g -O2 -Wall -I/usr/local/include -I/usr/local/openssl/include -L/usr/local/lib -L/usr/local/openssl/lib -L/usr/local/openssl conftest.c -lsocket -lnsl -lz -lgen -lsocket -lcrypto 1>...
2013 Nov 27
0
[PATCH 2/4] efi: Location, size and alignment of .text section
...ct coff_hdr c_hdr; struct header hdr; struct coff_reloc c_rel; - __uint32_t total_sz = so_size; + __uint32_t total_sz = data_size; __uint32_t dummy = 0; __uint32_t hdr_sz; __uint32_t reloc_start, reloc_end; + hdr_sz = 512; + total_sz += hdr_sz; + entry += hdr_sz; + memset(&hdr, 0, sizeof(hdr)); hdr.msdos_signature = MSDOS_SIGNATURE; @@ -77,11 +81,6 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size, c_hdr.nr_sections = 2; c_hdr.nr_syms = 1; if (class == ELFCLASS32) { - hdr_sz = sizeof(o_hdr) + sizeof(t_sec) + sizeof(e_hdr) + - sizeof(r_sec) + size...
2010 Sep 16
2
problem reading Matlab file into R
...changing the mat file or saving it in a different format is not an option for me. Kind regards, Claude > foo <- readMat("riversurveyor.mat", verbose=TRUE) Trying to read MAT v5 file stream... List of 7 $ type : chr "miMATRIX" $ signed : logi NA $ sizeOf : int 0 $ what : num 0 $ nbrOfBytes: int 2848 $ padding : num 0 $ compressed: logi FALSE List of 7 $ type : chr "miMATRIX" $ signed : logi NA $ sizeOf : int 0 $ what : num 0 $ nbrOfBytes: int 56...
2015 Mar 05
3
[PATCH] virtio_mmio: fix endian-ness for mmio
...- ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i); + if (vm_dev->version == 1) { + u8 *ptr = buf; + int i; + + for (i = 0; i < len; i++) + ptr[i] = readb(base + offset + i); + return; + } + + switch (len) { + case 1: + b = readb(base + offset); + memcpy(buf, &b, sizeof b); + break; + case 2: + w = cpu_to_le16(readw(base + offset)); + memcpy(buf, &w, sizeof w); + break; + case 4: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + break; + case 8: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + l =...
2015 Mar 05
3
[PATCH] virtio_mmio: fix endian-ness for mmio
...- ptr[i] = readb(vm_dev->base + VIRTIO_MMIO_CONFIG + offset + i); + if (vm_dev->version == 1) { + u8 *ptr = buf; + int i; + + for (i = 0; i < len; i++) + ptr[i] = readb(base + offset + i); + return; + } + + switch (len) { + case 1: + b = readb(base + offset); + memcpy(buf, &b, sizeof b); + break; + case 2: + w = cpu_to_le16(readw(base + offset)); + memcpy(buf, &w, sizeof w); + break; + case 4: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + break; + case 8: + l = cpu_to_le32(readl(base + offset)); + memcpy(buf, &l, sizeof l); + l =...