aboutsummaryrefslogtreecommitdiff
path: root/src/common/container.c
Commit message (Collapse)AuthorAge
* Fix binary search on lists of 0 or 1 element.Nick Mathewson2012-10-23
| | | | | | | | | | | | | | | The implementation we added has a tendency to crash with lists of 0 or one element. That can happen if we get a consensus vote, v2 consensus, consensus, or geoip file with 0 or 1 element. There's a DOS opportunity there that authorities could exploit against one another, and which an evil v2 authority could exploit against anything downloading v2 directory information.. This fix is minimalistic: It just adds a special-case for 0- and 1-element lists. For 0.2.4 (the current alpha series) we'll want a better patch. This is bug 7191; it's a fix on 0.2.0.10-alpha.
* Merge remote-tracking branch 'public/bug4230' into maint-0.2.2Nick Mathewson2011-11-23
|\
| * Correct the handling of overflow behavior in smartlist_ensure_capacityNick Mathewson2011-11-09
| | | | | | | | | | | | The old behavior was susceptible to the compiler optimizing out our assertion check, *and* could still overflow size_t on 32-bit systems even when it did work.
* | Improve documentation of smartlist_split_stringRobert Ransom2011-06-22
| |
* | Increase the length of the buffer in smartlist_string_num_isin().Nick Mathewson2011-05-15
| | | | | | | | | | | | | | This was harmless, since we only used this for checking for lists of port values, but it's the principle of the thing. Fixes 3175; bugfix on 0.1.0.1-rc
* | New smartlist function to see if two lists of strings are equal.Nick Mathewson2011-05-13
| | | | | | | | We'll use this to detect changes in CSV options.
* | Re-apply the automated conversion to 0.2.2 to make handle any memcmps that ↵Nick Mathewson2011-05-11
| | | | | | | | snuck in
* | Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson2011-05-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug3122_memcmp_022 Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
| * Hand-conversion and audit phase of memcmp transitionNick Mathewson2011-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant.
| * Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson2011-05-11
| | | | | | | | | | | | | | | | | | | | | | | | This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
* | Doxygen documentation for about 100 things that didn't have anyNick Mathewson2011-03-16
| | | | | | | | About 860 doxygen-less things remain in 0.2.2
* | Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson2011-01-03
|\| | | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| * Bump copyright statements to 2011Nick Mathewson2011-01-03
| |
* | Rename log.h to torlog.hNick Mathewson2010-07-09
| | | | | | | | | | | | | | | | | | | | This should make us conflict less with system files named "log.h". Yes, we shouldn't have been conflicting with those anyway, but some people's compilers act very oddly. The actual change was done with one "git mv", by editing Makefile.am, and running find . -name '*.[ch]' | xargs perl -i -pe 'if (/^#include.*\Wlog.h/) {s/log.h/torlog.h/; }'
* | Merge remote branch 'origin/maint-0.2.1'Nick Mathewson2010-02-27
|\| | | | | | | | | | | Conflicts: src/common/test.h src/or/test.c
| * Update Tor Project copyright yearsNick Mathewson2010-02-27
| |
* | Fix comment typos in container.cNick Mathewson2009-12-15
| |
* | Enhance pqueue so we can remove items from the middle.Nick Mathewson2009-12-12
| | | | | | | | | | | | This changes the pqueue API by requiring an additional int in every structure that we store in a pqueue to hold the index of that structure within the heap.
* | *_free functions now accept NULLSebastian Hahn2009-12-12
| | | | | | | | | | | | | | | | Some *_free functions threw asserts when passed NULL. Now all of them accept NULL as input and perform no action when called that way. This gains us consistence for our free functions, and allows some code simplifications where an explicit null check is no longer necessary.
* | Fix two bugs found by Coverity scan.Nick Mathewson2009-10-19
| | | | | | | | | | One was a simple buffer overrun; the other was a high-speed pointer collision. Both were introduced by my microdescs branch.
* | Add a function to get the most frequent member of a list.Nick Mathewson2009-10-15
| |
* | Add a median_int32 and find_nth_int32Nick Mathewson2009-09-14
|/
* Spell-check Tor.Nick Mathewson2009-05-27
|
* Update copyright to 2009.Karsten Loesing2009-05-04
|
* Add a better (non-locale-having) ctypes implementation to avoid protocol and ↵Nick Mathewson2009-01-20
| | | | | | parsing mismatches on different platforms. svn:r18189
* Remove svn $Id$s from our source, and remove tor --version --version.Nick Mathewson2009-01-04
| | | | | | | | The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867
* Document our Bloom filter parameter choices.Nick Mathewson2008-12-26
| | | | svn:r17785
* Add more missing documentation, and correct an error in container.c ↵Nick Mathewson2008-12-26
| | | | | | documentation: Don't introduce two parameters called n when you're calling an algorithm O(n). svn:r17783
* Fix most DOCDOCs remaining and/or added by redox.Nick Mathewson2008-12-22
| | | | svn:r17734
* Add DOCDOC comments for all undocumented functions. Add missing *s to other ↵Nick Mathewson2008-12-22
| | | | | | comments so that they will get recognized as doxygen. svn:r17729
* Revert my older supposed gcc-4.4 warning workaround. GCC was not being ↵Nick Mathewson2008-11-26
| | | | | | needlessly prissy; it was hinting at the wrongly pure smartlist_bsearch_idx. svn:r17396
* Resolve a warning under gcc 4.4 trunk.Nick Mathewson2008-11-22
| | | | svn:r17357
* Now NodeFamily and MyFamily config options allow spaces inRoger Dingledine2008-10-01
| | | | | | | | identity fingerprints, so it's easier to paste them in. Suggested by Lucky Green. svn:r17021
* Add an assert to make tools happier.Nick Mathewson2008-09-05
| | | | svn:r16782
* take out the crazy line from last night that made no sense. apparentlyRoger Dingledine2008-09-01
| | | | | | | it does work for tas after all. svn:r16724
* Fix compile on OpenBSD 4.4-current. Bugfix on 0.2.1.5-alpha.Roger Dingledine2008-09-01
| | | | | | | Reported by Tas. svn:r16713
* r19283@catbus: nickm | 2008-04-09 21:44:18 -0400Nick Mathewson2008-04-10
| | | | | | | The optimist calls the glass half full. The pessimist calls it half empty. The engineer says it is twice as large as it needs to be. In this case, the engineer says that the default smartlist size is twice as large as it needs to be and wouldn't it be nice to save half a megabyte with a one-line patch? svn:r14341
* r19233@catbus: nickm | 2008-04-08 13:06:34 -0400Nick Mathewson2008-04-08
| | | | | | | When we remove old routers, use Bloom filters rather than a digestmap-based set in order to tell which ones we absolutely need to keep. This will save us roughly a kazillion little short-lived allocations for hash table entries. svn:r14318
* r18356@catbus: nickm | 2008-02-21 21:54:55 -0500Nick Mathewson2008-02-22
| | | | | | | Remove redundant check from container.c that gcc 4.2 didnt like svn:r13668
* r18294@catbus: nickm | 2008-02-20 22:42:44 -0500Nick Mathewson2008-02-21
| | | | | | | Fix a spelling error and clean up a recent veracode-induced integer overflow check. Both spotted by Chris Palmer. svn:r13639
* r18230@catbus: nickm | 2008-02-19 18:29:43 -0500Nick Mathewson2008-02-19
| | | | | | | Add a few asserts to catch possible errors found by veracode. svn:r13598
* r18228@catbus: nickm | 2008-02-19 18:05:53 -0500Nick Mathewson2008-02-19
| | | | | | | Chris Palmer notes that almost nobody is using smartlist_set_capacity(). Chris Palmer is right. Remove this basically pointless function. svn:r13596
* r18208@catbus: nickm | 2008-02-19 17:02:30 -0500Nick Mathewson2008-02-19
| | | | | | | Add some checks in torgzip.c to make sure we never overflow size_t there. Also make sure we do not realloc(list,0) in container.c. Backport candidate. svn:r13587
* Update some copyright notices: it is now 2008.Nick Mathewson2008-02-07
| | | | svn:r13412
* misc small fixesRoger Dingledine2008-02-06
| | | | svn:r13403
* r17491@catbus: nickm | 2008-01-07 11:50:24 -0500Nick Mathewson2008-01-07
| | | | | | | Remove some dead code. svn:r13053
* clean up copyrights, and assign 2007 copyrights to The Tor Project, IncRoger Dingledine2007-12-12
| | | | svn:r12786
* r16573@catbus: nickm | 2007-11-08 11:57:16 -0500Nick Mathewson2007-11-08
| | | | | | | Mess with the formula for the Guard flag again. Now it requires that you be in the most familiar 7/8 of nodes, and have above median wfu for that 7/8th. See spec for details. Also, log thresholds better. svn:r12440
* r14677@tombo: nickm | 2007-11-03 15:16:27 -0400Nick Mathewson2007-11-03
| | | | | | | Add a smartlist_bsearch_idx function that gives more useful output than regular bsearch for the value-not-found case. svn:r12360
* r15967@catbus: nickm | 2007-10-19 14:14:47 -0400Nick Mathewson2007-10-19
| | | | | | | Change meaning of "freefn" argument to smartlist_uniq so that we can remove duplicates from a list without freeing them. svn:r12053