summaryrefslogtreecommitdiff
path: root/util/idcmi.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 23:32:28 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 23:32:28 +0200
commit55adddbc16f65732b57ab8585c47001fced91d77 (patch)
tree27e8239d48c8a6b353db356aff92ee4d225c0a0e /util/idcmi.c
parentd3c90cdcdf56146af89056ed36bfcc7b4d4956c5 (diff)
Imported Upstream version 2.9.9upstream/2.9.9
Diffstat (limited to 'util/idcmi.c')
-rw-r--r--util/idcmi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util/idcmi.c b/util/idcmi.c
index 2786efb..a21ee2a 100644
--- a/util/idcmi.c
+++ b/util/idcmi.c
@@ -62,7 +62,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "idcmi.h"
static char * progname = "idcmi";
-static char * progver = "2.98";
+static char * progver = "2.99";
extern char fdebug; /*from ipmicmd.c*/
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
@@ -334,7 +334,7 @@ void dcmi_show_power_read(int parm, uchar *cdata, int sdata)
printf(" Max Power over sample duration: %d Watts\n",cdata[5]+(cdata[6]<<8));
printf(" Avg Power over sample duration: %d Watts\n",cdata[7]+(cdata[8]<<8));
printf(" Timestamp: %s\n",ctime(&t));
- printf(" Sampling period: %d ms\n",sample_period);
+ printf(" Sampling period: %lu ms\n",sample_period);
printf(" Power reading state is: %s\n",(state&0x40)? "active":"not active");
break;
case 2: /* Mode 2 - Enhanced System Power Statistics */
@@ -369,7 +369,7 @@ void dcmi_show_power_limit(uchar *cdata, int sdata, int rv)
else
printf("OEM defined\n");
printf(" Power Limit: %d Watts %s\n",cdata[4]+(cdata[5]<<8), pstr);
- printf(" Correction Time: %d ms\n", correction_time);
+ printf(" Correction Time: %lu ms\n", correction_time);
printf(" Sampling period: %d sec\n", cdata[12]+(cdata[13]<<8));
}
@@ -494,6 +494,7 @@ static int dcmi_get_asset_tag(char *pdata, int sdata, int *dlen)
if (rv == 0) rv = cc;
if (rv == 0) { /* if here, success */
if (n == 0) sz_all = rdata[1];
+ if ((rlen - 2) < sz_chunk) sz_chunk = rlen - 2;
if ((n + sz_chunk) > sdata) {
if (fdebug)
printf("dcmi_get_asset(%d): data truncated from %d to %d\n",
@@ -535,6 +536,7 @@ static int dcmi_get_mc_id(char *pdata, int sdata, int *dlen)
if (rv == 0) rv = cc;
if (rv == 0) { /* if here, success */
if (n == 0) sz_all = rdata[1];
+ if ((rlen - 2) < sz_chunk) sz_chunk = rlen - 2;
if ((n + sz_chunk) > sdata) {
if (fdebug)
printf("dcmi_get_mc_id(%d): data truncated from %d to %d\n",