summaryrefslogtreecommitdiffstats
path: root/sha1.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Define alignof using _Alignof when using C11 or newerKhem Raj2023-03-191-1/+11
| | | | | | | | | | | | | | | | | | | | | WG14 N2350 made very clear that it is an UB having type definitions within "offsetof" [1]. This patch enhances the implementation of macro alignof_slot to use builtin "_Alignof" to avoid undefined behavior on when using std=c11 or newer clang 16+ has started to flag this [2] Fixes build when using -std >= gnu11 and using clang16+ Older compilers gcc < 4.9 or clang < 8 has buggy _Alignof even though it may support C11, exclude those compilers too [1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm [2] https://reviews.llvm.org/D133574 Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
* Fix potential overlap dest bufferNigel Croxon2021-10-081-1/+1
| | | | | | | | | | | | | To meet requirements of Common Criteria certification vulnerablility assessment. Static code analysis has been run and found the following error. Overlapping_buffer: The source buffer potentially overlaps with the destination buffer, which results in undefined behavior for "memcpy". The change is to use memmove instead of memcpy. Signed-off-by: Nigel Croxon <ncroxon@redhat.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
* Remove lots of unnecessary white space.NeilBrown2013-06-191-1/+0
| | | | | | | Now that I am using white-space mode in Emacs I can see all of this, and I don't like it :-) Signed-off-by: NeilBrown <neilb@suse.de>
* New sha1.c and sha1.hNeilBrown2012-05-151-51/+42
| | | | | | | | | | | These are from: http://gcc.gnu.org/svn/gcc/branches/cilkplus/include/sha1.h and http://gcc.gnu.org/svn/gcc/branches/cilkplus/libiberty/sha1.c and hopefully avoid aliasing issues. Signed-off-by: NeilBrown <neilb@suse.de>
* Work around gcc-4.7's strict aliasing checksJes Sorensen2012-01-121-3/+5
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Make homehost information appear in superblock.Neil Brown2006-05-191-0/+423
When an array is created, if the homehost is know, the superblock gets it, either in the uuid, (via sha1) or in the name field. Signed-off-by: Neil Brown <neilb@suse.de>