this interface permits a null pointer for where to store the old
itimerval being replaced. an early version of the time32 compat shim
code had corresponding bugs for lots of functions; apparently
setitimer was overlooked when fixing them.
* timer setting, so we can't fail on out-of-range old value.
* Since these are relative times, values large enough to overflow
* don't make sense anyway. */
* timer setting, so we can't fail on out-of-range old value.
* Since these are relative times, values large enough to overflow
* don't make sense anyway. */
- old32->it_interval.tv_sec = old.it_interval.tv_sec;
- old32->it_interval.tv_usec = old.it_interval.tv_usec;
- old32->it_value.tv_sec = old.it_value.tv_sec;
- old32->it_value.tv_usec = old.it_value.tv_usec;
+ if (old32) {
+ old32->it_interval.tv_sec = old.it_interval.tv_sec;
+ old32->it_interval.tv_usec = old.it_interval.tv_usec;
+ old32->it_value.tv_sec = old.it_value.tv_sec;
+ old32->it_value.tv_usec = old.it_value.tv_usec;
+ }