Print this page
11227 smb code needs smatch fixes

@@ -20,10 +20,14 @@
  */
 /*
  * 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,11 +297,11 @@
         if (size == 0) {
                 smb_free(sr, ptr, zero);
                 return (NULL);
         }
         if (smh->smh_size >= size) {
-                if ((zero) & (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);