Revision e30e5eb6

b/net/slirp.c
305 305
{
306 306
    struct in_addr host_addr = { .s_addr = INADDR_ANY };
307 307
    int host_port;
308
    char buf[256] = "";
308
    char buf[256];
309 309
    const char *src_str, *p;
310 310
    SlirpState *s;
311 311
    int is_udp = 0;
......
325 325
        return;
326 326
    }
327 327

  
328
    if (!src_str || !src_str[0])
329
        goto fail_syntax;
330

  
331 328
    p = src_str;
332
    get_str_sep(buf, sizeof(buf), &p, ':');
329
    if (!p || get_str_sep(buf, sizeof(buf), &p, ':') < 0) {
330
        goto fail_syntax;
331
    }
333 332

  
334 333
    if (!strcmp(buf, "tcp") || buf[0] == '\0') {
335 334
        is_udp = 0;

Also available in: Unified diff