Просмотр исходного кода

libdpkg: Initialize ps->pkg and ps->pkgbin to NULL in parse_open()

This guarantees the parsedb_state variable is in a sane state after
the parse_open() call.
Guillem Jover лет назад: 15
Родитель
Сommit
fb18783ce2
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      lib/dpkg/parse.c

+ 2 - 0
lib/dpkg/parse.c

@@ -315,6 +315,8 @@ parse_open(struct parsedb_state *ps, const char *filename,
   ps->filename = filename;
   ps->flags = flags;
   ps->lno = 0;
+  ps->pkg = NULL;
+  ps->pkgbin = NULL;
 
   fd = open(filename, O_RDONLY);
   if (fd == -1)