diff options
author | Alexander Motin <mav@FreeBSD.org> | 2017-01-07 09:33:11 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2017-01-07 09:33:11 +0000 |
commit | 26b1288f5ad5b549bd29939751bc11f1fb77783b (patch) | |
tree | 45b4dd877d222c384385bc2f278888d715c1abca /sbin/camcontrol/modeedit.c | |
parent | 3bc6f09c7b773fd8c267879531d160d6780ccb46 (diff) |
Notes
Diffstat (limited to 'sbin/camcontrol/modeedit.c')
-rw-r--r-- | sbin/camcontrol/modeedit.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/camcontrol/modeedit.c b/sbin/camcontrol/modeedit.c index 8262c3ca5a45b..c98e0c58ef01a 100644 --- a/sbin/camcontrol/modeedit.c +++ b/sbin/camcontrol/modeedit.c @@ -193,7 +193,14 @@ editentry_save(void *hook __unused, char *name) struct editentry *src; /* Entry value to save. */ src = editentry_lookup(name); - assert(src != NULL); + if (src == 0) { + /* + * This happens if field does not fit into read page size. + * It also means that this field won't be written, so the + * returned value does not really matter. + */ + return (0); + } switch (src->type) { case 'i': /* Byte-sized integral type. */ |