diff options
author | Kenneth D. Merry <ken@FreeBSD.org> | 1998-11-15 23:17:39 +0000 |
---|---|---|
committer | Kenneth D. Merry <ken@FreeBSD.org> | 1998-11-15 23:17:39 +0000 |
commit | b735c71405386526faf076f9b61dab34f4c979f3 (patch) | |
tree | 18ec0bba22937581cecf8b9b40482006babd7457 /lib/libcam/camlib.c | |
parent | 2327ec3a76b119192cfb064e319776ba1dd5e5b4 (diff) | |
download | src-b735c71405386526faf076f9b61dab34f4c979f3.tar.gz src-b735c71405386526faf076f9b61dab34f4c979f3.zip |
Use snprintf to make sure we don't overflow a buffer.
Notes
Notes:
svn path=/head/; revision=41190
Diffstat (limited to 'lib/libcam/camlib.c')
-rw-r--r-- | lib/libcam/camlib.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c index 10659d671ebe..394f63596cc1 100644 --- a/lib/libcam/camlib.c +++ b/lib/libcam/camlib.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: camlib.c,v 1.2 1998/10/12 21:54:00 ken Exp $ + * $Id: camlib.c,v 1.3 1998/11/15 23:12:42 ken Exp $ */ #include <sys/types.h> @@ -585,9 +585,10 @@ cam_real_open_device(const char *path, int flags, struct cam_device *device, device->given_unit_number = given_unit_number; if ((fd = open(path, flags)) < 0) { - sprintf(cam_errbuf, "%s: couldn't open passthrough device %s\n" - "%s: %s", func_name, path, func_name, - strerror(errno)); + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + "%s: couldn't open passthrough device %s\n" + "%s: %s", func_name, path, func_name, + strerror(errno)); goto crod_bailout; } |