upstream commit

Switch to recallocarray() for a few operations.  Both
growth and shrinkage are handled safely, and there also is no need for
preallocation dances. Future changes in this area will be less error prone.
Review and one bug found by markus

Upstream-ID: 822d664d6a5a1d10eccb23acdd53578a679d5065
15 files changed
tree: 8f33ae8fa9bcfa0d9c80d0e0f1555a814a844bc1
  1. contrib/
  2. openbsd-compat/
  3. regress/
  4. .gitignore
  5. .skipped-commit-ids
  6. aclocal.m4
  7. addrmatch.c
  8. atomicio.c
  9. atomicio.h
  10. audit-bsm.c
  11. audit-linux.c
  12. audit.c
  13. audit.h
  14. auth-bsdauth.c
  15. auth-krb5.c
  16. auth-options.c
  17. auth-options.h
  18. auth-pam.c
  19. auth-pam.h
  20. auth-passwd.c
  21. auth-rhosts.c
  22. auth-shadow.c
  23. auth-sia.c
  24. auth-sia.h
  25. auth-skey.c
  26. auth.c
  27. auth.h
  28. auth2-chall.c
  29. auth2-gss.c
  30. auth2-hostbased.c
  31. auth2-kbdint.c
  32. auth2-none.c
  33. auth2-passwd.c
  34. auth2-pubkey.c
  35. auth2.c
  36. authfd.c
  37. authfd.h
  38. authfile.c
  39. authfile.h
  40. bitmap.c
  41. bitmap.h
  42. blocks.c
  43. bufaux.c
  44. bufbn.c
  45. bufec.c
  46. buffer.c
  47. buffer.h
  48. buildpkg.sh.in
  49. canohost.c
  50. canohost.h
  51. chacha.c
  52. chacha.h
  53. channels.c
  54. channels.h
  55. cipher-aes.c
  56. cipher-aesctr.c
  57. cipher-aesctr.h
  58. cipher-chachapoly.c
  59. cipher-chachapoly.h
  60. cipher-ctr.c
  61. cipher.c
  62. cipher.h
  63. cleanup.c
  64. clientloop.c
  65. clientloop.h
  66. compat.c
  67. compat.h
  68. config.guess
  69. config.sub
  70. configure.ac
  71. crc32.c
  72. crc32.h
  73. CREDITS
  74. crypto_api.h
  75. defines.h
  76. dh.c
  77. dh.h
  78. digest-libc.c
  79. digest-openssl.c
  80. digest.h
  81. dispatch.c
  82. dispatch.h
  83. dns.c
  84. dns.h
  85. ed25519.c
  86. entropy.c
  87. entropy.h
  88. fatal.c
  89. fe25519.c
  90. fe25519.h
  91. fixalgorithms
  92. fixpaths
  93. fixprogs
  94. ge25519.c
  95. ge25519.h
  96. ge25519_base.data
  97. groupaccess.c
  98. groupaccess.h
  99. gss-genr.c
  100. gss-serv-krb5.c
  101. gss-serv.c
  102. hash.c
  103. hmac.c
  104. hmac.h
  105. hostfile.c
  106. hostfile.h
  107. includes.h
  108. INSTALL
  109. install-sh
  110. kex.c
  111. kex.h
  112. kexc25519.c
  113. kexc25519c.c
  114. kexc25519s.c
  115. kexdh.c
  116. kexdhc.c
  117. kexdhs.c
  118. kexecdh.c
  119. kexecdhc.c
  120. kexecdhs.c
  121. kexgex.c
  122. kexgexc.c
  123. kexgexs.c
  124. key.c
  125. key.h
  126. krl.c
  127. krl.h
  128. LICENCE
  129. log.c
  130. log.h
  131. loginrec.c
  132. loginrec.h
  133. logintest.c
  134. mac.c
  135. mac.h
  136. Makefile.in
  137. match.c
  138. match.h
  139. md5crypt.c
  140. md5crypt.h
  141. mdoc2man.awk
  142. misc.c
  143. misc.h
  144. mkinstalldirs
  145. moduli
  146. moduli.5
  147. moduli.c
  148. monitor.c
  149. monitor.h
  150. monitor_fdpass.c
  151. monitor_fdpass.h
  152. monitor_wrap.c
  153. monitor_wrap.h
  154. msg.c
  155. msg.h
  156. mux.c
  157. myproposal.h
  158. nchan.c
  159. nchan.ms
  160. nchan2.ms
  161. opacket.c
  162. opacket.h
  163. openssh.xml.in
  164. opensshd.init.in
  165. OVERVIEW
  166. packet.c
  167. packet.h
  168. pathnames.h
  169. pkcs11.h
  170. platform-pledge.c
  171. platform-tracing.c
  172. platform.c
  173. platform.h
  174. poly1305.c
  175. poly1305.h
  176. progressmeter.c
  177. progressmeter.h
  178. PROTOCOL
  179. PROTOCOL.agent
  180. PROTOCOL.certkeys
  181. PROTOCOL.chacha20poly1305
  182. PROTOCOL.key
  183. PROTOCOL.krl
  184. PROTOCOL.mux
  185. readconf.c
  186. readconf.h
  187. README
  188. README.dns
  189. README.platform
  190. README.privsep
  191. README.tun
  192. readpass.c
  193. rijndael.c
  194. rijndael.h
  195. rsa.c
  196. rsa.h
  197. sandbox-capsicum.c
  198. sandbox-darwin.c
  199. sandbox-null.c
  200. sandbox-pledge.c
  201. sandbox-rlimit.c
  202. sandbox-seccomp-filter.c
  203. sandbox-solaris.c
  204. sandbox-systrace.c
  205. sc25519.c
  206. sc25519.h
  207. scp.1
  208. scp.c
  209. servconf.c
  210. servconf.h
  211. serverloop.c
  212. serverloop.h
  213. session.c
  214. session.h
  215. sftp-client.c
  216. sftp-client.h
  217. sftp-common.c
  218. sftp-common.h
  219. sftp-glob.c
  220. sftp-server-main.c
  221. sftp-server.8
  222. sftp-server.c
  223. sftp.1
  224. sftp.c
  225. sftp.h
  226. smult_curve25519_ref.c
  227. ssh-add.1
  228. ssh-add.c
  229. ssh-agent.1
  230. ssh-agent.c
  231. ssh-dss.c
  232. ssh-ecdsa.c
  233. ssh-ed25519.c
  234. ssh-gss.h
  235. ssh-keygen.1
  236. ssh-keygen.c
  237. ssh-keyscan.1
  238. ssh-keyscan.c
  239. ssh-keysign.8
  240. ssh-keysign.c
  241. ssh-pkcs11-client.c
  242. ssh-pkcs11-helper.8
  243. ssh-pkcs11-helper.c
  244. ssh-pkcs11.c
  245. ssh-pkcs11.h
  246. ssh-rsa.c
  247. ssh-sandbox.h
  248. ssh.1
  249. ssh.c
  250. ssh.h
  251. ssh2.h
  252. ssh_api.c
  253. ssh_api.h
  254. ssh_config
  255. ssh_config.5
  256. sshbuf-getput-basic.c
  257. sshbuf-getput-crypto.c
  258. sshbuf-misc.c
  259. sshbuf.c
  260. sshbuf.h
  261. sshconnect.c
  262. sshconnect.h
  263. sshconnect2.c
  264. sshd.8
  265. sshd.c
  266. sshd_config
  267. sshd_config.5
  268. ssherr.c
  269. ssherr.h
  270. sshkey.c
  271. sshkey.h
  272. sshlogin.c
  273. sshlogin.h
  274. sshpty.c
  275. sshpty.h
  276. sshtty.c
  277. survey.sh.in
  278. TODO
  279. ttymodes.c
  280. ttymodes.h
  281. uidswap.c
  282. uidswap.h
  283. umac.c
  284. umac.h
  285. utf8.c
  286. utf8.h
  287. uuencode.c
  288. uuencode.h
  289. verify.c
  290. version.h
  291. xmalloc.c
  292. xmalloc.h