<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
<br>
I think this also likely indicates an issue in shell.c and/or<br>
login_prompt.c.<br>
<br>
<div id="main-source-line-644" class="source-line" style="color:
rgb(0, 0, 0); font-family: Consolas, 'Andale Mono WT', 'Andale
Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans
Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono
L', Monaco, 'Courier New', Courier, monospace; height: 1.3em;
white-space: nowrap; font-size: 12px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: 16.7999992370605px; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);"><span
class="source-line-number" style="color: rgb(153, 153, 153);
text-align: right; padding-left: 0.3em; padding-right: 0.2em;
display: inline-block; background-color: rgb(238, 238, 238);">644</span></div>
<div class="event-wrapper" style="white-space: nowrap; display:
table; color: rgb(71, 71, 71); font-family: 'Helvetica Neue',
Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 16.7999992370605px; orphans:
auto; text-align: start; text-indent: 0px; text-transform: none;
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">
<div class="event-row" style="display: table-row;"><span
class="source-line-number" style="color: rgb(153, 153, 153);
text-align: right; padding-left: 0.3em; padding-right: 0.2em;
display: table-cell; font-family: Consolas, 'Andale Mono WT',
'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter',
'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation
Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier,
monospace; background-color: rgb(238, 238, 238);"> </span>
<div id="defect-event-19722847-4" class="event-header with-event
main-event code-event event-set-0 model-event var_deref_model
selected-event grouped-event expanded" style="color: rgb(221,
68, 34); overflow: hidden; padding: 2px 2px 2px 25px;
white-space: normal; display: table-cell; border: 1px solid
rgb(125, 154, 170); cursor: pointer; background-image:
url(https://scan5.coverity.com:8443/images/sourcebrowser/marker-code-main-event.png);
background-color: rgb(252, 242, 238); background-position: 1px
2px; background-repeat: no-repeat;"><span class="defect-text"
style="display: block; margin-bottom: 2px;">CID 26083 (#1 of
1): Dereference after null check (FORWARD_NULL)</span><span
class="event-order">4.</span> <span class="event-tag"
style="font-weight: 700;">var_deref_model:</span> <span
class="description">Passing null pointer<span
class="Apple-converted-space"> </span><span class="code"
style="font-family: Consolas, 'Andale Mono WT', 'Andale
Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu
Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono',
'Nimbus Mono L', Monaco, 'Courier New', Courier,
monospace, serif; font-size: 1em; white-space: pre-line;
word-wrap: break-word; color: rgb(0, 0, 0); padding-left:
3px; padding-right: 3px;">out</span><span
class="Apple-converted-space"> </span>to<span
class="Apple-converted-space"> </span><span class="code"
style="font-family: Consolas, 'Andale Mono WT', 'Andale
Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu
Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono',
'Nimbus Mono L', Monaco, 'Courier New', Courier,
monospace, serif; font-size: 1em; white-space: pre-line;
word-wrap: break-word; color: rgb(0, 0, 0); padding-left:
3px; padding-right: 3px;">rtems_shell_login_prompt</span>,
which dereferences it.</span> [<a
href="https://scan5.coverity.com:8443/eventId=19722847-4&modelId=19722847-0&fileInstanceId=64396592&filePath=%2Fusers%2Fjoel%2Frtems-4.11-work%2Frtems%2Fcpukit%2Flibmisc%2Fshell%2Flogin_prompt.c&fileStart=150&fileEnd=209"
style="color: rgb(0, 124, 191); text-decoration: none;">hide
details</a>]</div>
</div>
</div>
<div id="main-source-line-645" class="source-line with-event
main-event code-event event-set-0 model-event var_deref_model
grouped-event" style="color: rgb(0, 0, 0); font-family: Consolas,
'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans
Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono',
'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New',
Courier, monospace; height: 1.3em; white-space: nowrap; font-size:
12px; font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: 16.7999992370605px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255);"><span class="scm" style="color: rgb(191, 191, 191);
vertical-align: top; display: inline-block; background-color:
rgb(238, 238, 238);"></span><span class="source-line-number"
style="color: rgb(153, 153, 153); text-align: right;
padding-left: 0.3em; padding-right: 0.2em; display:
inline-block; background-color: rgb(238, 238, 238);">645</span> <span
class="cpp_keyword" style="font-weight: 700;">return</span> <span
id="xref-632238432-0-4" class="xref xref-175967243"
style="cursor: pointer; border-width: 1px; border-style: solid;
border-color: transparent transparent rgb(204, 204, 204);">rtems_shell_login_prompt</span>(<span
id="xref-L-3803100-375-2" class="xref xref-L-3803100-53"
style="cursor: pointer; border-width: 1px; border-style: solid;
border-color: transparent transparent rgb(204, 204, 204);">in</span>, <span
id="xref-L-3803100-550-2" class="xref xref-L-3803100-54"
style="cursor: pointer; border-width: 1px; border-style: solid;
border-color: transparent transparent rgb(204, 204, 204);">out</span>, <span
id="xref-L-3803100-628-2" class="xref xref-L-3803100-55"
style="cursor: pointer; border-width: 1px; border-style: solid;
border-color: transparent transparent rgb(204, 204, 204);">env</span>-><span
id="xref-632238401-3-2" class="xref xref-175967699"
style="cursor: pointer; border-width: 1px; border-style: solid;
border-color: transparent transparent rgb(204, 204, 204);">devname</span>, <span
id="xref-L-3803100-349-2" class="xref xref-L-3803100-55"
style="cursor: pointer; border-width: 1px; border-style: solid;
border-color: transparent transparent rgb(204, 204, 204);">env</span>-><span
id="xref-632238424-1-2" class="xref xref-175967711"
style="cursor: pointer; border-width: 1px; border-style: solid;
border-color: transparent transparent rgb(204, 204, 204);">login_check</span>);</div>
<br>
Earlier in this method in shell.c, there is a test for out being
NULL.<br>
This code is outside that check so NULL could be passed into <br>
rtems_shell_login_prompt() which uses the NULL.<br>
<br>
The rtems_shell_login method that this code in is static and it is<br>
invoked in only one place with stdin, stdout. My analysis is that <br>
we should just add _Assert(in/out) and remove the "if (out)"<br>
code that appears to be unnecessary. This would eliminate<br>
the logic path that trips this error.<br>
<br>
Not as much a bug as useless tests leading to a confusing<br>
state.<br>
<br>
Comments?<br>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985</pre>
</body>
</html>