1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-10 12:58:35 +03:00

Fixed up overrun read when marshelling SYSTEMTIME struct. This was a subtle one...

Jeremy.
(This used to be commit 65275e73ee7c58352ee20175cbbb43378e16f417)
This commit is contained in:
Jeremy Allison 2001-03-03 06:47:37 +00:00
parent 93169a1f34
commit e2e56e84f0

View File

@ -1996,12 +1996,13 @@ static void spoolss_notify_submitted_time(int snum,
{
struct tm *t;
uint32 len;
SYSTEMTIME st;
t=gmtime(&queue->time);
len = sizeof(SYSTEMTIME);
data->notify_data.data.length = len;
data->notify_data.data.length = len/2 - 1;
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len);
if (!data->notify_data.data.string) {
@ -2009,7 +2010,8 @@ static void spoolss_notify_submitted_time(int snum,
return;
}
make_systemtime((SYSTEMTIME*)(data->notify_data.data.string), t);
make_systemtime(&st, t);
memcpy(data->notify_data.data.string,&st,len);
}
#define END 65535