]> git.ipfire.org Git - thirdparty/util-linux.git/commit - libmount/src/fs.c
libmount: fix mount.nfs segfault, rely on assert() rather than on nonnull
authorKarel Zak <kzak@redhat.com>
Fri, 12 Apr 2013 10:35:34 +0000 (12:35 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 12 Apr 2013 10:35:34 +0000 (12:35 +0200)
commit4569bbeab783632c81ee14793da84b3e29444543
treeb165e3f418600bef11edbd962bc7f76b9d95113f
parente38f35d34e01d7db947216c2fed3d4e914b4ce7c
libmount: fix mount.nfs segfault, rely on assert() rather than on nonnull

We use
   mnt_optstr_append_option(&o, mnt_fs_get_vfs_options(fs), NULL);

in mount.nfs, unfortunately mnt_optstr_append_option() has been marked
ass nonnull(1, 2). That's wrong because append and prepend should
robust enough to accept NULL as option name.

The patch also removes almost all __attribute__((nonnull). It seems
better to rely on assert() to have usable feedback. In many cases
(nonnull) is premature optimization for the library. This attribute
makes sense for things like strlen() or so...

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=948274
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/fs.c
libmount/src/libmount.h.in
libmount/src/lock.c
libmount/src/mountP.h
libmount/src/optstr.c
libmount/src/tab_parse.c
libmount/src/tab_update.c
libmount/src/utils.c
libmount/src/version.c