forked from github/server
fix null-pointer crash.
This commit is contained in:
parent
b2dc6a3a9d
commit
f1d78b4b84
|
@ -541,7 +541,8 @@ char *write_order(const order * ord, char *buffer, size_t size)
|
||||||
keyword_t kwd = ORD_KEYWORD(ord);
|
keyword_t kwd = ORD_KEYWORD(ord);
|
||||||
if (kwd == NOKEYWORD) {
|
if (kwd == NOKEYWORD) {
|
||||||
const char *text = ORD_STRING(ord);
|
const char *text = ORD_STRING(ord);
|
||||||
strlcpy(buffer, (const char *)text, size);
|
if (text) strlcpy(buffer, (const char *)text, size);
|
||||||
|
else buffer[0] = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
get_command(ord, buffer, size);
|
get_command(ord, buffer, size);
|
||||||
|
|
Loading…
Reference in New Issue