1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

Accessing data after it's been free()ed really is a no-no...

Andrew Bartlett
(This used to be commit 6e821285a4aacfc0031957b88ddbec73d7e1dc11)
This commit is contained in:
Andrew Bartlett 2003-01-13 12:42:20 +00:00
parent ac04f498a2
commit 20ecae9a58
3 changed files with 17 additions and 4 deletions

View File

@ -84,7 +84,6 @@ void data_blob_free(DATA_BLOB *d)
if (d->free) {
(d->free)(d);
}
ZERO_STRUCTP(d);
}
}

View File

@ -1013,7 +1013,7 @@ BOOL get_myfullname(char *my_name)
Get my own domain name.
****************************************************************************/
BOOL get_mydomname(char *my_domname)
BOOL get_mydomname(fstring my_domname)
{
pstring hostname;
char *p;

View File

@ -308,8 +308,22 @@ char *skip_string(char *buf,size_t n)
size_t str_charnum(const char *s)
{
push_ucs2(NULL, tmpbuf,s, sizeof(tmpbuf), STR_TERMINATE);
return strlen_w(tmpbuf);
uint16 tmpbuf2[sizeof(pstring)];
push_ucs2(NULL, tmpbuf2,s, sizeof(tmpbuf2), STR_TERMINATE);
return strlen_w(tmpbuf2);
}
/*******************************************************************
Count the number of characters in a string. Normally this will
be the same as the number of bytes in a string for single byte strings,
but will be different for multibyte.
********************************************************************/
size_t str_ascii_charnum(const char *s)
{
pstring tmpbuf2;
push_ascii(tmpbuf2, s, sizeof(tmpbuf2), STR_TERMINATE);
return strlen(tmpbuf2);
}
/*******************************************************************