Browse Source

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 years ago
parent
commit
fb18783ce2
1 changed files with 2 additions and 0 deletions
  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)