On 07/08/2011 03:43 PM, Kent Yoder wrote:
> 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...
For the NVRAM index it's fine if they don't fail. If this function was
used for PCRs for example then we would have a valid upper limit at 23
(for a PC).
>> +
>> + 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.
>
Ok, will add this for v3.
>> + 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...
>
I obviously didn't get the compiler error. Will fix it.
>> + 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..
>
Stefan
> 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