[pacman-dev] [PATCH] Constify some input pointers

2020-04-24 Thread Rikard Falkeborn
Signed-off-by: Rikard Falkeborn --- lib/libalpm/diskspace.c | 2 +- lib/libalpm/diskspace.h | 2 +- lib/libalpm/util.c | 2 +- src/pacman/util.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 4cc17a12

[pacman-dev] [PATCH] Add REALLOC macro to simplify realloc error handling

2020-04-12 Thread Rikard Falkeborn
, in be_package and be_sync, this fixes hypothetical memory leaks (and thereafter null pointer dereferences) in case realloc fails to shrink the allocated memory. Signed-off-by: Rikard Falkeborn --- lib/libalpm/be_local.c | 7 +-- lib/libalpm/be_package.c | 3 +-- lib/libalpm/be_sync.c| 2

[pacman-dev] [PATCH] Fix clang 8 string-plus-int warnings

2019-04-04 Thread Rikard Falkeborn
Clang 8 warns that adding a string to an integer does not append to string. Indeed it doesn't, but that was not the intentetion. Use array indexing as suggested by the compiler to silence the warning. There should be no functional change. Example of warning message: alpm.c:71:54: warning:

[pacman-dev] [PATCH] doc: Remove double spaces

2018-07-29 Thread Rikard Falkeborn
Signed-off-by: Rikard Falkeborn --- doc/pacman.conf.5.asciidoc | 2 +- doc/submitting-patches.asciidoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/pacman.conf.5.asciidoc b/doc/pacman.conf.5.asciidoc index 5f9def5b..9810fc7f 100644 --- a/doc/pacman.conf.5

[pacman-dev] [PATCH 1/3] PKGBUILD.5: Mention valid characters for arch

2018-02-20 Thread Rikard Falkeborn
Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- doc/PKGBUILD.5.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 18bc2a19..3b8c2ed1 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -168,7

[pacman-dev] [PATCH 2/3] PKGBUILD.5: Mention that pkgver can't contain whitespace

2018-02-20 Thread Rikard Falkeborn
Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- doc/PKGBUILD.5.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 3b8c2ed1..cbd02e88 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -48,7

[pacman-dev] [PATCH 0/3] Make documentation and PKGBUILD linting more consistent

2018-02-20 Thread Rikard Falkeborn
Make the documentation a little more explicit about allowed characters for arch and pkgver. Also fix linting of pkgver which was broken if pkgver contained whitespace. Rikard Falkeborn (3): PKGBUILD.5: Mention valid characters for arch PKGBUILD.5: Mention that pkgver can't contain whitespace

[pacman-dev] [PATCH 3/3] Fix linting of whitespace in pkgver

2018-02-20 Thread Rikard Falkeborn
In order to detect if pkgver contains whitespace, we need to quote it. Previously, only the characters up to the first whitespace was checked. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 2 +- 1 file changed, 1 insertion

[pacman-dev] [PATCH] Suppress valgrind error in fakechroot

2017-01-02 Thread Rikard Falkeborn
:/usr/lib/libdl-2.24.so fun:dlsym obj:/usr/lib/libfakeroot/fakechroot/libfakechroot.so fun:bindtextdomain obj:/usr/lib/libgpg-error.so.0.20.0 fun:call_init.part.0 fun:_dl_init obj:/usr/lib/ld-2.24.so obj:* obj:* obj:* } Signed-off-by: Rikard Falkeborn

Re: [pacman-dev] [PATCH v3 1/2] makepkg: Move parseopts from library to libmakepkg

2016-10-09 Thread Rikard Falkeborn
>> Why not move it to util/parseopts.sh if it should be moved into libmakepkg? >> > I suppose that makes sense. util/util.sh ("General utility functions") may also be appropriate if we don't want to create a new file. Why do you want to move it to libmakepkg? Isn't library a more suitable place?

Re: [pacman-dev] [PATCH 1/1] lint_pkgbuild/pkgname: pkgname is not allowed to be empty

2016-10-08 Thread Rikard Falkeborn
2016-10-04 10:21 GMT+02:00 Christian Hesse : > From: Christian Hesse > > We checked for empty array elements, but did not catch empty array. Add > a check for that case as well. > > Signed-off-by: Christian Hesse > --- >

Re: [pacman-dev] [PATCH v2] makepkg: Move parseopts from library to libmakepkg

