Commit Graph

9 Commits

Author SHA1 Message Date
Gaël PORTAY e368d0ad5d lib/mangle: check for the NULL string argument
This patch prevents to call the function strlen() with a NULL string
argument that leads to a segmentation fault.

Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
2020-03-20 16:28:49 -04:00
Karel Zak 78c66fc61d lib/mangle: const quialifier cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 15:31:42 +02:00
Karel Zak 61b9233995 lib/mangle: return size of the decoded buffer
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-11-01 15:33:04 +01:00
Karel Zak 95387b6696 lib/mangle: cleanup, add unhexmangle
* use strchr() rather than for()
 * small refactoring in mangle code
 * add un-hex-mangle

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:17:44 +02:00
Karel Zak 5ac6a13327 libmount: cleanup mangle() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03 12:28:47 +01:00
Karel Zak dd36965211 libmount: use better format for utab, improve bind mounts
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03 12:28:46 +01:00
Karel Zak 8f3f6383a5 libmount: rewrite mountinfo/fstab parsers to use sscanf()
The old solution (without scanf()) was based on old code from
mount(8). It seems that the modern libc is able to provide all
necessary functionality by sscanf() and %ms directive.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03 12:28:43 +01:00
Karel Zak 3c5e4ef888 libmount: add unmangle/mangle() functions to API
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03 12:28:40 +01:00
Karel Zak 21169393e3 lib: add mangle.c for mtab (fstab or swaps) encoding
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-10 23:54:11 +01:00