summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/optutils.h3
-rw-r--r--include/pt-mbr.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/include/optutils.h b/include/optutils.h
index 99ad7e4b4..325cb8812 100644
--- a/include/optutils.h
+++ b/include/optutils.h
@@ -1,6 +1,8 @@
#ifndef UTIL_LINUX_OPTUTILS_H
#define UTIL_LINUX_OPTUTILS_H
+#include <assert.h>
+
#include "c.h"
#include "nls.h"
@@ -8,6 +10,7 @@ static inline const char *option_to_longopt(int c, const struct option *opts)
{
const struct option *o;
+ assert(!(opts == NULL));
for (o = opts; o->name; o++)
if (o->val == c)
return o->name;
diff --git a/include/pt-mbr.h b/include/pt-mbr.h
index 90be95b1f..177cc7474 100644
--- a/include/pt-mbr.h
+++ b/include/pt-mbr.h
@@ -1,6 +1,8 @@
#ifndef UTIL_LINUX_PT_MBR_H
#define UTIL_LINUX_PT_MBR_H
+#include <assert.h>
+
struct dos_partition {
unsigned char boot_ind; /* 0x80 - active */
unsigned char bh, bs, bc; /* begin CHS */
@@ -27,6 +29,7 @@ static inline unsigned int __dos_assemble_4le(const unsigned char *p)
static inline void __dos_store_4le(unsigned char *p, unsigned int val)
{
+ assert(!(p == NULL));
p[0] = (val & 0xff);
p[1] = ((val >> 8) & 0xff);
p[2] = ((val >> 16) & 0xff);