2016-10-08 Thread Rikard Falkeborn
2016-10-08 7:18 GMT+02:00 Alad Wenter : > Signed-off-by: Alad Wenter > --- > v2: Add missing signoff. > > scripts/libmakepkg/util/option.sh | 157 ++ > > scripts/library/README| 20 - >

[pacman-dev] [PATCH 2/2] Change type of count in be_sync

2016-09-22 Thread Rikard Falkeborn
Making it size_t matches the return value of alpm_list_count() and avoids the implicit cast to int. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- lib/libalpm/be_sync.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libalpm/be_sync.c

[pacman-dev] [PATCH 1/2] Return boolean from db_populate

2016-09-22 Thread Rikard Falkeborn
Since the number of packages is not used anywhere, just return a boolean to avoid the implicit cast from size_t to int in be_local.c. Use 0 as success to be consistent with db_validate. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- This patch is made on top of the &q

[pacman-dev] [PATCH] Fix gcc strict-overflow error

2016-09-17 Thread Rikard Falkeborn
does not occur when simplifying conditional [-Werror=strict-overflow] if(count > 0) { Fix this by changing the type of count from int to size_t, which is fine since count is never negative. Signed-off-by: Rikard Falkeborn <rikard.

Re: [pacman-dev] [PATCH] Fix out of boundary reads in pacsort.

2016-06-13 Thread Rikard Falkeborn
2016-06-09 23:16 GMT+02:00 Tobias Stoeckmann : > ... > You can trigger it by running this command: > > $ echo -e "-.pkg.tar.xz\n-.pkg.tar.xz" | pacsort -k 99 -t '\0' > Segmentation fault > > ... > $ echo "-/.pkg.tar.xz" | pacsort > Segmentation fault > > Could these

Re: [pacman-dev] [PATCH] alpm: Fix possible alignment issues w/ events

2016-01-02 Thread Rikard Falkeborn
2016-01-02 19:21 GMT+01:00 Olivier Brunel <j...@jjacky.com>: > As reported by Rikard Falkeborn[1] using event-specific struct and then > typecasting to the generic alpm_event_t could possibly lead to alignment > issue, > so we now always use alpm_event_t instea

Re: [pacman-dev] Clang warnings

2016-01-01 Thread Rikard Falkeborn
Den 1 jan 2016 15:06 skrev "Olivier Brunel" <j...@jjacky.com>: > > On Fri, 1 Jan 2016 23:03:22 +1000 > Allan McRae <al...@archlinux.org> wrote: > > > On 01/01/16 22:01, Olivier Brunel wrote: > > > On Thu, 31 Dec 2015 14:32:45 +0100 > >

[pacman-dev] Clang warnings

2015-12-31 Thread Rikard Falkeborn
There are some warnings recently introduced when compiling with Clang (with --enable-warningflags) for x86_64. The warnings are related to casting of specific alpm_event-types to alpm_event_t where the required alignment differs between the types. On x86, it shouldn't be a problem, but maybe there

[pacman-dev] [PATCH 3/3] Add pacsort tests with invalid input

2015-12-31 Thread Rikard Falkeborn
Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- test/util/pacsorttest.sh | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/util/pacsorttest.sh b/test/util/pacsorttest.sh index 3b285b8..32ee6ba 100755 --- a/test/util/pacsorttest.sh

[pacman-dev] [PATCH 2/3] pacsort, introduce define for escape_char error code

2015-12-31 Thread Rikard Falkeborn
value check works for both unsigned and signed char. Fixes one warning [-Wtype-limits] for comparissons with -1 when compiling with -funsigned-char. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- src/util/pacsort.c | 11 ++- 1 file changed, 6 insertions(+), 5 del

[pacman-dev] [PATCH 0/3] Char signedness issues

2015-12-31 Thread Rikard Falkeborn
something). After doing this, I realize that the simplest solution probably would be to add -fsigned-char as an argument to the compiler... thoughts? Rikard Falkeborn (3): Make alpm_graph state signedness explicit pacsort, introduce define for escape_char error code Add pacsort tests with invalid

[pacman-dev] [PATCH 1/3] Make alpm_graph state signedness explicit

2015-12-31 Thread Rikard Falkeborn
due to integer promotion rules. Fixes failing test/pacman/tests/sync012.py when compiling with -funsigned-char. Fixes two warnings [-Wtype-limits] for comparissons with -1 when compiling with -funsigned-char. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- lib/libalpm/g

