c++/994: Creating a string with NULL seg faults

coop1@austin.ibm.com coop1@austin.ibm.com
Tue Dec 5 17:46:00 GMT 2000


>Number:         994
>Category:       c++
>Synopsis:       Creating a string with NULL seg faults
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 05 17:46:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     coop1@austin.ibm.com
>Release:        unknown-1.0
>Organization:
>Environment:
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)

OR

Reading specs from /.../austin.ibm.com/fs/projects/opensource/lib/gcc-lib/rs6000-ibm-aix4.3.1.0/2.95.2/specs
gcc version 2.95.2 19991024 (release)

OR

Reading specs from /usr/local/test/bin/../lib/gcc-lib/i386-pc-linux-gnu/2.96/specs
gcc version 2.96 20000706 (experimental)

>Description:
Just by creating a string with a NULL pointer seg faults!

string str (NULL);
>How-To-Repeat:
- command line is empty
- compiled with and without debug, same result
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="main1.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="main1.ii"

IyAxICJtYWluMS5DIgoKIyA3ICIvdXNyL2xvY2FsL3Rlc3QvaW5jbHVkZS9nKystMy9zdHJpbmci
IDEgMwojIDMyICIvdXNyL2xvY2FsL3Rlc3QvaW5jbHVkZS9nKystMy9zdGQvYmFzdHJpbmcuaCIg
MSAzCiNwcmFnbWEgaW50ZXJmYWNlCiMgMzIgIi91c3IvbG9jYWwvdGVzdC9pbmNsdWRlL2crKy0z
L3N0ZC9iYXN0cmluZy5oIiAzCgoKCgojIDcgIi91c3IvbG9jYWwvdGVzdC9pbmNsdWRlL2crKy0z
L2NzdGRkZWYiIDEgMwojIDE0NyAiL3Vzci9sb2NhbC90ZXN0L2xpYi9nY2MtbGliL2kzODYtc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ICBlbHNlIHJldHVybiAx
OwogICAgICAgIH0KICAgIH0KICAgIGludCBpcGZ4MSgpIHsKICAgICAgICBpZiAoIWdvb2QoKSkg
eyBzZXQoaW9zOjpmYWlsYml0KTsgcmV0dXJuIDA7IH0KICAgICAgICBlbHNlIHsKICAgICAgICAg
IDsKICAgICAgICAgIGlmIChfdGllICYmIHJkYnVmKCktPmluX2F2YWlsKCkgPT0gMCkgX3RpZS0+
Zmx1c2goKTsKICAgICAgICAgIHJldHVybiAxOwogICAgICAgIH0KICAgIH0KICAgIHZvaWQgaXNm
eCgpIHsgOyB9CiAgICBpbnQgZ2V0KCkgeyBpZiAoIWlwZngxKCkpIHJldHVybiAoLTEpOwogICAg
ICAgICAgICAgICAgZWxzZSB7IGludCBjaCA9IF9zdHJidWYtPnNidW1wYygpOwogICAgICAgICAg
ICAgICAgICAgICAgIGlmIChjaCA9PSAoLTEpKSBzZXQoaW9zOjplb2ZiaXQpOwogICAgICAgICAg
ICAgICAgICAgICAgIGlzZngoKTsKICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2g7CiAg
ICAgICAgICAgICAgICAgICAgIH0gfQogICAgaW50IHBlZWsoKTsKICAgIHNpemVfdCBnY291bnQo
KSB7IHJldHVybiBfZ2NvdW50OyB9CiAgICBpc3RyZWFtJiBpZ25vcmUoaW50IG49MSwgaW50IGRl
bGltID0gKC0xKSk7CiAgICBpbnQgc3luYyAoKTsKICAgIGlzdHJlYW0mIHNlZWtnKHN0cmVhbXBv
cyk7CiAgICBpc3RyZWFtJiBzZWVrZyhzdHJlYW1vZmYsIF9zZWVrX2Rpcik7CiAgICBzdHJlYW1w
b3MgdGVsbGcoKTsKICAgIGlzdHJlYW0mIHB1dGJhY2soY2hhciBjaCkgewogICAgICAgIGlmIChn
b29kKCkgJiYgX3N0cmJ1Zi0+c3B1dGJhY2tjKGNoKSA9PSAoLTEpKSBjbGVhcihpb3M6OmJhZGJp
dCk7CiAgICAgICAgcmV0dXJuICp0aGlzO30KIC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gICAgICAgKl9fbXlfZnJlZV9saXN0ID0g
KF9PYmoqKV9TX3N0YXJ0X2ZyZWU7CiAgICAgICAgfQogICAgICAgIF9TX3N0YXJ0X2ZyZWUgPSAo
Y2hhciopbWFsbG9jKF9fYnl0ZXNfdG9fZ2V0KTsKICAgICAgICBpZiAoMCA9PSBfU19zdGFydF9m
cmVlKSB7CiAgICAgICAgICAgIHNpemVfdCBfX2k7CiAgICAgICAgICAgIF9PYmoqIHZvbGF0aWxl
KiBfX215X2ZyZWVfbGlzdDsKICAgICAgICAgICAgX09iaiogX19wOwoKCgogICAgICAgICAgICBm
b3IgKF9faSA9IF9fc2l6ZTsgX19pIDw9IF9NQVhfQllURVM7IF9faSArPSBfQUxJR04pIHsKICAg
ICAgICAgICAgICAgIF9fbXlfZnJlZV9saXN0ID0gX1NfZnJlZV9saXN0ICsgX1NfZnJlZWxpc3Rf
aW5kZXgoX19pKTsKICAgICAgICAgICAgICAgIF9fcCA9ICpfX215X2ZyZWVfbGlzdDsKICAgICAg
ICAgICAgICAgIGlmICgwICE9IF9fcCkgewogICAgICAgICAgICAgICAgICAgICpfX215X2ZyZWVf
bGlzdCA9IF9fcCAtPiBfTV9mcmVlX2xpc3RfbGluazsKICAgICAgICAgICAgICAgICAgICBfU19z
dGFydF9mcmVlID0gKGNoYXIqKV9fcDsKICAgICAgICAgICAgICAgICAgICBfU19lbmRfZnJlZSA9
IF9TX3N0YXJ0X2ZyZWUgKyBfX2k7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuKF9TX2NodW5r
X2FsbG9jKF9fc2l6ZSwgX19ub2JqcykpOwoKCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAg
IH0KICAgICAgICAgICAgX1NfZW5kX2ZyZWUgPSAwOwogICAgICAgICAgICBfU19zdGFydF9mcmVl
ID0gKGNoYXIqKW1hbGxvY19hbGxvYzo6YWxsb2NhdGUoX19ieXRlc190b19nZXQpOwoKCgogICAg
ICAgIH0KICAgICAgICBfU19oZWFwX3NpemUgKz0gX19ieXRlc190b19nZXQ7CiAgICAgICAgX1Nf
ZW5kX2ZyZWUgPSBfU19zdGFydF9mcmVlICsgX19ieXRlc190b19nZXQ7CiAgICAgICAgcmV0dXJu
KF9TX2NodW5rX2FsbG9jKF9fc2l6ZSwgX19ub2JqcykpOwogICAgfQp9CgoKCgoKdGVtcGxhdGUg
PGJvb2wgX190aHJlYWRzLCBpbnQgX19pbnN0Pgp2b2lkKgpfX2RlZmF1bHRfYWxsb2NfdGVtcGxh
dGU8X190aHJlYWRzLCBfX2luc3Q+OjpfU19yZWZpbGwoc2l6ZV90IF9fbikKewogICAgaW50IF9f
bm9ianMgPSAyMDsKICAgIGNoYXIqIF9fY2h1bmsgPSBfU19jaHVua19hbGxvYyhfX24sIF9fbm9i
anMpOwogICAgX09iaiogdm9sYXRpbGUqIF9fbXlfZnJlZV9saXN0OwogICAgX09iaiogX19yZXN1
bHQ7CiAgICBfT2JqKiBfX2N1cnJlbnRfb2JqOwogICAgX09iaiogX19uZXh0X29iajsKICAgIGlu
dCBfX2k7CgogICAgaWYgKDEgPT0gX19ub2JqcykgcmV0dXJuKF9fY2h1bmspOwogICAgX19teV9m
cmVlX2xpc3QgPSBfU19mcmVlX2xpc3QgKyBfU19mcmVlbGlzdF9pbmRleChfX24pOwoKCiAgICAg
IF9fcmVzdWx0ID0gKF9PYmoqKV9fY2h1bms7CiAgICAgICpfX215X2ZyZWVfbGlzdCA9IF9fbmV4
dF9vYmogPSAoX09iaiopKF9fY2h1bmsgKyBfX24pOwogICAgICBmb3IgKF9faSA9IDE7IDsgX19p
KyspIHsKICAgICAgICBfX2N1cnJlbnRfb2JqID0gX19uZXh0X29iajsKICAgICAgICBfX25leHRf
b2JqID0gKF9PYmoqKSgoY2hhciopX19uZXh0X29iaiArIF9fbik7CiAgICAgICAgaWYgKF9fbm9i
anMgLSAxID09IF9faSkgewogICAgICAgICAgICBfX2N1cnJlbnRfb2JqIC0+IF9NX2ZyZWVfbGlz
dF9saW5rID0gMDsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAg
ICAgX19jdXJyZW50X29iaiAtPiBfTV9mcmVlX2xpc3RfbGluayA9IF9fbmV4dF9vYmo7CiAgICAg
ICAgfQogICAgICB9CiAgICByZXR1cm4oX19yZXN1bHQpOwp9Cgp0ZW1wbGF0ZSA8Ym9vbCB0aHJl
YWRzLCBpbnQgaW5zdD4Kdm9pZCoKX19kZWZhdWx0X2FsbG9jX3RlbXBsYXRlPHRocmVhZHMsIGlu
c3Q+OjpyZWFsbG9jYXRlKHZvaWQqIF9fcCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBfX29sZF9zeiwKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBfX25ld19zeikKewogICAg
dm9pZCogX19yZXN1bHQ7CiAgICBzaXplX3QgX19jb3B5X3N6OwoKICAgIGlmIChfX29sZF9zeiA+
IChzaXplX3QpIF9NQVhfQllURVMgJiYgX19uZXdfc3ogPiAoc2l6ZV90KSBfTUFYX0JZVEVTKSB7
CiAgICAgICAgcmV0dXJuKHJlYWxsb2MoX19wLCBfX25ld19zeikpOwogICAgfQogICAgaWYgKF9T
X3JvdW5kX3VwKF9fb2xkX3N6KSA9PSBfU19yb3VuZF91cChfX25ld19zeikpIHJldHVybihfX3Ap
OwogICAgX19yZXN1bHQgPSBhbGxvY2F0ZShfX25ld19zeik7CiAgICBfX2NvcHlfc3ogPSBfX25l
d19zeiA+IF9fb2xkX3N6PyBfX29sZF9zeiA6IF9fbmV3X3N6OwogICAgbWVtY3B5KF9fcmVzdWx0
LCBfX3AsIF9fY29weV9zeik7CiAgICBkZWFsbG9jYXRlKF9fcCwgX19vbGRfc3opOwogICAgcmV0
dXJuKF9fcmVzdWx0KTsKfQoKCiAgICB0ZW1wbGF0ZSA8Ym9vbCBfX3RocmVhZH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