summaryrefslogtreecommitdiffstats
path: root/libcutils/str_parms.c
Commit message (Collapse)AuthorAgeFilesLines
* Move all libcutils tests into the gtests.Elliott Hughes2015-04-021-49/+1
| | | | | | | | | | | This also fixes the bug where we were always testing against the fake strlcpy we provide for glibc/Windows rather than the Android one. This also removes some unnecessary library dependencies. This also builds all the cutils tests for the host (static and dynamic). Change-Id: Icd129d5b025c0ca801be5acf31a54ecd88608df9
* am a0a461d3: am 82e1b89f: am a32e01d2: Merge "libcutils: turn on -Werror"Mark Salyzyn2014-05-021-4/+1
|\ | | | | | | | | * commit 'a0a461d3b7d85484c10db64f078427a5be3da189': libcutils: turn on -Werror
| * libcutils: turn on -WerrorMark Salyzyn2014-05-011-4/+1
| | | | | | | | | | | | - Deal with some -Wunused / -Wunused-variable issues Change-Id: I28c23fb213382a392ec30935749fb359e072d664
* | am 4fe18615: am 56d57e88: am 5f130216: Merge "Handle errno properly to avoid ↵Elliott Hughes2014-04-041-13/+44
|\ \ | |/ | | | | | | | | | | corrupt str_parms" * commit '4fe186159386a75ce17ca0b7ba6ace4294187cb2': Handle errno properly to avoid corrupt str_parms
| * Handle errno properly to avoid corrupt str_parmsJens Gulin2014-04-031-13/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A normal sequence of calls is as follows: str_parms_create_str, str_parms_add_str, str_parms_destroy. In some cases the destroy caused double free. str_parms_add_str will clone the input and send it to hashmapPut for storage. If hashmapPut did not store the strings it will raise errno = ENOMEM and leave caller with ownership of the strings. In any of these cases it will be safe to destroy the str_parms. But what if it wasn't hashmapPut that said NOMEM? What if there was a stale NOMEM already before a successful hashmapPut? In that case the strings will be successfully added to the list (if new), but when str_parms_add_str sees the NOMEM it will free them anyway, leaving dangling pointers in the str_parms!! It is the responsibility of the caller to clear errno before any interesting call. This patch makes sure that str_parms_add_str reacts only on errno emmitted from hashmapPut. Change-Id: If87e4bcc482f09e1c66133d33517b152ebdac65f
| * libcutils: bug str_parms.c:str_parms_get_float().Mark Salyzyn2014-01-271-4/+5
| | | | | | | | | | | | | | | | | | | | str_parms_get_float did not return the output into *val. Only output if returning with no error. Audit shows no internal users of this library function (cherry picked from commit 8e71ddeac00d0733c7fcc2965d69f07aa5c5d0a3) Change-Id: I14a3f08a098072a159dd93f85ead36b3f445816f
| * libcutils: UNUSED argument warningsMark Salyzyn2014-01-271-1/+3
| | | | | | | | | | | | (cherry picked from commit ba02cd1e9bccee9b112ccbee06bc204381b5a215) Change-Id: Ie427d481298af8d911bb2b157ebba30954335354
* | Adding a handy predicate function (str_parms_has_key()Paul McLean2014-03-251-0/+4
| | | | | | Change-Id: I1af5c260a1a820b65f0850ea9adb38b01fcb183c
* | libcutils: bug str_parms.c:str_parms_get_float().Mark Salyzyn2013-12-051-4/+5
| | | | | | | | | | | | | | | | str_parms_get_float did not return the output into *val. Only output if returning with no error. Audit shows no internal users of this library function Change-Id: I14a3f08a098072a159dd93f85ead36b3f445816f
* | libcutils: UNUSED argument warningsMark Salyzyn2013-12-051-1/+3
|/ | | | Change-Id: Ie427d481298af8d911bb2b157ebba30954335354
* cutils: str_parms: when deleting entry, need to also remove keyDima Zavin2012-03-141-9/+44
| | | | | | | | | | When removing one entry, we can't just remove it from the map since key will not be freed. So, instead, search through the map for the key and free it once it is found. Change-Id: Id745c166a4acc5ea25f6d6cdbfe4f8fbc21cbbb3 Reported-by: Xin Qian <xqian@marvell.com> Signed-off-by: Dima Zavin <dima@android.com>
* cutils: str_parms: free the key if the value was replaced during create/addDima Zavin2012-03-141-1/+5
| | | | | | Change-Id: I9f31da62f10f78ed11693a7c04e2be29b0790c93 Reported-by: Xin Qian <xqian@marvell.com> Signed-off-by: Dima Zavin <dima@android.com>
* cutils: str_parms: test str_parms_add_str tooDima Zavin2012-03-121-0/+1
| | | | | Change-Id: I93f0e577aff6b8ff23a44e29f9942a26545b6dc8 Signed-off-by: Dima Zavin <dima@android.com>
* cutils: str_parms: need to also dup the key when adding to hashDima Zavin2012-03-121-4/+7
| | | | | Change-Id: Iabdd2061cbc36c6f4d4eb6e46bd757b5b52e0027 Signed-off-by: Dima Zavin <dima@android.com>
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-041-2/+2
| | | | | Bug: 5449033 Change-Id: I4951baa981f09a84ce483e3d1bd0f9ebe009035f
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-2/+2
| | | | | Bug: 5449033 Change-Id: Ib453f869977a6e909095a578bbf0420851f887d2
* libcutils: add a simple string parameter parsing ("a=b;c=d;") helper utilsDima Zavin2011-04-201-0/+329
Change-Id: Ifabeb75550fa6e351434e6e6d036b19331daf6c1 Signed-off-by: Dima Zavin <dima@android.com>