[pacman-dev] [PATCH] libalpm, fix leak if malloc fails in be_sync

2015-11-10 Thread Rikard Falkeborn
--- lib/libalpm/be_sync.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index b09b060..9229622 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -178,6 +178,7 @@ int SYMEXPORT alpm_db_update(int force,

[pacman-dev] [PATCH] Use correct format specifiers

2015-11-10 Thread Rikard Falkeborn
--- lib/libalpm/diskspace.c | 2 +- lib/libalpm/dload.c | 2 +- lib/libalpm/remove.c| 2 +- lib/libalpm/util.c | 2 +- src/pacman/callback.c | 12 ++-- src/pacman/conf.c | 4 ++-- src/pacman/util.c | 4 ++-- 7 files changed, 14 insertions(+), 14

Re: [pacman-dev] [PATCH] package.c, fix incorrect buffersize

2015-11-02 Thread Rikard Falkeborn
Den 2 nov 2015 08:47 skrev "Pierre Neidhardt" : > > Since you caught the issue, Rikard, do you want to do send the patch? > > -- > Pierre Neidhardt Was there a problem with the original patch I sent? If it needs changes or be resubmitted, I wont be able to do it within a

Re: [pacman-dev] [PATCH] package.c, fix incorrect buffersize

2015-11-01 Thread Rikard Falkeborn
Den 1 nov 2015 09:55 skrev "Rikard Falkeborn" <rikard.falkeb...@gmail.com>: > > > Den 1 nov 2015 09:36 skrev "Pierre Neidhardt" <ambre...@gmail.com>: > > > > There is a much simpler fix: > > > > > - static const wchar_t *title

Re: [pacman-dev] [PATCH] package.c, fix incorrect buffersize

2015-11-01 Thread Rikard Falkeborn
Den 1 nov 2015 09:36 skrev "Pierre Neidhardt" : > > There is a much simpler fix: > > > - static const wchar_t *title_suffix = L" :"; > > - static const wchar_t title_suffix[] = L" :"; > > I'll commit the patch right row. > > -- > Pierre Neidhardt > > To communicate is

[pacman-dev] [PATCH] package.c, fix incorrect buffersize

2015-10-31 Thread Rikard Falkeborn
outside of title_suffix. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- src/pacman/package.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pacman/package.c b/src/pacman/package.c index dbd23f5..59f4327 100644 --- a/src/pacman/package.c +++

[pacman-dev] [PATCH] Alpm, check for NULL in free-functions

2015-10-25 Thread Rikard Falkeborn
Also, use FREE() instead of free() in _alpm_backup_free() to set the pointers to NULL. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- lib/libalpm/backup.c | 7 --- lib/libalpm/conflict.c | 2 ++ lib/libalpm/db.c | 1 + lib/libalpm/delta.c| 1 + lib/l

[pacman-dev] [PATCH] add_fileconflict, don't free if CALLOC fail

2015-10-24 Thread Rikard Falkeborn
If CALLOC fails, conflict is NULL, so we shouldn't attempt to free it's members, since that would lead to a NULL pointer dereference. Signed-off-by: Rikard Falkeborn <rikard.falkeb...@gmail.com> --- Is there a reason none of the alpm_*_free() functions check if the input is NULL? That

[pacman-dev] [PATCH 1/3] pacsort: handle failing list_add

2015-08-10 Thread Rikard Falkeborn
Since it can fail, check the return value. If it fails, we need to free the memory of the object we wanted to add to the list. Signed-off-by: Rikard Falkeborn rikard.falkeb...@gmail.com --- src/util/pacsort.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util

[pacman-dev] [PATCH 2/3] pacsort: don't overwrite memory if realloc fails

2015-08-10 Thread Rikard Falkeborn
That makes it impossible to free it later. Signed-off-by: Rikard Falkeborn rikard.falkeb...@gmail.com --- src/util/pacsort.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/util/pacsort.c b/src/util/pacsort.c index 003ec07..3337d97 100644 --- a/src/util

[pacman-dev] [PATCH 3/3] pacsort: clean up if error

2015-08-10 Thread Rikard Falkeborn
* free memory * close open file Signed-off-by: Rikard Falkeborn rikard.falkeb...@gmail.com --- src/util/pacsort.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/util/pacsort.c b/src/util/pacsort.c index 3337d97..e7dc63e 100644 --- a/src/util/pacsort.c +++ b