]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fstab-generator: add missing assertions
authorMike Yuan <me@yhndnzj.com>
Tue, 23 Jan 2024 14:40:17 +0000 (22:40 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 25 Jan 2024 17:06:41 +0000 (01:06 +0800)
src/fstab-generator/fstab-generator.c

index 4941e16b68997b4a33158517bfcce55738a9c583..c57ecad9c3d110df7b4cb9b0bd71ab34ffa792ea 100644 (file)
@@ -191,6 +191,8 @@ static int mount_array_add_swap(bool for_initrd, const char *str) {
 static int write_options(FILE *f, const char *options) {
         _cleanup_free_ char *o = NULL;
 
+        assert(f);
+
         if (isempty(options))
                 return 0;
 
@@ -208,6 +210,9 @@ static int write_options(FILE *f, const char *options) {
 static int write_what(FILE *f, const char *what) {
         _cleanup_free_ char *w = NULL;
 
+        assert(f);
+        assert(what);
+
         w = specifier_escape(what);
         if (!w)
                 return log_oom();