--- samba-3.0.28/source/libsmb/libsmbclient.c 2007-11-14 22:15:03.000000000 -0500 +++ samba-3.0.28/source/libsmb/libsmbclient.c 2008-01-11 17:43:45.000000000 -0500 @@ -5877,6 +5877,7 @@ * the complete set of attribute names, always, rather than only those * attribute names which actually exist for a file. Hmmm... */ + size_t retsize; const char supported_old[] = "system.*\0" "system.*+\0" @@ -5920,22 +5921,24 @@ if (context->internal->_full_time_names) { supported = supported_new; + retsize = sizeof(supported_new); } else { supported = supported_old; + retsize = sizeof(supported_old); } if (size == 0) { - return sizeof(supported); + return retsize; } - if (sizeof(supported) > size) { + if (retsize > size) { errno = ERANGE; return -1; } /* this can't be strcpy() because there are embedded null characters */ - memcpy(list, supported, sizeof(supported)); - return sizeof(supported); + memcpy(list, supported, retsize); + return retsize; }