core: avoid NULL derefrence in grub_divmod64s

It can be called with NULL for third argument.  grub_divmod32* for
now are called only from within wrappers, so skip check.

Reported-By: Michael Zimmermann <sigmaepsilon92@gmail.com>
This commit is contained in:
Andrei Borzenkov 2015-04-06 19:25:02 +03:00
parent 12bf557039
commit f11db3c7fc
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ grub_divmod64s (grub_int64_t n,
q = -q;
}
/* Now: n = d * q + r */
*ro = r;
if (ro)
*ro = r;
return q;
}