History log of /netbsd-src/common/lib/libprop/prop_string.c (Results 1 – 18 of 18)
Revision Date Author Comments
# fc5ee90b 17-Nov-2023 thorpej <thorpej@NetBSD.org>

In _prop_string_instantiate(), when we de-dup a non-MUTABLE string, make
sure we free the provided string buffer if NOCOPY is not set. Fixes
a memory leak reported by M. Boerschig.

While we're at i

In _prop_string_instantiate(), when we de-dup a non-MUTABLE string, make
sure we free the provided string buffer if NOCOPY is not set. Fixes
a memory leak reported by M. Boerschig.

While we're at it, also change _prop_string_instantiate() to free the
provided string buffer in the not-NOCOPY case when string object allocation
fails (this was previously handled by _prop_string_instantiate()'s
callers).

PR lib/57699

show more ...


# 3f7675e0 03-Aug-2022 riastradh <riastradh@NetBSD.org>

proplib: Nix trailing whitespace.


# 4ddb8793 07-Sep-2021 andvar <andvar@NetBSD.org>

s/aquire/acquire/ in comments, also one typo fix acqure->acquire.


# d3ce6b60 20-Jun-2020 christos <christos@NetBSD.org>

Fix lint


# a792b843 06-Jun-2020 thorpej <thorpej@NetBSD.org>

Improvements to the problib(3) API:

==> Provide a much more complete set of setters and getters for different
value types in the prop_array_util(3) and prop_dictionary_util(3)
functions.

==

Improvements to the problib(3) API:

==> Provide a much more complete set of setters and getters for different
value types in the prop_array_util(3) and prop_dictionary_util(3)
functions.

==> Overhaul the prop_data(3), prop_number(3), and prop_string(3) APIs
to be easier to use and less awkwardly named, Deprecate the old
awkward names, and produce link-time warnings when they are referenced.

==> Deprecate mutable prop_data(3) and prop_string(3) objects. The old
APIs that support them still exist, but will now produce link-time
warnings when used.

==> When the new prop_string(3) API is used, strings are internally
de-duplicated as a memory footprint optimization.

==> Provide a rich set of bounds-checked gettter functions in and a
corresponding set of convenience setters in the prop_number(3) API.

==> Add a new prop_bool_value(3) function that is equivalent to
prop_bool_true(3), but aligned with the new "value" routines in
prop_data(3), prop_string(3), and prop_number(3).

show more ...


# 8319f966 08-May-2019 thorpej <thorpej@NetBSD.org>

Fix building libprop as a host tool library on platforms that don't have
the Matt Thomas rbtree:

- Include rb.c in libnbcompat, and provide a nbcompat sys/rbtree.h
header.
- Make sure libprop's so

Fix building libprop as a host tool library on platforms that don't have
the Matt Thomas rbtree:

- Include rb.c in libnbcompat, and provide a nbcompat sys/rbtree.h
header.
- Make sure libprop's source file include prop_object_impl.h before
anything else, and pull in nbtool_config.h from there.

Tested by simulating such a host system by renaming the host's
<sys/rbtree.h> out of the way (which reproduced the build failure)
and verifying that the host-tool installboot contained the rb_*
functions in its own .text segment.

show more ...


# a6e338b0 26-Mar-2014 christos <christos@NetBSD.org>

kill sprintf


# 4ce0dc3a 03-Aug-2008 thorpej <thorpej@NetBSD.org>

Fix an issue introduced with the prop_stack change: It's not a good idea to
return a 3-value enum from a function declared to return bool. This broke
the recurse case for prop_object_equals(). Inst

Fix an issue introduced with the prop_stack change: It's not a good idea to
return a 3-value enum from a function declared to return bool. This broke
the recurse case for prop_object_equals(). Instead, declare the object type
equals routine to return a _prop_object_equals_rv_t.

Give the same treatment to the object type free routines: declare them to
return a _prop_object_free_rv_t, and consistently check those return values
againt the enum type.

Tidy up some whitespace while we're here.

show more ...


# ce099b40 28-Apr-2008 martin <martin@NetBSD.org>

Remove clause 3 and 4 from TNF licenses


# 4deb5931 30-Aug-2007 joerg <joerg@NetBSD.org>

