Bugzilla – Attachment 3038 Details for
Bug 1596
Option parser does not permit a double-quote character to occur in option values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
teach strdelim a set of escapes
bz1596.diff (text/plain), 1.13 KB, created by
Damien Miller
on 2017-08-25 13:52:29 AEST
(
hide
)
Description:
teach strdelim a set of escapes
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2017-08-25 13:52:29 AEST
Size:
1.13 KB
patch
obsolete
>Index: misc.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/misc.c,v >retrieving revision 1.113 >diff -u -p -r1.113 misc.c >--- misc.c 18 Aug 2017 05:48:04 -0000 1.113 >+++ misc.c 25 Aug 2017 03:48:52 -0000 >@@ -163,7 +163,7 @@ set_nodelay(int fd) > char * > strdelim(char **s) > { >- char *old; >+ char *old, *cp; > int wspace = 0; > > if (*s == NULL) >@@ -177,13 +177,24 @@ strdelim(char **s) > > if (*s[0] == '\"') { > memmove(*s, *s + 1, strlen(*s)); /* move nul too */ >+ > /* Find matching quote */ >- if ((*s = strpbrk(*s, QUOTE)) == NULL) { >- return (NULL); /* no matching quote */ >- } else { >- *s[0] = '\0'; >- *s += strspn(*s + 1, WHITESPACE) + 1; >- return (old); >+ for (cp = *s; ; cp++) { >+ if (*cp == '\0') >+ return NULL; /* no matching quote */ >+ if (*cp == '\\') { >+ /* Escape sequence */ >+ if (cp[1] == '\"' || cp[1] == '\'' || >+ cp[1] == '\\') { >+ memmove(cp, cp + 1, strlen(cp)); >+ continue; >+ } >+ return NULL; /* invalid escape */ >+ } else if (*cp == '\"') { >+ *(cp++) = '\0'; >+ *s += strspn(cp, WHITESPACE); >+ return old; >+ } > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1596
: 3038