|
212c8586
|
2023-03-17T19:32:58
|
|
Avoid undefined behaviour with the ctype(3) functions.
fix https://github.com/pkgconf/pkgconf/issues/291
As defined in the C standard:
In all cases the argument is an int, the value of which shall
be representable as an unsigned char or shall equal the value
of the macro EOF. If the argument has any other value, the
behavior is undefined.
This is because they're designed to work with the int values returned
by getc or fgetc; they need extra work to handle a char value.
If EOF is -1 (as it almost always is), with 8-bit bytes, the allowed
inputs to the ctype(3) functions are:
{-1, 0, 1, 2, 3, ..., 255}.
However, on platforms where char is signed, such as x86 with the
usual ABI, code like
char *ptr = ...;
... isspace(*ptr) ...
may pass in values in the range:
{-128, -127, -126, ..., -2, -1, 0, 1, ..., 127}.
This has two problems:
1. Inputs in the set {-128, -127, -126, ..., -2} are forbidden.
2. The non-EOF byte 0xff is conflated with the value EOF = -1, so
even though the input is not forbidden, it may give the wrong
answer.
Casting char to unsigned int first before passing the result to
ctype(3) doesn't help: inputs like -128 are unchanged by this cast,
because (on a two's-complement machine with 32-bit int and unsigned
int), converting the signed char with integer value -128 to unsigned
int gives integer value 2^32 - 128 = 0xffffff80, which is out of
range, and which is converted in int back to -128, which is also out
of range.
It is necessary to cast char inputs to unsigned char first; you can
then cast to unsigned int if you like but there's no need because the
functions will always convert the argument to int by definition. So
the above fragment needs to be:
char *ptr = ...;
... isspace((unsigned char)*ptr) ...
This patch changes unsigned int casts to unsigned char casts, and
adds unsigned char casts where they are missing.
|
|
d9e507cc
|
2023-01-21T21:31:38
|
|
pkg: do not do serial checks for flattened solutions, as they are already flattened
|
|
e2a12fd4
|
2023-01-21T20:39:53
|
|
main: reset solver when solving for library groups
|
|
08db74c4
|
2022-10-12T21:43:52
|
|
pkg: make pkgconf_compare_version consistent
The code taken from rpmvercmp in pkg-config returns -1 if a is less than
b, 0 if a is equal to b, and 1 if a is greater than b. This matches the
expectations of the comparison operators that use this function.
However, the tilde handling, the NULL handling, and the docstring all do
the opposite.
This fixes the tilde handling, the NULL handling, and the docstring to
match the behavior of the rpmvercmp code and the expectations of the
comparison operators.
|
|
ced9bee6
|
2022-08-16T18:51:11
|
|
pkg: remove dead store in pkgconf_compare_version
|
|
696124b6
|
2022-08-12T12:36:21
|
|
pkg: add support for parsing the URL from pc files
|
|
aa99ddf7
|
2022-08-11T15:52:33
|
|
pkg: add Copyright and Maintainer fields
These are helpful pieces of information for BOM documents
generated by pkgconf.
|
|
28b5d57b
|
2022-08-08T10:25:24
|
|
pkg: free SPDX license tags when a package is destroyed
|
|
7e9aa7e1
|
2022-08-08T09:56:28
|
|
pkg: do not break cycles across dependency lists
|
|
69f630aa
|
2022-08-08T09:34:45
|
|
pkg: only advance serial if we are actually traversing from a root
|
|
0e05308f
|
2022-08-07T04:35:29
|
|
pkg: add SPDX license assertion to pkgconf builtin
|
|
1389aa05
|
2022-08-07T04:21:22
|
|
pkg: add pkgconf_pkg_t.license field
The pkgconf_pkg_t.license field maps to the new License keyword, and
should be an SPDX license expression.
|
|
7edfdbff
|
2022-08-07T01:29:21
|
|
pkg: upgrade circular reference trace to a warning
|
|
662668d0
|
2022-08-07T01:09:07
|
|
pkg: add trace log when breaking a circular reference
|
|
1cfa2d1e
|
2022-08-04T15:16:44
|
|
pkg: prevent circular ownership
Otherwise in a case where A references B, and B references A, A and B
will have mutual ownership of each other and prevent each other from
being free'd.
|
|
49342057
|
2022-08-04T11:50:50
|
|
pkg: add name of pkg being refed/unrefed to debug outpu
|
|
a391f9b6
|
2022-08-03T16:32:35
|
|
pkg: use goto cleanup idiom
|
|
4a1119aa
|
2022-08-03T15:43:04
|
|
dependency: Fix reference counting of dependency_addraw
We only want a reference to be added for the value inserted into the
list, not the one returned. The returned one is unowned until it reaches
the public dependency_add function, which returns an owned pointer
instead. This makes things semantically more correct.
Unfortunately, this means in a few cases we have to write some ugly
code like:
```c
pkgconf_dependency_t *dep = pkgcond_dependency_add("args");
pkgconf_dependency_unref(dep->owner, dep);
```
|
|
f8aefea7
|
2022-07-26T17:13:15
|
|
pkg: add flags argument to pkgconf_pkg_new_from_file
|
|
297e18f2
|
2022-07-26T17:08:48
|
|
tuple: add flags parameter to pkgconf_tuple_parse
|
|
b0802cb3
|
2022-06-26T19:41:31
|
|
Revert "pkgconf_pkg_parser_value_set(): fix code-path ordering bug."
This reverts commit 13fe4c8c589be99b12db62b053c38124afecf2d7.
|
|
a61193c7
|
2022-06-26T19:16:00
|
|
pkg: fix sysroot_dir logic for github 213
|
|
5817e884
|
2022-06-26T07:22:56
|
|
pkg: track the number of hits a package has gotten while solving for dependencies
|
|
6ae17bd0
|
2022-06-26T06:05:40
|
|
pkg: split pkgconf_pkg_traverse into a serial-modifying version
|
|
2b82a4f6
|
2021-10-07T00:23:35
|
|
use a serial instead of PKGCONF_PKG_PROPF_SEEN
|
|
c547edd0
|
2021-10-06T11:52:18
|
|
deconst the client on pkgconf_dependency_add()
|
|
ceece2c1
|
2021-07-24T19:47:33
|
|
pkg: fix up comment about issue #213 workaround
|
|
ed86f2dd
|
2021-06-23T14:09:05
|
|
Don't prepend sysroot_dir if pkg-config file lies outside of sysroot_dir
|
|
13fe4c8c
|
2021-06-13T18:38:18
|
|
pkgconf_pkg_parser_value_set(): fix code-path ordering bug.
Prior to this commit, the code path responsible for prefix redefinition
(motivated by --define-prefix or otherwise) was visited more than
once, specifically since the check ignored pkg->owner->prefix_varname.
|
|
4f73f6a1
|
2021-03-20T11:01:14
|
|
Rework path handling on native Windows
The current approach was to parse the .pc and, detect the prefix, throw
everything together and at the end replace all \ with / to not produce invalid
escape sequences.
This has the problem that escaping in .pc files is ignored and no longer
possible. Also in case the prefix path has a space in it the result would be
invalid because of missing escaping.
This changes the following things:
* We no longer normalize values at the end. Instead we assume .pc files use "/"
as a directory separator or "\\", same format as under Unix. "\" alone no
longer works. This shouldn't be a problem since most build tools produce .pc
files with "/" like meson, cmake, autotools.
* When injecting the prefix at runtime we convert the prefix to use "/" and
escape spaces so that in combination with the .pc content the result is a
valid escaped path value again.
This patch has been used in MSYS2 for some months now.
See #212
|
|
ab404bc2
|
2021-02-03T06:54:52
|
|
Fix #209
This commit fixes #209 by applying the suggestion from
https://github.com/pkgconf/pkgconf/issues/209#issuecomment-771609136.
|
|
869f2a84
|
2020-11-28T16:01:16
|
|
pkgconf_pkg_parser_version_func: fix whitespace detection
In case the version string has no whitespace then strcspn() returns
strlen() of the input, so whitespace is only found if len != strlen.
This fixes invalid warnings when parsing version fields.
|
|
f818a69b
|
2020-06-03T21:42:25
|
|
libpkgconf: pkg: fix out ouf boundary access
If a file with a matching "uninstalled" name exists but cannot be
parsed, an invalid memory area is accessed.
How to reproduce:
$ touch poc-uninstalled.pc
$ PKG_CONFIG_PATH=. pkgconf poc
|
|
c613eb5c
|
2020-05-26T13:41:39
|
|
libpkgconf: pkg: use a second pointer for demunging windows paths
|
|
e70b536e
|
2020-05-26T11:01:46
|
|
libpkgconf: pkg: when generating a search path, use the correct path separator
Before, this could result in generated paths like C:\foo\pkgconfig/bar.pc on Windows.
|
|
0253fddc
|
2020-05-26T07:41:16
|
|
libpkgconf: pkg: fix computation of pkgconf_pkg_t.id on Windows.
Windows allows both \ and / as valid path characters. A computed path
such as C:\development\libfoo\pkgconfig/foo.pc will result in a computed
pkgconf_pkg_t.id of "pkgconfig/foo".
Accordingly, correct the path normalization for checking for / after
the \ path has been dealt with in all cases.
|
|
011db1bb
|
2020-04-26T17:28:03
|
|
Do not complain about malformed whitespace from \n on Version line
Every version line has a newline at the end; the malformed whitespace checker
should just check for trailing spaces and tabs.
Resolves https://todo.sr.ht/~kaniini/pkgconf/15
|
|
382a89c1
|
2020-05-24T14:18:16
|
|
pkg: pkgconf_compare_version(): do not return levenshtein distance in strcmp() case
|
|
c10f6999
|
2019-07-12T06:35:48
|
|
libpkgconf: pkg: generate diagnostic for and trim malformed versions
|
|
db9c1e96
|
2019-06-07T19:19:28
|
|
fix the order of header includes
config.h should be included before stdinc.h, otherwise large file
support is not enabled.
Downstream bug: https://bugs.gentoo.org/687548
|
|
6854265f
|
2019-01-14T13:48:23
|
|
libpkgconf: pkg: use pkgconf_fragment_copy_list() to clean up cflags gathering logic (closes #20)
|
|
0ae52182
|
2019-01-14T13:11:59
|
|
libpkgconf: pkg: clean up pkgconf_parser interactions (closes #13)
|
|
2c059710
|
2018-09-17T15:20:28
|
|
Canonicalize paths before using them
This fixes a problem where on Windows the prefix would
not match if the prefix is generated with backslashes
and the rest of the variables use normal slashes
|
|
9f17da92
|
2018-09-17T15:20:00
|
|
On Windows the path prefix should be checked caseless
|
|
6f05fec4
|
2018-06-16T16:35:44
|
|
pkg: give a correctly sized vtable to the parser
|
|
1244f8f8
|
2018-05-09T21:21:39
|
|
libpkgconf: refactor out the rfc822 message parser so that the cross-personality code can share it
|
|
f702967d
|
2018-05-09T19:56:30
|
|
libpkgconf: pkg: refactor pkgconf_pkg_new_from_file to prepare to factor out the rfc822 parser
|
|
0f17a4f3
|
2018-05-09T19:33:12
|
|
libpkgconf: pkg: mark owning client earlier, to allow for refactoring out the rfc822 parser
|
|
6b0e346c
|
2018-05-09T17:07:26
|
|
libpkgconf: refactor building the dir lists into separate concerns
|
|
f36ccc1d
|
2018-04-03T12:46:35
|
|
libpkgconf: add support for Haiku
client: use BELIBRARIES
On Haiku, BELIBRARIES is the equivalent to LIBRARY_PATH on many other
systems, while LIBRARY_PATH is instead the LD_LIBRARY_PATH of Haiku.
pkg: bootstrap package search paths with Haiku's find_paths
This commit adds build_default_pkgconfig_path. The function appends
to the list given the default pkgconfig paths, and will supersede
get_default_pkgconfig_path
|
|
7e9ed692
|
2018-03-18T18:04:02
|
|
libpkgconf: pkg: skip over -I cflags from Requires.internal nodes when building a cflags list
|
|
f03ec3ff
|
2018-03-18T15:46:53
|
|
libpkgconf: add support for proposed Requires.internal extension
|
|
a50bf726
|
2018-03-08T05:16:18
|
|
Fix incorrect comment (#178)
|
|
60c05f56
|
2018-03-08T05:00:22
|
|
Improve prefix rewriting on Windows (#177)
* cli: Default to rewriting prefix on Windows
This matches `pkg-config` behavior
* libpkgconf: Rewrite the prefix of all variables
|
|
0d523391
|
2018-02-08T14:25:47
|
|
libpkgconf: pkg: ensure the dependency node has a solution associated with it
Sometimes this did not happen, e.g. when using providers as the solution (ref #172).
|
|
4a09efe0
|
2018-01-05T11:38:21
|
|
libpkgconf: pkg: fix harmless gcc7 compiler warning
|
|
a42f265c
|
2017-12-21T02:18:50
|
|
libpkgconf: pkg: include system libdir and includedir search paths as variables in builtin packages (closes #165)
|
|
e0bf4009
|
2017-12-12T00:21:21
|
|
libpkgconf: pkg: rename pkgconf_pkg_t.requires to pkgconf_pkg_t.required (closes #154)
C++20 makes requires a keyword, so we need to not use it in headers.
|
|
f7406afc
|
2017-12-05T18:04:42
|
|
libpkgconf: pkg: do not mention PKG_CONFIG_SKIP_CONFLICTS env var when simplified errors are requested (closes #134)
|
|
74d58d1b
|
2017-12-05T17:34:01
|
|
libpkgconf: pkg: cache solutions for already solved dependency graph nodes
in almost all cases, we partially solve the dependency graph multiple times, which
just wastes resources. if we record the solution to a given dependency node, further
iterations can make use of the previous solution without having to solve it again.
this is safe because all provides entries (including virtuals) are knowable prior to
solving the dependency graph the first time.
a nice side effect of this is that all packages are preloaded when querying
information about them (--cflags and related commands).
|
|
44b4b126
|
2017-12-05T17:32:00
|
|
libpkgconf: pkg: record which pkgconf_client_t owns each pkgconf_pkg_t object
|
|
4c0cc292
|
2017-12-05T17:24:57
|
|
libpkgconf: pkg: add refcount debugging
|
|
4589274c
|
2017-10-16T12:56:19
|
|
libpkgconf: start to remove PKGCONF_BUFSIZE allocations from the stack. (closes #149)
Patch by Karen Arutyunov.
|
|
420c62e1
|
2017-09-19T21:58:54
|
|
libpkgconf: pkg: refactor parser harness to allow providing warnings, provide warning for improper fragment list
|
|
e9fd43ca
|
2017-09-17T23:38:25
|
|
libpkgconf: clean up header includes (closes #137)
|
|
f808300a
|
2017-09-13T14:56:10
|
|
libpkgconf: pkg: some elements of virtual packages should be freed as they have heap-allocated portions (closes #132)
|
|
9b55fc3c
|
2017-09-13T14:41:00
|
|
libpkgconf: cache: refactor the way package objects are marked as cached to avoid memory leaks (#133)
|
|
b7839f6b
|
2017-09-08T20:06:52
|
|
libpkgconf: pkg: pkgconf_pkg_scan_dir: remove unnecessary static declaration of filebuf
|
|
2681c29e
|
2017-09-08T20:04:49
|
|
libpkgconf: pkg: determine_prefix: use caller-provided buffer for reentrancy
|
|
adae7044
|
2017-09-08T20:01:34
|
|
libpkgconf: pkg: get_default_pkgconfig_path: use caller-supplied buffer for reentrancy
|
|
615bab3d
|
2017-09-08T19:48:31
|
|
libpkgconf: pkg: pkgconf_pkg_report_graph_error(): move already_sent_notice to pkgconf_client_t
|
|
b0ef708e
|
2017-09-08T19:23:04
|
|
libpkgconf: pkg: pkg_get_parent_dir(): use caller-supplied buffer instead of a static buffer to make reentrant
|
|
47ce9765
|
2017-09-08T18:44:28
|
|
libpkgconf: define SIZE_FMT_SPECIFIER on POSIX and Windows platforms and use it in place of %zu
The MSVCRT runtime as used on Windows does not support %zu, but instead recommends %Iu. As we want
to remain portable to other runtimes, even on Windows, we do not use %Iu, but instead expand it logically
to either %lu or %llu depending on if it's _WIN32 or _WIN64 headers.
On POSIX, we assume C99 support is available and always use %zu, as pkgconf has never supported anything
earlier than C99 officially.
Closes #125.
|
|
864b14e5
|
2017-06-16T21:06:01
|
|
Merge branch 'cmakeify' of github.com:dankegel/pkgconf
|
|
03f78410
|
2017-06-16T15:27:23
|
|
libpkgconf: pkg: windows can use either \ or / as directory separators
ref #118
|
|
d45e8501
|
2017-06-16T13:03:51
|
|
Revert "pkg: use pkgconf_pkg_t.realname instead of pkgconf_pkg_t.id for injecting the default provides entry"
This reverts commit 0c22b4d8a1596e1d5b261041c36b474d05783373.
|
|
0c22b4d8
|
2017-06-16T11:49:26
|
|
pkg: use pkgconf_pkg_t.realname instead of pkgconf_pkg_t.id for injecting the default provides entry
This issue was noticed while porting pkgconf to Windows.
ref #118
|
|
794aa501
|
2017-06-05T20:54:57
|
|
Tidy up a bit.
|
|
4d7b4d7c
|
2017-06-04T19:19:55
|
|
Minimal tweaks to compile with Visual C 2015
|
|
d280060e
|
2017-05-19T23:37:57
|
|
libpkgconf: pkg: add additional validation rules in post-parse phase
|
|
0262b825
|
2017-05-19T23:33:49
|
|
libpkgconf: pkgconf_pkg_find(): correctly handle failure from pkgconf_pkg_new_from_file()
|
|
cf3c50ca
|
2017-05-19T23:21:58
|
|
libpkgconf: pkg: pkgconf_try_specific_path() and pkgconf_pkg_new_from_file() require a mutable client to release resources when encountering invalid packages
|
|
acac1f8e
|
2017-03-24T00:59:53
|
|
libpkgconf: pkg: show iteration depth when traversing
|
|
81011ba5
|
2017-02-27T09:54:02
|
|
main: implement --short-errors (#115)
|
|
794443a9
|
2017-02-25T16:04:55
|
|
dependency: break API to add tracepoints to dependency list building
|
|
e0c9569f
|
2017-02-25T15:53:50
|
|
fragment: add tracepoints
|
|
b0c36cd1
|
2017-02-04T20:35:49
|
|
libpkgconf: pkg: add some trace points
|
|
820ad83e
|
2017-02-04T19:03:33
|
|
libpkgconf: pkg: add variable whitespace warnings back, using pkgconf_warn().
|
|
1aa1a433
|
2017-01-26T13:38:57
|
|
Revert "libpkgconf: pkg: warn when encountering trailing whitespace"
This reverts commit 2fa4fd09d02905e07397c2617bb1be735f6cd96b.
|
|
2fa4fd09
|
2017-01-26T13:32:07
|
|
libpkgconf: pkg: warn when encountering trailing whitespace
|
|
ef1503b7
|
2017-01-26T13:10:52
|
|
libpkgconf: strip trailing whitespace
|
|
e87595b3
|
2017-01-23T12:42:13
|
|
libpkgconf: use a better check instead of stat() for pkg-config file iteration, avoiding a TOCTOU race condition identified by coverity
|
|
0927ecf1
|
2017-01-22T23:29:59
|
|
Revert "Actually fix the regression introduced in 7b39c38"
This reverts commit 5e5c418837b569196cc17eb999b3c11a9cc0099d.
|
|
0c01a812
|
2017-01-22T23:26:01
|
|
libpkgconf: split virtual/static package state (this is API/ABI safe, static packages are always treated as virtual when it comes to mutation)
|
|
9ece7cd4
|
2017-01-22T23:09:38
|
|
libpkgconf: move sys/stat.h inclusion out of stdinc.h to the only other consumer of sys/stat.h
|
|
e5f3dac6
|
2017-01-22T23:07:39
|
|
libpkgconf: pkg: handle error value from stat(2).
|
|
5db87c96
|
2017-01-22T20:31:34
|
|
remove dead assignments (#109)
* remove dead assignments
None of them are used.
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
* The address of an object "&pkgconf_pkg_provides_vermatch_rules[pkgdep->compare]" is never null
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
* Overrunning array pkgconf_pkg_comparator_names at element index 7
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
|
|
5e5c4188
|
2017-01-22T11:25:05
|
|
Actually fix the regression introduced in 7b39c38
|
|
17be554a
|
2017-01-22T11:23:24
|
|
Revert "Fix regression introduced in 7b39c38"
This reverts commit 7d89f659ffa45d381c3c4ee03c55f74635042829.
|
|
7d89f659
|
2017-01-22T10:44:09
|
|
Fix regression introduced in 7b39c38
now pkgconf --variable=pc_path pkg-config works
|