Skip to content

Commit e6df417

Browse files
Merge pull request #767 from ossf/improve_oob1
Improve lab oob1
2 parents 43cbb7f + 86ea2a2 commit e6df417

File tree

2 files changed

+54
-12
lines changed

2 files changed

+54
-12
lines changed

docs/labs/oob1.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ <h2>Task Information</h2>
8383
if the minimum length of a response <tt>(1 + 2 + 16)</tt> is more than
8484
the length claimed by
8585
<tt>s->s3->rrec.length</tt>,
86-
and return 0 without sending a heartbeat,
86+
then return 0 without sending a heartbeat,
8787
This will prevent trying to create a heartbeat when there's not enough
8888
room to create a heartbeat at all.
8989
<p>
9090
Second, modify the code so that
9191
if the minimum length of a response with a payload
92-
<tt>(1 + 2 + payload + 16</tt>
92+
<tt>(1 + 2 + payload + 16)</tt>
9393
is more than the total length for a response given in
9494
<tt>s->s3->rrec.length</tt> then again
95-
return 0 without sending a heartbeat,
95+
return 0 without sending a heartbeat.
9696
<p>
9797
This will prevent trying to create a heartbeat when there's not enough
9898
room to create one and there was a payload to return as a heartbeat.

docs/labs/oob1.js

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,66 @@ info =
22
{
33
hints: [
44
{
5-
absent: "if",
6-
text: "Begin with \"if\" as we will return 0 when there is a problem."
5+
absent: "^ if",
6+
text: "Begin with \"if\" as we will return 0 when there is a problem.",
7+
examples: [
8+
[ " foo " ],
9+
],
710
},
811
{
9-
absent: String.raw`\(`,
10-
text: "Need \"(...)\" around the condition after an if statement."
12+
absent: String.raw`\(.*\)`,
13+
text: "Need \"(...)\" around the condition after an if statement.",
14+
examples: [
15+
[ " if " ],
16+
],
1117
},
1218
{
13-
absent: ">",
14-
text: "Need comparison \"if ( ... > ....)\""
19+
absent: "[<>]",
20+
text: "Need comparison \"if ( ... > ....)\"",
21+
examples: [
22+
[ " if ( x )" ],
23+
],
1524
},
1625
{
1726
absent: String.raw`s -> s3 -> rrec \. length`,
18-
text: "Need to compare a value with s->s3->rrec.length"
27+
text: "Need to compare a value with s->s3->rrec.length",
28+
examples: [
29+
[ " if ( length > 3 )" ],
30+
],
1931
},
2032
{
21-
absent: "return",
22-
text: "Need \"return 0;\" to skip attempts to send a too-long response."
33+
absent: "return 0 ;",
34+
text: "Need \"return 0;\" to skip attempts to send a too-long response.",
35+
},
36+
{
37+
absent: "^ if",
38+
text: "Begin with \"if\" as we will return 0 when there is a problem.",
39+
index: 1,
40+
},
41+
{
42+
absent: String.raw`\(.*\)`,
43+
text: "Need \"(...)\" around the condition after an if statement.",
44+
index: 1,
45+
},
46+
{
47+
absent: "[<>]",
48+
text: "Need comparison \"if ( ... > ....)\"",
49+
index: 1,
50+
},
51+
{
52+
absent: String.raw`s -> s3 -> rrec \. length`,
53+
text: "Need to compare a value with s->s3->rrec.length",
54+
index: 1,
55+
},
56+
{
57+
absent: "return 0 ;",
58+
text: "Need \"return 0;\" to skip attempts to send a too-long response.",
59+
index: 1,
60+
},
61+
{
62+
absent: "payload",
63+
text: "Need to consider the payload length.",
64+
index: 1,
2365
},
2466
],
2567
definitions: [

0 commit comments

Comments
 (0)