--- libsm-1.1.0/src/SMlibint.h 2008-05-12 14:30:18.000000000 -0700 +++ libsm-1.1.0/src/SMlibint.h 2009-11-27 11:26:28.000000000 -0800 @@ -199,36 +199,42 @@ } \ } /* * STORE FOO */ +#define STORE_ZERO_PADDING(_pBuf, _len) \ +{ \ + memset (_pBuf, 0, _len); \ + _pBuf += _len; \ +} + #define STORE_ARRAY8(_pBuf, _len, _array8) \ { \ STORE_CARD32 (_pBuf, _len); \ memcpy (_pBuf, _array8, _len); \ _pBuf += _len; \ if (PAD64 (4 + _len)) \ - _pBuf += PAD64 (4 + _len); \ + STORE_ZERO_PADDING (_pBuf, PAD64 ( 4 + _len)); \ } #define STORE_LISTOF_PROPERTY(_pBuf, _count, _props) \ { \ int _i, _j; \ STORE_CARD32 (_pBuf, _count); \ - _pBuf += 4; \ + STORE_ZERO_PADDING (_pBuf, 4); \ for (_i = 0; _i < _count; _i++) \ { \ STORE_ARRAY8 (_pBuf, strlen (_props[_i]->name), _props[_i]->name); \ STORE_ARRAY8 (_pBuf, strlen (_props[_i]->type), _props[_i]->type); \ STORE_CARD32 (_pBuf, _props[_i]->num_vals); \ - _pBuf += 4; \ + STORE_ZERO_PADDING (_pBuf, 4); \ for (_j = 0; _j < _props[_i]->num_vals; _j++) \ { \ STORE_ARRAY8 (_pBuf, _props[_i]->vals[_j].length, \ (char *) _props[_i]->vals[_j].value); \ } \ } \ }