spvbin-helpers: Properly handle parsing strings with no destination.
[pspp] / src / output / spv / spvbin-helpers.c
index 138e213957b9b7cfe5819a51bfb8d92f711bf08a..53ea5d4ac4758de4343a7c79d3890d830c0077a2 100644 (file)
@@ -180,7 +180,8 @@ spvbin_parse_string__ (struct spvbin_input *input,
                        uint32_t (*raw_to_native32) (uint32_t),
                        char **p)
 {
-  *p = NULL;
+  if (p)
+    *p = NULL;
 
   uint32_t length;
   if (input->size - input->ofs < sizeof length)