Commit 630aa214 authored by claes's avatar claes

Bugfix in check of segment name size

parent b0b61f49
...@@ -147,7 +147,8 @@ void wb_nrep::parse () throw (wb_error) ...@@ -147,7 +147,8 @@ void wb_nrep::parse () throw (wb_error)
snn = norm_name; snn = norm_name;
if (oname[0] == '_') { // This is an identity name. if (oname[0] == '_') {
// This is an identity name.
for ( s = oname; *s; s++, snn++) { for ( s = oname; *s; s++, snn++) {
if (idname_tab[*(unsigned char *)s] == '!') if (idname_tab[*(unsigned char *)s] == '!')
throw wb_error(LDH__BADNAME); throw wb_error(LDH__BADNAME);
...@@ -441,6 +442,8 @@ void wb_nrep::parse () throw (wb_error) ...@@ -441,6 +442,8 @@ void wb_nrep::parse () throw (wb_error)
throw wb_error(LDH__BADNAME); // No segment name throw wb_error(LDH__BADNAME); // No segment name
seg[0].offs = 0; seg[0].offs = 0;
seg[0].len = nameDiff( s, oname); seg[0].len = nameDiff( s, oname);
if ( seg[0].len > pwr_cSizObjName)
throw wb_error(LDH__BADNAME);
num_seg++; num_seg++;
break; break;
case 1: case 1:
...@@ -449,6 +452,8 @@ void wb_nrep::parse () throw (wb_error) ...@@ -449,6 +452,8 @@ void wb_nrep::parse () throw (wb_error)
if ( nameDiff( s, oname) - (vol_len + 1) == 0) if ( nameDiff( s, oname) - (vol_len + 1) == 0)
break; break;
seg[num_seg].len = nameDiff( s, oname) - seg[num_seg].offs; seg[num_seg].len = nameDiff( s, oname) - seg[num_seg].offs;
if ( seg[num_seg].len > pwr_cSizObjName)
throw wb_error(LDH__BADNAME);
if ( seg[num_seg].len) if ( seg[num_seg].len)
num_seg++; num_seg++;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment