Skip to content
Snippets Groups Projects
Commit a018e5b8 authored by rswindell's avatar rswindell
Browse files

Added NULL pointer (strdup failure) check for good measure.

parent fe51ed58
Branches
Tags
No related merge requests found
......@@ -341,13 +341,14 @@ void SMBCALL smb_parse_content_type(const char* content_type, char** subtype, ch
if((p = strstr(buf, "text/")) == buf) {
p += 5;
if(subtype != NULL) {
*subtype = strdup(p);
char* tp = *subtype;
FIND_WHITESPACE(tp);
*tp = 0;
tp = *subtype;
FIND_CHAR(tp, ';');
*tp = 0;
if((*subtype = strdup(p)) != NULL) {
char* tp = *subtype;
FIND_WHITESPACE(tp);
*tp = 0;
tp = *subtype;
FIND_CHAR(tp, ';');
*tp = 0;
}
}
if(charset != NULL && (p = strstr(p, "charset=")) != NULL) {
p += 8;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment