~lightdm-team/lightdm/1.14

« back to all changes in this revision

Viewing changes to src/xdmcp-server.c

  • Committer: Robert Ancell
  • Date: 2015-11-17 01:37:13 UTC
  • Revision ID: robert.ancell@canonical.com-20151117013713-61sfj6cx6cdqgin9
Handle XDMCP Request packet with no addresses

Show diffs side-by-side

added added

removed removed

Lines of Context:
363
363
    gssize index = -1;
364
364
 
365
365
    addresses_length = packet->Request.n_connections;
 
366
    if (addresses_length == 0)
 
367
        return NULL;
 
368
 
366
369
    addresses = malloc (sizeof (GInetAddress *) * addresses_length);
367
370
    for (i = 0; i < addresses_length; i++)
368
371
        addresses[i] = connection_to_address (&packet->Request.connections[i]);
377
380
        index = find_address (addresses, addresses_length, g_inet_address_get_family (source_address));
378
381
 
379
382
    /* Otherwise use the first available */
380
 
    if (index < 0 && addresses_length > 0)
 
383
    if (index < 0)    
381
384
        index = 0;
382
385
 
383
386
    for (i = 0; i < addresses_length; i++)