From 38fa857648ba12e44de41cf278a3c14e2b3398df Mon Sep 17 00:00:00 2001 From: Jukka Heinonen Date: Wed, 4 Jun 2003 20:14:24 +0000 Subject: [PATCH] Timer routines must check for NULL timer name. --- dlls/ntdll/sync.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index 392956db1df..e00141ee3c2 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -297,6 +297,7 @@ NTSTATUS WINAPI NtCreateTimer(OUT HANDLE *handle, IN const OBJECT_ATTRIBUTES *oa OPTIONAL, IN TIMER_TYPE timer_type) { + DWORD len = (oa && oa->ObjectName) ? oa->ObjectName->Length : 0; NTSTATUS status; if (timer_type != NotificationTimer && timer_type != SynchronizationTimer) @@ -306,8 +307,7 @@ NTSTATUS WINAPI NtCreateTimer(OUT HANDLE *handle, { req->manual = (timer_type == NotificationTimer) ? TRUE : FALSE; req->inherit = oa && (oa->Attributes & OBJ_INHERIT); - if (oa && oa->ObjectName->Length) - wine_server_add_data( req, oa->ObjectName->Buffer, oa->ObjectName->Length ); + if (len) wine_server_add_data( req, oa->ObjectName->Buffer, len ); status = wine_server_call( req ); *handle = reply->handle; } @@ -324,6 +324,7 @@ NTSTATUS WINAPI NtOpenTimer(OUT PHANDLE handle, IN ACCESS_MASK access, IN const OBJECT_ATTRIBUTES* oa ) { + DWORD len = (oa && oa->ObjectName) ? oa->ObjectName->Length : 0; NTSTATUS status; if (oa && oa->Length >= MAX_PATH * sizeof(WCHAR)) @@ -333,8 +334,7 @@ NTSTATUS WINAPI NtOpenTimer(OUT PHANDLE handle, { req->access = access; req->inherit = oa && (oa->Attributes & OBJ_INHERIT); - if (oa && oa->ObjectName->Length) - wine_server_add_data( req, oa->ObjectName->Buffer, oa->ObjectName->Length ); + if (len) wine_server_add_data( req, oa->ObjectName->Buffer, len ); status = wine_server_call( req ); *handle = reply->handle; }