diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-12-14 19:28:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-12-14 19:28:19 +0000 |
commit | 085def3f0a66da5c5a538d9b02df9e2e8b9dd8d6 (patch) | |
tree | b05eaa01552a5713312878b5094f210a2312613f /sys/dev | |
parent | 90556839e944ac790db07bc9b041d742ba762801 (diff) | |
download | src-085def3f0a66da5c5a538d9b02df9e2e8b9dd8d6.tar.gz src-085def3f0a66da5c5a538d9b02df9e2e8b9dd8d6.zip |
In xbd_connect(), use correct scanf conversion specifiers for the
feature_barrier and feature_flush variables. Otherwise, adjacent
variables on the stack, such as sector_size, may be overwritten, with
disastrous results.
Note that I did not see a good reason to revert the addition of zero
checks introduced in r310013. Better safe than sorry.
PR: 215209
Tested by: royger
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=310086
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/xen/blkfront/blkfront.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c index 2e09c2eb4094..9eca2201f89b 100644 --- a/sys/dev/xen/blkfront/blkfront.c +++ b/sys/dev/xen/blkfront/blkfront.c @@ -1259,13 +1259,13 @@ xbd_connect(struct xbd_softc *sc) if (err || phys_sector_size <= sector_size) phys_sector_size = 0; err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), - "feature-barrier", "%lu", &feature_barrier, + "feature-barrier", "%d", &feature_barrier, NULL); if (err == 0 && feature_barrier != 0) sc->xbd_flags |= XBDF_BARRIER; err = xs_gather(XST_NIL, xenbus_get_otherend_path(dev), - "feature-flush-cache", "%lu", &feature_flush, + "feature-flush-cache", "%d", &feature_flush, NULL); if (err == 0 && feature_flush != 0) sc->xbd_flags |= XBDF_FLUSH; |