LCOV - code coverage report
Current view: top level - fuzz - fuzz-env-file.c (source / functions) Hit Total Coverage
Test: systemd_full.info Lines: 0 13 0.0 %
Date: 2019-08-23 13:36:53 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 10 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: LGPL-2.1+ */
       2                 :            : 
       3                 :            : #include <stdio.h>
       4                 :            : 
       5                 :            : #include "alloc-util.h"
       6                 :            : #include "env-file.h"
       7                 :            : #include "fileio.h"
       8                 :            : #include "fd-util.h"
       9                 :            : #include "fuzz.h"
      10                 :            : #include "strv.h"
      11                 :            : 
      12                 :          0 : int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
      13                 :          0 :         _cleanup_fclose_ FILE *f = NULL;
      14                 :          0 :         _cleanup_strv_free_ char **rl = NULL, **rlp =  NULL;
      15                 :            : 
      16   [ #  #  #  # ]:          0 :         if (size == 0 || size > 65535)
      17                 :          0 :                 return 0;
      18                 :            : 
      19                 :          0 :         f = fmemopen_unlocked((char*) data, size, "re");
      20         [ #  # ]:          0 :         assert_se(f);
      21                 :            : 
      22                 :            :         /* We don't want to fill the logs with messages about parse errors.
      23                 :            :          * Disable most logging if not running standalone */
      24         [ #  # ]:          0 :         if (!getenv("SYSTEMD_LOG_LEVEL"))
      25                 :          0 :                 log_set_max_level(LOG_CRIT);
      26                 :            : 
      27                 :          0 :         (void) load_env_file(f, NULL, &rl);
      28         [ #  # ]:          0 :         assert_se(fseek(f, 0, SEEK_SET) == 0);
      29                 :          0 :         (void) load_env_file_pairs(f, NULL, &rlp);
      30                 :            : 
      31                 :          0 :         return 0;
      32                 :            : }

Generated by: LCOV version 1.14