Hi Hans

Good point, I commented on this in a later email, after I sent the review.

I mentioned:

[GL] will add a comment that name must be <= SA_MAX_NAME_LENGTH
[GL] will add osafassert (len <= SA_MAX_NAME_LENGTH);

Is that enough for now? When long DN is added (soon), the SA_MAX_NAME_LENGTH  
length limitation will be removed from the function.

Thanks
Gary

> On 27 Jan 2016, at 6:35 PM, Hans Nordebäck <hans.nordeb...@ericsson.com> 
> wrote:
> 
> ack, code review only. See questions below. /Thanks HansN
> 
> On 01/25/2016 05:35 AM, Gary Lee wrote:
>>  osaf/libs/core/include/ncsencdec_pub.h |   1 +
>>  osaf/libs/core/leap/hj_enc.c           |  17 +++++++++++++++++
>>  2 files changed, 18 insertions(+), 0 deletions(-)
>> 
>> 
>> diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
>> b/osaf/libs/core/include/ncsencdec_pub.h
>> --- a/osaf/libs/core/include/ncsencdec_pub.h
>> +++ b/osaf/libs/core/include/ncsencdec_pub.h
>> @@ -153,6 +153,7 @@
>>  void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
>>  void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
>>  void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
>> +void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
>>  void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
>>  void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
>>  void osaf_encode_bool(NCS_UBAID *ub, bool value);
>> diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
>> --- a/osaf/libs/core/leap/hj_enc.c
>> +++ b/osaf/libs/core/leap/hj_enc.c
>> @@ -408,6 +408,23 @@
>>      }
>>  }
>>  
> [HansN] the function seems to encode SaConstStringT but the name of the 
> function is osaf_encode_sanamet_o2? Are no length
> checking of name needed?
>> +void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name)
>> +{
>> +    int i;
>> +
>> +    size_t len = strlen(name);
>> +    osaf_encode_uint16(ub, len);
>> +    for (i = 0; i < len; i++) {
>> +            osaf_encode_uint8(ub, name[i]);
>> +    }
>> +
>> +    // need to encode SA_MAX_NAME_LENGTH characters to remain
>> +    // compatible with osaf_decode_sanamet
>> +    for (i = len; i < SA_MAX_NAME_LENGTH; i++) {
>> +            osaf_encode_uint8(ub, 0);
>> +    }
>> +}
>> +
>>  void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time)
>>  {
>>      osaf_encode_uint64(ub, time);


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to