diff --git a/NEWS b/NEWS
index 2f82232eb1669c9ac92626864b46a1cb8fe76fdd..71bcf0a17fc044f444e71a9d0b3d1c2bb7b1abb9 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ documents those changes that are of interest to users and admins.
  -- In sched/wiki2, fix possible overflow in job's nodelist, from 
     Ernest Artiaga, BSC.
  -- Defer creation of new job steps until a suspended job is resumed.
+ -- select/linear - fix for potential stack corruption bug.
 
 * Changes in SLURM 1.2.2
 ========================
diff --git a/src/plugins/select/linear/select_linear.c b/src/plugins/select/linear/select_linear.c
index 3144d157b053e36dec8bb8e8be924a4fbf2614f6..2aa503dd3b3aa61301fca87b5f9c3b7b24ac5a1f 100644
--- a/src/plugins/select/linear/select_linear.c
+++ b/src/plugins/select/linear/select_linear.c
@@ -732,17 +732,17 @@ extern int select_p_get_extra_jobinfo (struct node_record *node_ptr,
 	switch (info) {
 	case SELECT_AVAIL_CPUS:
 	{
-		uint32_t *tmp_32 = (uint32_t *) data;
+		uint16_t *tmp_16 = (uint16_t *) data;
 
 		if ((job_ptr->details->cpus_per_task > 1)
 		||  (job_ptr->details->mc_ptr)) {
 			int index = (node_ptr - node_record_table_ptr);
-			*tmp_32 = _get_avail_cpus(job_ptr, index);
+			*tmp_16 = _get_avail_cpus(job_ptr, index);
 		} else {
 			if (slurmctld_conf.fast_schedule) {
-				*tmp_32 = node_ptr->config_ptr->cpus;
+				*tmp_16 = node_ptr->config_ptr->cpus;
 			} else {
-				*tmp_32 = node_ptr->cpus;
+				*tmp_16 = node_ptr->cpus;
 			}
 		}
 		break;
diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index a628f2806c8f6bdbc5fed5f206ff15cc9f209c9a..0e814c660daf749049309d2a8f886e8e1baede96 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -453,8 +453,9 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 		 uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes)
 {
 	int error_code = SLURM_SUCCESS, i, j, pick_code;
-	int total_nodes = 0, total_cpus = 0; 
-	int total_mem = 0; /* total_: total resources configured in
+	int total_nodes = 0;
+	uint16_t total_cpus = 0; 
+	uint32_t total_mem = 0; /* total_: total resources configured in
 			      partition */
 	int avail_nodes = 0, avail_cpus = 0;	
 	int avail_mem = 0; /* avail_: resources available for use now */