Index: lib/ipmi_hpmfwupg.c
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_hpmfwupg.c,v
retrieving revision 1.33
diff -u -r1.33 ipmi_hpmfwupg.c
--- lib/ipmi_hpmfwupg.c	3 Aug 2012 17:07:07 -0000	1.33
+++ lib/ipmi_hpmfwupg.c	25 Nov 2012 12:57:06 -0000
@@ -3820,8 +3820,22 @@
    else if ( (argc == 3) && (strcmp(argv[0], "compprop") == 0) )
    {
       struct HpmfwupgGetComponentPropertiesCtx cmdCtx;
-      cmdCtx.req.componentId = strtol(argv[1], NULL, 0);
-      cmdCtx.req.selector    = strtol(argv[2], NULL, 0);
+      if (str2uchar(argv[1], &cmdCtx.req.componentId) != 0) {
+        lprintf(LOG_ERR, "Given id \"%s\" is invalid.", argv[1]);
+        return (-1);
+      }
+      if (cmdCtx.req.componentId > 7) {
+        lprintf(LOG_ERR, "Given id \"%s\" is out of range.", argv[1]);
+        return(-1);
+      }
+      if (str2uchar(argv[2], &cmdCtx.req.selector) != 0) {
+        lprintf(LOG_ERR, "Given selector \"%s\" is invalid.", argv[2]);
+        return (-1);
+      }
+      if (cmdCtx.req.selector > 4) {
+        lprintf(LOG_ERR, "Given selector \"%s\" is out of range.", argv[2]);
+        return(-1);
+      }
       verbose++;
       rc = HpmfwupgGetComponentProperties(intf, &cmdCtx);
    }
