]> granicus.if.org Git - curl/commit
smtp: avoid risk of buffer overflow in strtol
authorDaniel Gustafsson <daniel@yesql.se>
Fri, 18 Jan 2019 23:42:47 +0000 (00:42 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 4 Feb 2019 07:22:32 +0000 (08:22 +0100)
commit39df4073e5413fcdbb5a38da0c1ce6f1c0ceb484
treed27fd08698a3365ab1d4ee8dc8dd050fcc8d7c2f
parent50c9484278c63b958655a717844f0721263939cc
smtp: avoid risk of buffer overflow in strtol

If the incoming len 5, but the buffer does not have a termination
after 5 bytes, the strtol() call may keep reading through the line
buffer until is exceeds its boundary. Fix by ensuring that we are
using a bounded read with a temporary buffer on the stack.

Bug: https://curl.haxx.se/docs/CVE-2019-3823.html
Reported-by: Brian Carpenter (Geeknik Labs)
CVE-2019-3823
lib/smtp.c