Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FSTRING_LEN 256
- typedef char fstring[FSTRING_LEN];
- char *safe_strcpy(char *dest,const char *src, size_t maxlength)
- #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
- static bool parse_wbinfo_domain_user(
- const char *domuser, fstring domain, fstring user)
- {
- ....
- /* Maybe it was a UPN? */
- if ((p = strchr(domuser, '@')) != NULL) {
- fstrcpy(domain, "");
- fstrcpy(user, domuser);
- return true;
- }
- ....
- }
- This suspicious code was found in samba project by PVS-Studio static code analyzer.
- Warning message is:
- V511 The sizeof() operator returns size of the pointer, and not of the array, in 'sizeof ((domain))' expression. wbinfo.c 124
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment