summaryrefslogtreecommitdiffstats
path: root/source/lib/charcnv.c
Commit message (Collapse)AuthorAgeFilesLines
* r23741: Combined merge of 23726, 23727 and 23731 from 3_0:Volker Lendecke2007-07-071-2/+10
| | | | | | | | | | | | | | | | | | | | | 23726: Explicitly pass down the FLAGS2 field to srvstr_pull_buf. The next checkin will pull this up to srvstr_get_path. At that point we can get more independent of the inbuf, the base_ptr in pull_string will only be used to satisfy UCS2 alignment constraints. 23731: Explicitly pass down FLAGS2 to srvstr_get_path. Next step is to remove the bug that in the trans2 code we use the inbuf as the base pointer to decide whether we need ucs2 alignment where we need to use the beginning of the params buffer 23731: Forgot one reference to inbuf
* r23662: According to simo, check_dos_char is neededVolker Lendecke2007-06-291-0/+1
|
* r23660: Anybody know what check_dos_char() was used for? It wasn't called atVolker Lendecke2007-06-291-1/+0
| | | | all, so it's gone. With it 8k bss went away.
* r23511: Merge branches/SAMBA_3_0@23510James Peach2007-06-151-1/+1
| | | | | Tidy calls to smb_panic by removing trailing newlines. Print the failed expression in SMB_ASSERT.
* r22754: When processing a string, ensure we don't write one pastJeremy Allison2007-05-071-6/+15
| | | | | | | | the terminating NULL if we've already processed the null in iconv. Jerry, once I get confirmation from Thomas Bork this needs to be in 3.0.25 final. Tests fine with valgrind here. Jeremy.
* r19769: more compile fixes while merging from SAMBA_3_0 (not done yet)Gerald Carter2006-11-181-65/+139
|
* r15003: patch based on code from Arkady Glabek <aglabek@centeris.com> to ↵Gerald Carter2006-04-081-0/+17
| | | | ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms)
* r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison2006-03-071-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy.
* r12522: Try and fix bug #2926 by removing setlocale(LC_ALL, "C")Jeremy Allison2005-12-271-10/+1
| | | | | | and replace calls to isupper/islower/toupper/tolower with ASCII equivalents (mapping into _w variants). Jeremy.
* r12043: It's amazing the warnings you find when compiling on a 64-bitJeremy Allison2005-12-031-1/+1
| | | | | | | | | | | box with gcc4 and -O6... Fix a bunch of C99 dereferencing type-punned pointer will break strict-aliasing rules errors. Also added prs_int32 (not uint32...) as it's needed in one place. Find places where prs_uint32 was being used to marshall/unmarshall a time_t (a big no no on 64-bits). More warning fixes to come. Thanks to Volker for nudging me to compile like this. Jeremy.
* r5933: We were handling setting of EA's incorrectly - we should be able to setJeremy Allison2005-03-221-0/+15
| | | | | | | a list. Also not converting names from DOS CP to UNIX CP correctly. This code doesn't quite work yet but it's a work in progress to be fixed tomorrow (don't want to lose it). Jeremy.
* r4126: Fix from Björn Jacke <bjoern@j3e.de> for bugid #2040 - ensure the ↵Jeremy Allison2004-12-101-0/+9
| | | | | | | locale is reset to C to get ASCII-compatible toupper/lower functions. Jeremy.
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2004-12-071-5/+5
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
* r3857: Shut up gcc about erroneous "used uninitialised" warning.Jeremy Allison2004-11-181-3/+3
| | | | Jeremy.
* r2610: Even if we only use the fast-path (ascii only) thenJeremy Allison2004-09-241-0/+21
| | | | | we still need to set errno = E2BIG when we overflow. Jeremy.
* r2392: Steal the nicer error message from Samba4 :-).Jeremy Allison2004-09-171-8/+12
| | | | Jeremy.
* r2114: Shameless theft of iconv commit from Samba4 to keep the two libs more ↵Jeremy Allison2004-08-301-5/+5
| | | | | | | | in sync :-). try to cope with a wider range of UTF-16 characters when we are using an external libiconv library. Jeremy.
* r1684: Patch for bug #1578 based on fix from Alexander E. Patrakov,Jeremy Allison2004-08-101-12/+19
| | | | | | <patrakov@ums.usu.ru>. Main change, hardcode replacement char to '_' as I really don't want a new parameter. Jeremy.
* r907: fixing browse.dat bug -- don't include the resouce byte from the ↵Gerald Carter2004-05-261-1/+1
| | | | netbios name when pulling a string from a packet (jra, please double check this
* r2: import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunkCVS Import User2004-04-041-0/+1339
metze