1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00

Fix crash bug with overwriting memory.

Jeremy.
(This used to be commit 9b08b4e4c2)
This commit is contained in:
Jeremy Allison 2002-11-07 22:45:11 +00:00
parent 4d70634685
commit e1adcd154a

View File

@ -1111,7 +1111,7 @@ BOOL print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t
struct tdb_print_db *pdb;
TDB_DATA data;
BOOL ret = True;
size_t i, num_pids;
size_t i, num_pids, offset;
pid_t *pid_list;
*p_num_pids = 0;
@ -1141,10 +1141,8 @@ BOOL print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t
goto done;
}
for( i = 0; i < data.dsize; i += 8) {
pid_t pid = (pid_t)IVAL(data.dptr, i);
pid_list[i] = pid;
}
for( i = 0, offset = 0; offset < data.dsize; offset += 8, i++)
pid_list[i] = (pid_t)IVAL(data.dptr, offset);
*pp_pid_list = pid_list;
*p_num_pids = num_pids;