File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -76,25 +76,25 @@ escape_name(struct escaped_string *e, const struct name *n)
76
76
}
77
77
}
78
78
char * dp = e -> escaped ;
79
- const char * dep = dp + lim ;
79
+ const char * dsp = dp ;
80
80
for (p = sp ; p < ep ; p ++ ) {
81
81
char ch = * p ;
82
82
if (need_escape (ch )) {
83
- if (dp + escaped_char_size > dep ) {
83
+ if (dp + escaped_char_size - dsp > lim ) {
84
84
break ;
85
85
}
86
86
* dp ++ = '\\' ;
87
87
* dp ++ = oct (((uint8_t )ch >> 6 ) & 0x07 );
88
88
* dp ++ = oct (((uint8_t )ch >> 3 ) & 0x07 );
89
89
* dp ++ = oct ((uint8_t )ch & 0x07 );
90
90
} else {
91
- if (dp + 1 > dep ) {
91
+ if (dp + 1 - dsp > lim ) {
92
92
break ;
93
93
}
94
94
* dp ++ = ch ;
95
95
}
96
96
}
97
- assert (dp <= dep );
97
+ assert (dp - dsp <= lim );
98
98
if (lim != INT_MAX ) {
99
99
assert (e -> escaped == e -> small );
100
100
assert (dp + omitted_size <=
You can’t perform that action at this time.
0 commit comments