similar to: [PATCH 0/2] Correct various strndup() problems

Displaying 20 results from an estimated 3000 matches similar to: "[PATCH 0/2] Correct various strndup() problems"

2014 Aug 11
2
[PATCH] p2v: check results of strndup and sscanf
--- p2v/ssh.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/p2v/ssh.c b/p2v/ssh.c index 1e9b05c..ff906df 100644 --- a/p2v/ssh.c +++ b/p2v/ssh.c @@ -505,7 +505,16 @@ open_data_connection (struct config *config, int *local_port, int *remote_port) }, ovector, ovecsize)) { case 100: /* Ephemeral port. */ port_str =
2003 Nov 24
1
[PATCH] library functions
Hi, Here are some new library functions for klibc. Some of them are required for udev, which currently has a klibc_fixups.c file that implements these functions. mh -- Martin Hicks Wild Open Source Inc. mort@wildopensource.com 613-266-2296 # This is a BitKeeper generated patch for the following project: # Project Name: The kernel C library # This patch format is intended
2011 Jun 10
0
[PATCH] strndup(): Fix possible null pointer dereference
Directly return NULL if malloc failed. Signed-off-by: maximilian attems <max at stro.at> --- usr/klibc/strndup.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/klibc/strndup.c b/usr/klibc/strndup.c index 8b5974a..65afd44 100644 --- a/usr/klibc/strndup.c +++ b/usr/klibc/strndup.c @@ -10,8 +10,10 @@ char *strndup(const char *s, size_t n) int l = n >
2011 Jul 27
0
klibc 1.5.24 release
Enough small fixes have pilled up to make it worth a release: A Google patch adds sched_setaffinity, sched_getaffinity support. Openembedded uses kexec_load(). Gentoo folks add a Kbuild fix. ipconfig no longer wild guesses a nameserver when none is provided by the DHCP server. strndup() and unlinkat() saw fixes for various problems. codingstyle cleanup in kinit and tools. git repository:
2010 Mar 25
0
[PATCH 1/3] btrfs-progs: Fix a compile fail by strndup in RHEL5 env
From: Zhao Lei <zhaolei@cn.fujitsu.com> When we compile btrfs-progs in RHEL5(with default gcc 4.1.2 and glibc-2.5-18), we can get following error: cc1: warnings being treated as errors btrfs-list.c: In function ''ino_resolve'': btrfs-list.c:511: warning: implicit declaration of function ''strndup'' btrfs-list.c:511: warning: incompatible implicit declaration
2007 Mar 30
0
strndup.c bug ?
luoyi at test:~/src/klibc.orig/klibc-1.5/usr/klibc$ diff -u strndup.c strndup.c.new --- strndup.c 2007-03-04 09:52:10.000000000 +0800 +++ strndup.c.new 2007-03-29 18:26:29.000000000 +0800 @@ -10,8 +10,9 @@ int l = n > strlen(s) ? strlen(s) + 1 : n + 1; char *d = malloc(l); - if (d) + if (d) { memcpy(d, s, l); - d[n] =
2010 Jun 28
1
[PATCH] Btrgs-progs: Define _GNU_SOURCE for strndup
This fixes: btrfs-list.c: Dans la fonction «ino_resolve» : btrfs-list.c:511: attention : déclaration implicite de la fonction « «strndup» » btrfs-list.c:511: attention : incompatible implicit declaration of built-in function «strndup» make: *** [btrfs-list.o] Erreur 1 and: btrfs.c: Dans la fonction «split_command» : btrfs.c:168: attention : déclaration implicite de la fonction « «strndup» »
2007 Sep 19
0
Patch to replace strndup with malloc/strncpy for the ini plugin
Hi, I am the maintainer for the compiz port on FreeBSD. We do not have strndup, so this patch replaces one other instance of strndup. thanks, robert. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Replace-strndup-with-malloc-and-strncpy.-FreeBSD-do.patch Type: application/mbox Size: 1671 bytes Desc: not available Url :
2020 Aug 26
2
Re: [nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
On 8/25/20 3:32 PM, Eric Blake wrote: >>> -      keys[optind] = strndup (argv[optind], n); >>> -      if (keys[optind] == NULL) { >>> -        perror ("strndup"); >>> +      CLEANUP_FREE char *key = strndup (argv[optind], n); >>> +      const char *safekey = nbdkit_string_intern (key); >>> +      if (safekey == NULL) >>>
2020 Aug 25
3
Re: [nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
On Tue, Aug 25, 2020 at 10:46:57AM -0500, Eric Blake wrote: > + const char *nbdkit_string_intern (const char *str); > + > +Returns a copy of str, so that the caller may reclaim str and use the > +copy in its place. If the copy is created outside the scope of a > +connection (such as during C<.load>), the lifetime of the copy will > +last at least through C<.unload>;
2020 Feb 17
3
sshd crashes
Hi, sshd crashes at below location. After compilation, when I start sshd it crashes in ?sshbuf-misc.c? file inside ?sshbuf_b64tod? function at line size_t plen = strlen(b64); The call trace is as below, Sshd main function -> sshkey_load_public -> sshkey_try_load_public -> sshkey_read -> sshbuf_b64tod During compilation a warning is thrown. Is this the trigger point for the crash?
2011 Sep 14
1
[nut-commits] svn commit r3226 - trunk/tools/nut-scanner
On Wed, 2011-09-14 at 12:25 +0000, Charles Lepple wrote: > Author: clepple-guest > Date: Wed Sep 14 12:25:03 2011 > New Revision: 3226 > URL: http://trac.networkupstools.org/projects/nut/changeset/3226 > > Log: > Include <string.h> for nut-scanner > > Modified: > trunk/tools/nut-scanner/scan_snmp.c > trunk/tools/nut-scanner/scan_usb.c > >
2014 Feb 04
2
Re: [PATCH 2/3] New API: part-get-name (RHBZ#593511).
On Tue, Feb 04, 2014 at 04:01:32PM +0100, Pino Toscano wrote: > +static char * > +extract_optionally_quoted (const char *value) > +{ > + size_t value_len = strlen (value); > + > + if (value_len >= 2 && > + ((value[0] == '\'' && value[value_len - 1] == '\'') || > + (value[0] == '"' &&
2020 Sep 03
1
Re: [PATCH nbdkit] server/public.c: Uninline nbdkit_strdup_intern to avoid compiler warning.
On 9/3/20 4:41 AM, Richard W.M. Jones wrote: > Previously with GCC 10.2 this code produced: > > In function ‘nbdkit_strndup_intern’, > inlined from ‘nbdkit_strdup_intern’ at public.c:839:10: > public.c:827:10: error: ‘strndup’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] > 827 | copy = strndup (str,
2017 Oct 26
1
[PATCH] builder: ignore spaces after repo identifiers (RHBZ#1506511)
--- builder/index-scan.l | 5 +++-- builder/test-virt-index-validate-good-4 | 3 +++ builder/test-virt-index-validate.sh | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 builder/test-virt-index-validate-good-4 diff --git a/builder/index-scan.l b/builder/index-scan.l index bdb474b33..49dad72bc 100644 --- a/builder/index-scan.l +++
2020 Sep 03
2
Re: [PATCH nbdkit] server/public.c: Uninline nbdkit_strdup_intern to avoid compiler warning.
On Thu, Sep 03, 2020 at 10:47:13AM +0100, Richard W.M. Jones wrote: > > A simple reproducer is: > > ---------------------------------------------------------------------- > #include <stdio.h> > #include <stdlib.h> > #include <stdint.h> > #include <string.h> > > const char * > copyn (const char *str, size_t n) > { > return strndup
2015 Jun 17
2
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
On Wednesday 17 June 2015 16:19:32 Chen Hanxiao wrote: > don't return a value which is to be freed. > > v4: use strndup > v3: v3: fix test case failure > Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> > --- > daemon/btrfs.c | 26 +++++++++++++++++--------- > 1 file changed, 17 insertions(+), 9 deletions(-) > > diff --git a/daemon/btrfs.c
2007 Apr 12
2
[PATCH] Make com32 printf obey width-restriction on %s
Hi, The following patch is against 3.36. It lets the width-modifier to the %s conversion specifier restrict the length of the formatted string as well as expand it. In addition, it adds the strnlen function, which only exists as a prototype today. -- Arne. --- syslinux-3.36/com32/lib/Makefile.orig 2007-02-10 21:47:07.000000000 +0100 +++ syslinux-3.36/com32/lib/Makefile 2007-04-12
2020 Aug 18
1
Re: [PATCH nbdkit 3/9] server: Add general replacements for missing functions using LIBOBJS.
On 8/18/20 5:50 AM, Richard W.M. Jones wrote: > Especially on Windows, some common functions are missing. Use the > autoconf LIBOBJS mechanism to replace these functions. > > This includes replacement functions for: > > Function names Implementation Origin > > getdelim, getline general purpose NetBSD under a compatible license > > openlog,
2015 Sep 09
1
[PATCH v1 1/1] extlinux: fix memory leak
devname is put on heap for all cases to avoid memory leak, and ease of use in future as well Signed-off-by: Imran Zaman <imran.zaman at intel.com> --- extlinux/main.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/extlinux/main.c b/extlinux/main.c index 55a1495..7bb7443 100644 --- a/extlinux/main.c +++