summaryrefslogtreecommitdiff
path: root/system/musl/time32-setitimer-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/musl/time32-setitimer-fix.patch')
-rw-r--r--system/musl/time32-setitimer-fix.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/system/musl/time32-setitimer-fix.patch b/system/musl/time32-setitimer-fix.patch
new file mode 100644
index 000000000..d6ae191bd
--- /dev/null
+++ b/system/musl/time32-setitimer-fix.patch
@@ -0,0 +1,20 @@
+diff --git a/compat/time32/setitimer_time32.c b/compat/time32/setitimer_time32.c
+index 4651dacb..2475fd8c 100644
+--- a/compat/time32/setitimer_time32.c
++++ b/compat/time32/setitimer_time32.c
+@@ -15,9 +15,11 @@ int __setitimer_time32(int which, const struct itimerval32 *restrict new32, stru
+ * 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;
++ }
+ return 0;
+ }