Avoid using unbound amount of stack frames in prop_object_equal
by using a dynamic stack as well. Reorder arguments for the internalizer
as the iteration is always present and should go before possib

Avoid using unbound amount of stack frames in prop_object_equal
by using a dynamic stack as well. Reorder arguments for the internalizer
as the iteration is always present and should go before possibly
NULL arguments.

Reviewed by mjf@ and adrianp@

show more ...


# e835604c 16-Aug-2007 joerg <joerg@NetBSD.org>

libprop is currently using a recursive parser. While this is fine for
userland, deeply nested arrays and dictionaries can easily overflow
the kernel stack and thereby force a panic.

Fix the internal

libprop is currently using a recursive parser. While this is fine for
userland, deeply nested arrays and dictionaries can easily overflow
the kernel stack and thereby force a panic.

Fix the internalizer and prop_object_release to use a separate call
stack and alter the dictionary and array handling to not recurse on
the C stack. The default stack has an inline depth of 16 elements,
which should keep the overhead reasonable.

This issue was found by Pavel Cahyna and Jachym Holecek.

Additionally add a limit for prop_object_copyin_ioctl to prevent user
programs from temporary allocating unbound amount of kernel memory.
Allow malloc to fail so that tight loops of userland processes can't
force panics by exhausting the kernel map.

Tested with the sample exploit of Jachym, his test suite and reviewed
by himself (initial patch), Christos Zoulas and Jason Thorpe.

show more ...


# 04377267 16-Aug-2007 thorpej <thorpej@NetBSD.org>

boolean_t -> bool
TRUE -> true
FALSE -> false


# ab821170 18-Oct-2006 martin <martin@NetBSD.org>

Backout size_t casts - lint has been fixed.


# ec465210 18-Oct-2006 martin <martin@NetBSD.org>

Sprinkle a few size_t casts to avoid conversion warnings.


# beabdd9b 22-Aug-2006 thorpej <thorpej@NetBSD.org>

Also guard object accessors against NULL (like we do foreign object types)
so that apps can use this construct safely:

obj = prop_dictionary_get(dict, "value");
if (! prop_number_equals_integer(ob

Also guard object accessors against NULL (like we do foreign object types)
so that apps can use this construct safely:

obj = prop_dictionary_get(dict, "value");
if (! prop_number_equals_integer(obj, 5)) {
...
}

Suggested by Iain Hibbert.

show more ...


# d21620b2 21-Aug-2006 thorpej <thorpej@NetBSD.org>

Several changes to proplib:
- Arrays can now be externalized and internalized in the same way
dictionaries can.
- Add new "externalize to file" and "internalize from file" functions
to make readi

Several changes to proplib:
- Arrays can now be externalized and internalized in the same way
dictionaries can.
- Add new "externalize to file" and "internalize from file" functions
to make reading a property list from a file and writing a property
list to a file more convenient.
- Many assertions in the object implementations are gone. Instead,
calling an accessor for one object type with a different object type
as an argument will return a suitable "invalid" value.
- prop_object_type() now returns a new PROP_TYPE_UNKNOWN value if called
with a NULL object.
- Externalized property lists now contain a reference to the Apple XML
plist DTD.
- Add a new prop_ingest(3) facility, which provides a convenient way to
translate a dictionary into an arbitrary binary representation.

show more ...


# 3e69f1b2 18-May-2006 thorpej <thorpej@NetBSD.org>

- Add prop_array_equals(), prop_dictionary_equals(), and
prop_dictionary_keysym_equals(), and prop_object_equals() functions.
- Use realloc() where it makes sense. There will be more changes in th

- Add prop_array_equals(), prop_dictionary_equals(), and
prop_dictionary_keysym_equals(), and prop_object_equals() functions.
- Use realloc() where it makes sense. There will be more changes in this
area.
- Add a _prop_object_type structure that is used internally to keep
information about the object types. Decreases the footprint of the
objects slightly by replacing several pointers with just one.

show more ...


# 774eb1a3 27-Apr-2006 thorpej <thorpej@NetBSD.org>

Initial commit of proplib, a library for manipulating property lists and
converting to/from an XML external representation (based on Apple XML
property lists). Works in the kernel and user space.