Mercurial > hg > nginx-quic
annotate conf/mime.types @ 8460:3974f4e56a4e
Mail: fixed s->arg_start clearing on invalid IMAP commands.
Previously, s->arg_start was left intact after invalid IMAP commands,
and this might result in an argument incorrectly added to the following
command. Similarly, s->backslash was left intact as well, leading
to unneeded backslash removal.
For example (LFs from the client are explicitly shown as "<LF>"):
S: * OK IMAP4 ready
C: a01 login "\<LF>
S: a01 BAD invalid command
C: a0000000000\2 authenticate <LF>
S: a00000000002 aBAD invalid command
The backslash followed by LF generates invalid command with s->arg_start
and s->backslash set, the following command incorrectly treats anything
from the old s->arg_start to the space after the command as an argument,
and removes the backslash from the tag. If there is no space, s->arg_end
will be NULL.
Both things seem to be harmless though. In particular:
- This can be used to provide an incorrect argument to a command without
arguments. The only command which seems to look at the single argument
is AUTHENTICATE, and it checks the argument length before trying to
access it.
- Backslash removal uses the "end" pointer, and stops due to "src < end"
condition instead of scanning all the process memory if s->arg_end is
NULL (and arg[0].len is huge).
- There should be no backslashes in unquoted strings.
An obvious fix is to clear s->arg_start and s->backslash on invalid commands,
similarly to how it is done in POP3 parsing (added in 810:e3aa8f305d21) and
SMTP parsing.
This, however, makes it clear that s->arg_start handling in the "done"
label is wrong: s->arg_start cannot be legitimately set there, as it
is expected to be cleared in all possible cases when the "done" label is
reached. The relevant code is dead and will be removed by the following
change.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 19 May 2021 03:13:20 +0300 |
parents | b3f4d83d6fd0 |
children | 3f0ab7b6cd71 |
rev | line source |
---|---|
450 | 1 |
2 types { | |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
3 text/html html htm shtml; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
4 text/css css; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
5 text/xml xml; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
6 image/gif gif; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
7 image/jpeg jpeg jpg; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
8 application/javascript js; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
9 application/atom+xml atom; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
10 application/rss+xml rss; |
589 | 11 |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
12 text/mathml mml; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
13 text/plain txt; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
14 text/vnd.sun.j2me.app-descriptor jad; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
15 text/vnd.wap.wml wml; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
16 text/x-component htc; |
450 | 17 |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
18 image/png png; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
19 image/svg+xml svg svgz; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
20 image/tiff tif tiff; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
21 image/vnd.wap.wbmp wbmp; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
22 image/webp webp; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
23 image/x-icon ico; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
24 image/x-jng jng; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
25 image/x-ms-bmp bmp; |
450 | 26 |
7302
bf1a7b363598
MIME: changed type for woff to font/woff (ticket #1243).
Valentin Bartenev <vbart@nginx.com>
parents:
7115
diff
changeset
|
27 font/woff woff; |
7303
118885f7a577
MIME: added font/woff2 type (ticket #1243).
Valentin Bartenev <vbart@nginx.com>
parents:
7302
diff
changeset
|
28 font/woff2 woff2; |
7302
bf1a7b363598
MIME: changed type for woff to font/woff (ticket #1243).
Valentin Bartenev <vbart@nginx.com>
parents:
7115
diff
changeset
|
29 |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
30 application/java-archive jar war ear; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
31 application/json json; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
32 application/mac-binhex40 hqx; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
33 application/msword doc; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
34 application/pdf pdf; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
35 application/postscript ps eps ai; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
36 application/rtf rtf; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
37 application/vnd.apple.mpegurl m3u8; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
38 application/vnd.google-earth.kml+xml kml; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
39 application/vnd.google-earth.kmz kmz; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
40 application/vnd.ms-excel xls; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
41 application/vnd.ms-fontobject eot; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
42 application/vnd.ms-powerpoint ppt; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
43 application/vnd.oasis.opendocument.graphics odg; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
44 application/vnd.oasis.opendocument.presentation odp; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
45 application/vnd.oasis.opendocument.spreadsheet ods; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
46 application/vnd.oasis.opendocument.text odt; |
7114 | 47 application/vnd.openxmlformats-officedocument.presentationml.presentation |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
48 pptx; |
7114 | 49 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
50 xlsx; |
7114 | 51 application/vnd.openxmlformats-officedocument.wordprocessingml.document |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
52 docx; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
53 application/vnd.wap.wmlc wmlc; |
8455
b3f4d83d6fd0
MIME: added application/wasm type (ticket #1606).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7303
diff
changeset
|
54 application/wasm wasm; |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
55 application/x-7z-compressed 7z; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
56 application/x-cocoa cco; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
57 application/x-java-archive-diff jardiff; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
58 application/x-java-jnlp-file jnlp; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
59 application/x-makeself run; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
60 application/x-perl pl pm; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
61 application/x-pilot prc pdb; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
62 application/x-rar-compressed rar; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
63 application/x-redhat-package-manager rpm; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
64 application/x-sea sea; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
65 application/x-shockwave-flash swf; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
66 application/x-stuffit sit; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
67 application/x-tcl tcl tk; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
68 application/x-x509-ca-cert der pem crt; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
69 application/x-xpinstall xpi; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
70 application/xhtml+xml xhtml; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
71 application/xspf+xml xspf; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
72 application/zip zip; |
450 | 73 |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
74 application/octet-stream bin exe dll; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
75 application/octet-stream deb; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
76 application/octet-stream dmg; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
77 application/octet-stream iso img; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
78 application/octet-stream msi msp msm; |
450 | 79 |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
80 audio/midi mid midi kar; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
81 audio/mpeg mp3; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
82 audio/ogg ogg; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
83 audio/x-m4a m4a; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
84 audio/x-realaudio ra; |
567 | 85 |
7115
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
86 video/3gpp 3gpp 3gp; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
87 video/mp2t ts; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
88 video/mp4 mp4; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
89 video/mpeg mpeg mpg; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
90 video/quicktime mov; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
91 video/webm webm; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
92 video/x-flv flv; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
93 video/x-m4v m4v; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
94 video/x-mng mng; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
95 video/x-ms-asf asx asf; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
96 video/x-ms-wmv wmv; |
4ff31c785d0c
MIME: added most common OpenDocument types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7114
diff
changeset
|
97 video/x-msvideo avi; |
450 | 98 } |