Print this page
11227 smb code needs smatch fixes

*** 20,29 **** --- 20,33 ---- */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. */ + /* + * Copyright 2019 Joyent, Inc. + */ + #include <sys/types.h> #include <sys/sunddi.h> #include <sys/kmem.h> #include <sys/sysmacros.h> #include <smbsrv/smb_kproto.h>
*** 293,303 **** if (size == 0) { smb_free(sr, ptr, zero); return (NULL); } if (smh->smh_size >= size) { ! if ((zero) & (smh->smh_size > size)) bzero((caddr_t)ptr + size, smh->smh_size - size); return (ptr); } new_ptr = smb_alloc(sr, size, B_FALSE); bcopy(ptr, new_ptr, smh->smh_size); --- 297,307 ---- if (size == 0) { smb_free(sr, ptr, zero); return (NULL); } if (smh->smh_size >= size) { ! if ((zero) && (smh->smh_size > size)) bzero((caddr_t)ptr + size, smh->smh_size - size); return (ptr); } new_ptr = smb_alloc(sr, size, B_FALSE); bcopy(ptr, new_ptr, smh->smh_size);