From 15d683d86d9b9c8c1aa6fec320982f4284acf784 Mon Sep 17 00:00:00 2001 From: Ales Ledvinka Date: Wed, 16 Jan 2013 12:24:13 +0000 Subject: [PATCH] 3600942 check return code --- ipmitool/lib/ipmi_sunoem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipmitool/lib/ipmi_sunoem.c b/ipmitool/lib/ipmi_sunoem.c index fcb01fd..378c926 100644 --- a/ipmitool/lib/ipmi_sunoem.c +++ b/ipmitool/lib/ipmi_sunoem.c @@ -736,7 +736,10 @@ ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile) i_size = SSHKEY_BLOCK_SIZE; memset(wbuf, 0, SSHKEY_BLOCK_SIZE); - fseek(fp, r, SEEK_SET); + if (-1 == fseek(fp, r, SEEK_SET)) { + lprintf(LOG_ERR, "Seek error %s. %s", ifile, strerror(errno)); + return -1; + } count = fread(wbuf+3, 1, i_size, fp); if (count != i_size) { lprintf(LOG_ERR, "Unable to read %d bytes from file %s", i_size, ifile);