Hi Stefan,

> +       case 'i':
> +               if (parseHexOrDecimal(aArg, &nvindex, 0, UINT_MAX,

  Should these max values be INT_MAX instead?  I don't think the size test
in parseHexOrDecimal can fail otherwise...

> +
> +       if (NVReadValue(nvObject, offset, &ulDataLength, &rgbDataRead) !=
> +           TSS_SUCCESS)
> +               goto out_close_obj;
> +
> +       if (filename) {
> +               fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT);

  Need to add a 3rd paramter when O_CREAT is used for the mod of the file.
I'd suggest 0600 since there could be sensitive data being read out.

> +               if (fd < 0) {
> +                       logError(_("Could not open file %s for writing."),
> +                                filename);
> +                       goto out_close_obj;
> +               }
> +               if (ulDataLength != write(fd, rgbDataRead, ulDataLength)) {

  I'm getting a compile error here, since write returns ssize_t. I think
you'll need a separate ssize_t variable since it changes size when based on
32/64bit...

> +       case 'i':
> +               if (parseHexOrDecimal(aArg, &nvindex, 0, UINT_MAX,

  Same question here and below as above...

> +               if (ulDataLength !=
> +                   read(fd, rgbDataToWrite, ulDataLength)) {

  Compile error here too since read returns ssize_t..

Kent

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to