Commit Graph

7 Commits

Author SHA1 Message Date
Tim Ruffing 8ae56e33e7
Merge #879: Avoid passing out-of-bound pointers to 0-size memcpy
9570f674cc Avoid passing out-of-bound pointers to 0-size memcpy (Pieter Wuille)

Pull request description:

  Doing so could be considered UB in a pedantic interpretation of the standard. Avoid it.

  Closes #876.

ACKs for top commit:
  practicalswift:
    cr ACK 9570f674cc729cafcba65f4cce03552d9a6108f4: patch looks correct
  real-or-random:
    ACK 9570f674cc

Tree-SHA512: f991462d72e39f14e609021b8427c2e6756009bc8cd21efca2da46ec9410250725a4fed662df20fcdcfd10a4dc59038f13e8c166362b2eadde4366586b9ca72b
2021-06-16 10:22:03 +02:00
William Bright 3c90bdda95 change local lib headers to be relative for those pointing at "include/" dir
added relative paths to header files imported from src directory

added include guards for contrib/ files when referring to secp256k1.h
2021-05-05 09:24:05 -04:00
Pieter Wuille 9570f674cc Avoid passing out-of-bound pointers to 0-size memcpy
Doing so could be considered UB in a strict reading of the standard.
Avoid it.
2021-01-23 21:56:43 -08:00
Dimitris Apostolou 07aa4c70ff
Fix insecure links 2020-12-18 00:24:22 +02:00
fanquake f00d6575ca
remove dead store in ecdsa_signature_parse_der_lax
This change was made in bitcoin/bitcoin without upstreaming. So this is
a followup to the comment here:
https://github.com/bitcoin/bitcoin/pull/19228#issuecomment-641795558.

See also: https://github.com/bitcoin/bitcoin/pull/11073.
2020-06-29 13:23:26 +08:00
Tim Ruffing ec8f20babd Avoid out-of-bound pointers and integer overflows in size comparisons
This changes pointer calculations in size comparions to a form that
ensures that no out-of-bound pointers are computed, because even their
computation yields undefined behavior.
Also, this changes size comparions to a form that ensures that neither
the left-hand side nor the right-hand side can overflow.
2019-05-23 15:22:29 +02:00
Andrew Poelstra eed87af10a Change contrib/laxder from headers-only to files compilable as standalone C
Verified that both programs compile with

    gcc -I. -I../include -lsecp256k1 -c -W -Wextra -Wall -Werror -ansi -pedantic lax_der_privatekey_parsing.c
    gcc -I. -I../include -lsecp256k1 -c -W -Wextra -Wall -Werror -ansi -pedantic lax_der_parsing.c
2015-10-29 18:55:49 -05:00