diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-02-10 11:47:21 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-02-10 11:47:21 +0000 |
commit | 8a20407442efa0f9fe43e1b1c61140a0771c6ff8 (patch) | |
tree | bbf0328ea060ca5986c92f45c7feacecf014be7a /source3/locking | |
parent | 4703248a8e7287b738fa82edfd91fb2b13e7c222 (diff) | |
download | samba-8a20407442efa0f9fe43e1b1c61140a0771c6ff8.tar.gz samba-8a20407442efa0f9fe43e1b1c61140a0771c6ff8.tar.bz2 samba-8a20407442efa0f9fe43e1b1c61140a0771c6ff8.zip |
Cleanups: (merge from HEAD)
- use safe_strcpy() instead of pstrcpy() for malloc()ed strings
- CUPS: a failure in an attempt to automaticly add a printer is not level 0 stuff.
- Fix up a possible Realloc() failure segfault
Andrew Bartlett
(This used to be commit c1cfc296c2efdb2b5972202146e80f0e3b6a3da4)
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index e5a72d2208..d4794560f6 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -611,6 +611,7 @@ BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type) /* read in the existing share modes if any */ dbuf = tdb_fetch(tdb, locking_key_fsp(fsp)); if (!dbuf.dptr) { + size_t offset; /* we'll need to create a new record */ pstring fname; @@ -628,7 +629,8 @@ BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type) DEBUG(10,("set_share_mode: creating entry for file %s. num_share_modes = 1\n", fsp->fsp_name )); - pstrcpy(p + sizeof(*data) + sizeof(share_mode_entry), fname); + offset = sizeof(*data) + sizeof(share_mode_entry); + safe_strcpy(p + offset, fname, size - offset); fill_share_mode(p + sizeof(*data), fsp, port, op_type); dbuf.dptr = p; dbuf.dsize = size; |