Age | Commit message (Collapse) | Author | Files | Lines |
|
The --default-symver linker option attaches a default version definition
(the SONAME) to every exported symbol. It is supported since at least
GNU binutils 2.22 in 2011 (older versions not tested).
With this version definition, newly-linked binaries that depend on the
jansson shared library will refer to its symbols in a versioned form,
preventing their references from being resolved to a symbol of the same
name exported by json-c or json-glib if those libraries appear in
dependency search order before jansson, which will usually result in
a crash. This is necessary because ELF symbol resolution normally uses
a single flat namespace, not a tree like Windows symbol resolution.
At least one symbol (json_object_iter_next()) is exported by all three
JSON libraries.
Linking with -Bsymbolic is not enough to have this effect in all cases,
because -Bsymbolic only affects symbol lookup within a shared object,
for example when parse_json() calls json_decref(). It does not affect
calls from external code into jansson, unless jansson was statically
linked into the external caller.
This change will also not prevent code that depends on json-c or
json-glib from finding jansson's symbols and crashing; to prevent
that, a corresponding change in json-c or json-glib would be needed.
Adding a symbol-version is a backwards-compatible change, but once
added, removing or changing the symbol-version would be an incompatible
change that requires a SONAME bump.
Resolves: https://github.com/akheron/jansson/issues/523
(when combined with an equivalent change to json-c).
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
|
|
|
|
|
"x$LIB_FUZZING_ENGINE" is not the correct filename to test for - remove
the x!
|
|
|
|
|
|
Fixes #430
|
|
It was discovered fairly recently that JSON parsing libraries use
common pattern to name their exported symbols (they all use
json_ prefix). So eventually it happens that two symbols from two
different libraries have the same name. This will lead to cryptic
crashes (see [1] and [2]). Linking with -Bsymbolic-functions
prevents this.
1: https://gitlab.gnome.org/GNOME/json-glib/issues/33
2: https://groups.google.com/forum/#!topic/jansson-users/7Efx-RI45IU
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
Recent versions of gcc have introduced compiler warnings for string
operations that could be truncated. This caused problems with -Werror.
src/error.c used strncpy to write "..." to a string, but skipped writing
the NUL terminator. Switch this to use memcpy. src/load.c produced
warnings from snprintf writing error strings that could be truncated.
Added code to autotools build to detect `-Wno-format-truncation', add it
to AM_CFLAGS if supported.
|
|
|
|
This makes use of __atomic or __sync builtin compiler functions to make
json_decref and json_incref thread-safe.
Issue #387
|
|
|
|
|
|
|
|
|
|
Fixes #213.
|
|
|
|
Just define it at configure time, it's automatically set in all makefiles.
Fixes #203.
|
|
For some reason, Automake doesn't search the current directory correctly
when searching for helper scripts.
Fixes #182.
|
|
|
|
Fixes #177.
|
|
|
|
|
|
|
|
|
|
Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing
and testing.
|
|
This is because it's really easy to get a name collission if compiling
Jansson as a subproject in a larger CMake project. If one project includes
several subprojects each having their own config.h, this will cause the
wrong file to be loaded.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The decimal point '.' is changed to locale's decimal point
before/after JSON conversion to make C standard library's
locale-specific string conversion functions work correctly.
All the tests now call setlocale(LC_ALL, "") on startup to use the
locale set in the environment.
Fixes GH-32.
|
|
|
|
|
|
Conflicts:
doc/conf.py
src/jansson.h
|
|
|
|
|
|
Conflicts:
doc/apiref.rst
src/jansson_private.h
|
|
|
|
json_int_t is typedef'd to long long if it's supported, or long
otherwise. There's also some supporting things, like the
JSON_INTEGER_FORMAT macro that expands to the printf() conversion
specifier that corresponds to json_int_t's actual type.
This is a backwards incompatible change.
|
|
|
|
This way, more site configuration can be more easily added later.
|
|
|
|
|
|
Conflicts:
CHANGES
configure.ac
doc/conf.py
|